AadamZ5 / AadamZ5/chords

Support note tunings

Aperta
#3 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
0
Fork
0
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The `Note` object currently supports conversion to Hertz, but no conversion back. We have Hertz values hard-coded, meaning a different tuning isn't possible.

We should allow users to use a new `Tuning` object that specifies how to calculate the hertz value for the notes. We could implement this as a Trait, meaning it could be extended by library users.

ex:
```rust
pub trait Tuning {
fn to_hertz(&self, &Note) -> u32;
fn from_hertz(&self, u32) -> Option;
fn from_hertz_nearest(&self, u32) -> Note;
}
```

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.