Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- inline function isWhiteKey(midiNote)
- {
- // White keys in an octave
- local whiteKeys = [0, 2, 4, 5, 7, 9, 11];
- // Note number in an octave
- local noteInOctave = midiNote % 12;
- // Check if the note is in the list of white keys
- return whiteKeys.contains(noteInOctave);
- }
Advertisement
Add Comment
Please, Sign In to add comment