monome / crow

Crow speaks and listens and remembers bits of text. A scriptable USB-CV-II machine
GNU General Public License v3.0
162 stars 34 forks source link

fix scale windows to avoid edge triggers #443

Closed trentgill closed 2 years ago

trentgill commented 2 years ago

re-engineered the method for detecting input.scale changes. previously the windowing was incorrectly based on the previous output, where it should have been based on the previous input.

here things are reorganized & optimized so the bounds check is as fast as possible. when a change is detected we calculate what the new window is, and raise an event, but also calculate the bounds of the current window (to speed up detection of the next note.

there is also an improvement in the empty-table == chromatic shortcut. now 'octave' and 'note' are correctly reported, rather than being the same (previously we hacked it by treating each semitone as an octave).

Fixes #381