The problem of malfunctioning when playing a particular Scale was solved by changing the octave bandwidth division & pitch determination from 12 averages to a “round-robin method for 96nn”.
The naming of the variable for the scale setting item, which was determined by repeated physical matching, is dumb, though,
The midiNote output from USB_MIDI will be checked later.
Then adjust the offset for the midi note number output.