Pitch bending with SamplerBox

Reza Yazdi posted Sep 18 '17, 08:25:

Is it possible to use the modulation wheel on the MIDI keypad to do "pitch bending"?

Ayskura posted Sep 23 '17, 15:21:

I would be interested in pitch bend too please!

AlexM posted Sep 25 '17, 06:00:

@Hans has implemented a pitchbend feature in his great version of SamplerBox. I have also used his work in my forked repo. How do you get to and modify this feature? Ok, this is a bit confusing (for the moment!)

Side note: the crowdfunder we're launching in a couple of months is for a RPi hat that takes all the DIYing hardware and software away from you - including MIDI mapping of MIDI controls to functions such as pitch bending :)

I'll explain what I think is the easiest way to achieve this.

  • Let's assume you've installed the latest image to your SD card.

  • Now, in /SamplerBox/modules/midicallback.py let's look at lines 212-213
elif messagetype == 14:  # Pitch Bend
    gv.ac.pitchbend.set_pitch(velocity, note)
  • @Reza, if we're using the mod wheel as the pitch bend control, then we need to modify this section to:
elif messagetype == 11:  # control change
    if (note == 1): # wait for CC 1 to come through
        gv.ac.pitchbend.set_pitch(velocity, note) # do pitch bend

I haven't tested this, but I think it should work.

If you want to use a different control, you can find out its MIDI control number by printing something like: print messagetype, note towards the beginning of the midicallback function


  (not published)
  I want to post as guest