Skip to content

Instantly share code, notes, and snippets.

View JoshuaGrams's full-sized avatar

Joshua Grams JoshuaGrams

  • Vienna, Maine, USA
View GitHub Profile
@JoshuaGrams
JoshuaGrams / first-up.c
Created August 23, 2017 17:08
First-up chord algorithm
Chord prev_keys = NONE, can_trigger = ALL;
void process_sample(Chord keys) {
Chord released = prev_keys & ~keys;
if(released & can_trigger) {
send_chord(prev_keys);
// These keys do not fire a chord the next time they are released.
can_trigger = ~keys;
}