Giter Club home page Giter Club logo

musika-rs's Introduction

Simplee > Musika

Crates.io CI GitHub top language License:MIT GitHub code size in bytes GitHub last commit GitHub watchers

Description

A Rust crate for musical basic elements.

use musika_rs::{C, chords::{self}, scales::{self}};

let chord = C.maj();
println!("{chord:X}");

let scale = scales::major(C);
println!("{scale:X}");

Build and Run

To build the crate

cargo build

To build and view the internal documentstion:

cargo doc --open

You can find more examples in the examples folder. To run an example:

cargo run --example find

Sharps and Flats

The crate allows you to print the notes either with sharps (#) or flats(b) by using X or x when fomating the chords or the scales:

let scale = minor(C);
assert_eq!(format!("{scale:X}"), "C minor [C, D, D#, F, G, G#, A#, C]");
assert_eq!(format!("{scale:x}"), "C minor [C, D, Eb, F, G, Ab, Bb, C]");

Chords

The crate allows you to build the following chords:

You can find all the chords in the chords folder.

Scales

The crate allows you to build the following scales:

use musika_rs::scales::*;

let scale = scales::major(C);
assert_eq!(format!("{scale:X}"), "C major [C, D, E, F, G, A, B, C]");
assert_eq!(format!("{scale:x}"), "C major [C, D, E, F, G, A, B, C]");

You can find all the scales in the scales folder.

Piano Exercises

You can find all piano exercises implemented in the exercises examples. You can see the practices by running:

cargo run --example exercise1
cargo run --example exercise2
cargo run --example exercise3
cargo run --example exercise4
cargo run --example exercise5
  • Exercise 1 | C - Am | F - G |
  • Exercise 2 | C - G | Am - F | C - G | F - Em - Dm - C |
  • Exercise 3 | Cx4 | Gx4 | Gx4 | Cx4 | Fx4 | Cx4 | Gx4 | Cx4 |
  • Exercise 4 | C | F | Bdim | Em | Am | Dm | G | C |
  • Exercise 5 | Dm9 Dm9 | G13 G13 | Dm9 Dm9 | G13 G13 |

Jazz Exercises

Resources

About

Code designed and written on the beautiful island of Saaremaa, Estonia.

musika-rs's People

Contributors

veminovici avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.