hey! so that was the first musical thing i’ve coded and i didn’t realize how much would have to be changed to adapt to different engines (polyphony…), so i started over on one based on loom, and instead of getting chords based on midi in i am changing the sequencer based on major/minor tonality and the circle of fifths. so it went a bit left.
that code is probably broken because of the params update but should be easy to tweak. the trickiest bit is dealing with filling out the notes for step sequencer correctly, that one is just arbitrarily adding octaves for some reason. in spite of this it actually sounds pretty cool, but it’s more like a drum machine than an arpegiator.
i can put up my new WIP code if interested, but broadly here is how i’m fixing those issues:
-the active chord/scale gets defined as all the notes in in the scale in the music util library, something like 70 notes. the app then picks the the notes to put on the grid based on separately determined octave variable. advantage of doing it this way is you don’t have to tell the app how to fill out the scale, you can just pull from every single note in key.
-a message to change to new chord/scale generates a new 70 something note bank, then a third note bank that is comprised of all of the common tones between the two scales. then for notes that aren’t common it finds the closest common semitone. (i think, don’t have the script in front of me)
-the scale is then reduced to the grid size, and it checks for duplicate pitches between steps. if found it replaces duplicate with the closest note to it from previous step and resets the duplicate check.
-the snap note to array command in the library doesn’t equally distribute the notes so i had to write this up instead.
kind of a word bomb but hopefully some useful info in there. let me know if i can help at all!