Conditional If/Then Routing

Hello all,

Love the MidiHub! I have a BopPad percussion pad controller from Keith McMillen that I’m running to the MidiHub before sending to a hardware synth. The BopPad has 4 quadrants that can send note-on messages along with additional CC messages and values. Message values can be tied to velocity, pressure, radius- continuous, and initial strike radius.

I’m trying to use the device as a mini/finger kit and need more than 4 sounds available. I have figured out how to send two unique CCs in the same quadrant and then convert them to notes and filter values to relate to a portion of the quadrant using the MidiHub transform pipe, BUT I do this using initial strike radius and that makes them all at the same velocity no matter how strong/weak I strike the drum.

It would be great to have a conditional formatting pipe (IF/THEN) to be able to get velocity data back to these notes.

It would look something like this:

  1. CC16 sends initial strike point value (0-127 from center to rim)
    2A. If CC16 is less than or equal to 80, then pass through CC17 data (Note with velocity)
    2B. If CC16 value is greater than or equal to 81, then pass through CC18 data (Note with Velocity)

Anyone have any other ideas to keep the regions separated AND bring velocity back to the note?

Hello Alex,

Here’s maybe a way of thinking about it:

Hypothetically speaking…

If you imagine a having a second Midihub, you would use the CC16 in Midihub1 to Transform-Replace it into events that would become a mapping inputs in Midihub2, right?

Then in Midihub2, you’d decide how to achieve what you want (maybe two lines; one for 18, other for 17. maybe one line with two CC range Filters, etc).

This would then dictate what your mapping events would need to be (eg. Two Bypass On/Off | Off/On events using an unused CC/channel)

In the above we need two Midihubs because Midihub will only map to an CC/note recognised at a USB/DIN input.
So currently, to use only one Midihub, you’d need to emulate having two by using a physical USB/DIN loopback.

If you’ve got the free ports for this, you just need to take care not allow any incoming event to leave the loop. :infinity:


Loopback patches: There are examples tagged physical-loopback on patchstorage, some more complex than others. From memory, the ‘EQ settings’ and ‘Converting Program Changes’ patches are closest to what you need in terms of basic principles – latter involves also storing a state which is beyond needs of your design.

I’m struggling to understand your response (that’s my own failing in understanding the terminology).

I don’t want to transform CC16 into CC17 or CC18 since I can send CC17/18 directly from the BopPad with velocity data. I want CC16 value to act as a gate to redirect CC17 and CC18 to play when the CC16 value is within a certain range because that CC16 value is tied to a physical location on the BopPad (CC16, 0-80 is closer to the center, CC16 81-127 is closer to the rim). I tried to do a loopback similar to the ‘Converting Program Changes’ but I think I’m running into a lack of understanding of terminology of how CC transformation would be used in this situation since the velocity data is on CC17 and CC18 and I can covert those CCs to Notes and use the Velocity as a value and get a sound based on how hard I strike.

Edit- Had my CC #s swapped.

Sorry Alex, didn’t pick this up until now.
It’s probably me who’s being unclear.

I was basing my explanation on what you wrote…

…in that my guff about CC16 in the loopback was to use it to create a ‘gatekeeper’ mapping.
I’ll have another look at the “bring velocity back to the note” bit (with your extra clarification[1]) tomorrow when I’m a bit more awake.

In meantime, if you want to post your patch here or PM it to me, I’ll have a look!

Cheers.

[1] What note ids/values, by the way? Fixed or do want to get fancy and have them somehow related to ‘radius’?

I want the notes to be specific to the half of the quadrant, but values to vary based on velocity to create volume based on strike intensity. The drumpad can send the velocity data on the CC, but I need a gate to open/close which half of the quadrant is allowed to play through.

Ideally, I’d like it to look like:

First Quadrant
CC16, values 0-127 based on initial radius strike point
CC17, values 0-127 based on velocity- being transformed into C#3 (Crash Cymbal on my synth), gate opens when CC16 value is 0-80
CC18, values 0-127 based on velocity- being transformed into B3 (Ride Cymbal), gate opens when CC16 value is 81-127

Second Quadrant
CC19, values 0-127 based on initial radius strike point
CC20, values 0-127 based on velocity- being transformed into F#3 (Tambourine), gate opens when CC19 value is 0-80
CC21, values 0-127 based on velocity- being transformed into A1 (Bass Drum), gate opens when CC19 value is 81-127

Third Quadrant
CC22, values 0-127 based on initial radius strike point
CC23, values 0-127 based on velocity- being transformed into D#4 (Hi Conga), gate opens when CC22 value is 0-80
CC24, values 0-127 based on velocity- being transformed into D2 (Snare Drum), gate opens when CC22 value is 81-127

Fourth Quadrant
CC25, values 0-127 based on initial radius strike point
CC26, values 0-127 based on velocity- being transformed into D4 (Conga Slap), gate opens when CC25 value is 0-80
CC27, values 0-127 based on velocity- being transformed into E4 (Low Conga), gate opens when CC25 value is 81-127

Currently, my setup is only sending initial strike radius data for each CC in the quadrant and I’m filtering values 0-80 for one note, and 81-127 for the other. If I set velocity to ‘value’ in the transform pipes it makes the interior ring notes quieter than the exterior because the value is related to a physical location on the radius instead of velocity. I have instead set it to Arg 2 and set the value at 70-100 depending on the sound so that they area relatively balanced, but it limits my ability to play with much musicality.

Setup of the BopPad interface:

My current patch:

Klezmer- Fixed Velocity.mhp (520 Bytes)

To anyone coming across this topic down the line,
I’m happy to report this was totally wrong!

After working with @AlexMcMahon in PMs, it suddenly dawned a different CC could be Transformed.
So no loopback and much simpler!

2 Likes

Yeah, we got it! @resonotter was EXTREMELY helpful in making this happen! I will report back to the KMI user group too- this might unlock some serious opportunities for more capable players. My intent was only to open up two notes per quadrant, but the concept could probably allow for 3 or more notes (depending on how sensitive the BopPad is set up and the prowess of the player).

2 Likes

nice idea, I’ll let you know when it’s ready for patchstorage.

1 Like

New user and am wondering what the answer to this question was as am trying to do something similar to create accent notes and am not sure how to do it.

What I want to do is a conditional statement based on velocity in which if a note on message is received with a velocity greater than 100 (or some other value to be specified) a second action takes place. In my case, I’d like to create a duplicate note on/off message that is transposed 8 semitones (or some other value).

Doing the duplication and transposing seems easy, but how do you do something based on velocity value?

Hey, Batch, welcome to Midihub.

Good to see you going deep early!

a conditional statement based on velocity

Transform is your friend here.

You use a Note On → Note On Transform…

Screen Shot 2024-04-14 at 15.58.57

…preserving everything apart from the channel (here I’ve set it to 16)

But you also set the Transform to work with only when velocity is 100-127


To process the original & copy Note Ons differently, you will need to

  • route the flow to say Virtual A OUT,
  • then on two Virtual A IN lines, use Channel Filters to ensure only your dups go onto to be Transposed


Note Off
MH doesn’t know which Note Offs “belong” to loud notes.
So use a 2nd similar Transform to duplicate all Note Offs.
Most synths won’t misbehave if offered excess Note Off messages.

If, however, you’re happy with fixed length Accent Notes then this is not an issue


PS.

The original BopPad solution patch is on patchstorage but, as I recall, it involves using CC → Note on (with fixed length cos it was for percussion)

1 Like