Crates.io | musika-rs |
lib.rs | musika-rs |
version | 0.1.0 |
source | src |
created_at | 2024-03-20 06:46:24.958278 |
updated_at | 2024-03-20 06:46:24.958278 |
description | Crate for basic music elements |
homepage | https://github.com/veminovici/musika-rs |
repository | https://github.com/veminovici/musika-rs |
max_upload_size | |
id | 1180032 |
size | 49,463 |
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}");
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
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]");
The crate allows you to build the following chords:
You can find all the chords in the chords folder.
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.
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
Code designed and written on the beautiful island of Saaremaa, Estonia.