Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Melody Maker Notes/Pitch Arrays are Inversely mapped #75

Open
hawkerm opened this issue Apr 13, 2024 · 0 comments
Open

Melody Maker Notes/Pitch Arrays are Inversely mapped #75

hawkerm opened this issue Apr 13, 2024 · 0 comments

Comments

@hawkerm
Copy link

hawkerm commented Apr 13, 2024

If you look at this code here:

'notes' : ['C', 'D', 'E', 'F', 'G', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'A', 'B'],
'pitches' : ['C3', 'D3', 'E3', 'F3', 'G3', 'A3', 'B3', 'C4', 'D4', 'E4', 'F4', 'G4', 'A4', 'B4'],

And how it maps to colors here:

//keys
'C' : '#BF4FA8',
'C#' : '#8064c6',
'Db' : '#8064c6',
'D' : '#4D61D8',
'D#' : '#ed3883',
'Eb' : '#ed3883',
'E' : '#45B5A1',
'F' : '#95C631',
'F#' : '#f6be37',
'Gb' : '#f6be37',
'G' : '#EDD929',
'G#' : '#95c631',
'Ab' : '#95c631',
'A' : '#F7943D',
'A#' : '#45b5a1',
'Bb' : '#45b5a1',
'B' : '#E33159',

It is incorrectly handled and mapped somewhere; I couldn't pinpoint exactly where the inversion occurs.


image

The top 'magenta' note in the top-left of the grid is actually the MIDI note B4 at the end of the pitches array, however in the tile code it is indexed by y from the top-down on the screen and is index 0, therefore it gets mapped to the C of the notes array and gets assigned the color #BF4FA8 which is magenta:

image

I would expect the notes pitches and the colors which represent them to remain the same with any fix for this issue (i.e. there's no change to the user experience with a fix, no one would see or hear a change). But it'd be nice for the code to behave and represent the proper matching of note to color alignment for posterity. It's probably easiest to reverse the notes array, and then modify the color table to remap the colors based on what the actual notes used are vs. the incorrect mapping that exists today.

i.e. B should map to #BF4FA8 and A# should map to #8064C6, etc...

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant