barestides / eme-ene

Tool for algorithmically generating music.
Eclipse Public License 1.0
0 stars 0 forks source link

Representing notes #8

Open barestides opened 6 years ago

barestides commented 6 years ago

There are at least three different useful ways to refer to a note: Midi number: 60 "musical" note: C4 (middle c) frequency : 261.63 hz all the info

We can just have a data structure with all of this in it. Just a vector of maps, I think; and then we could have index-by fns if you want to reference one of the vals

barestides commented 6 years ago

At any given time, we might want to work with the note as any of the three attributes. This is why I like having it as a map. But if we want to do a simple operation like dec by 2 semitones, we now need special function specifically for this new data structure. Is this ok? I think so.

barestides commented 6 years ago

Using a map everywhere is getting ugly fast. Perhaps it's best to always use midi, and look up the freq / note name when whenever we need it