Color notes using midi note names
I know almost nothing about using computer language.
I downloaded the Color Notes Plugin and changed it (with a text editor) so I could color notes with custom colors (e.g. make all notes gray except B which will be red and C which will be green). It works! I'm running it in Plugin Creator.
Problem - notes of different pitches are the same color - as in example above all Bs are red and all Cs are green.
Is there a way to make, for instance, C4 grey, C5 green, and C6 gray?
I found "midi note names" where C4 is 60, C5 is 72, etc. Can I use the midi note name somehow to designate a color and how would I phrase it in a plugin?
(Yes, I'm aware that not everyone agrees that middle C is C4. In fact I need the colored notes for handchime music where middle C is C5 but it seems like a trivial problem to fix that in my plugin.)
Thanks!
Kate
Comments
Instead of pitch%12 to get the position inside an octave use pitch/12 to get the octave.
In reply to Instead of pitch%12 to get by Jojo-Schmitz
As I said, I know virtually nothing about coding.
There must be another step to this process.
I changed pitch%12 to pitch/12.
I get this error (31 times):
109:-1: Error: Cannot assign [undefined] to Color
I think I need something like:
Color 60 = "red"
Color 61 = "blue" (or hex or rgb equivalents)
Thanks.
In reply to As I said, I know virtually by Musikate
Try (Math.floor(note.pitch / 12)