Utility for MIDI-CC

I’ve been playing with MIDI Synths for a while and found it inconvenient to look up addresses for CC messages every time, so here’s a bit of code to use parameter names:

#Map of Parameter Name / CC Address
map = {cutoff: 27, pan: 28}

define :mapped_cc do |args|
  for a in args
    midi_cc map[a[0]], a[1]
  end
end

mapped_cc cutoff: 64
1 Like