Crates.io | hapsi |
lib.rs | hapsi |
version | 0.0.3 |
source | src |
created_at | 2023-08-26 09:01:37.179136 |
updated_at | 2023-08-30 10:39:16.513432 |
description | A music theory package |
homepage | |
repository | https://github.com/zen-en-tonal/hapsi |
max_upload_size | |
id | 955421 |
size | 33,164 |
A package that represents a musical concept.
use hapsi::prelude::*;
let scale = Diatonic::major(&"C".parse().unwrap());
let scaled = Scaled::new(scale, Twelve);
let keyboard = Keyboard::new(scaled);
let mut tones = keyboard.class_iter();
assert_eq!(tones.next(), Some(&"C".parse().unwrap()));
assert_eq!(tones.next(), Some(&"D".parse().unwrap()));
assert_eq!(tones.next(), Some(&"E".parse().unwrap()));
assert_eq!(tones.next(), Some(&"F".parse().unwrap()));
assert_eq!(tones.next(), Some(&"G".parse().unwrap()));
assert_eq!(tones.next(), Some(&"A".parse().unwrap()));
assert_eq!(tones.next(), Some(&"B".parse().unwrap()));
assert_eq!(tones.next(), None);
WIP