MIDI Output mismatch when using shaper

edited July 2020 in Known issues


I've been using Drambo to control a hardware fm synth. Because there aren't unipolar knobs, I use a Graphic Shaper to get the CC outputs to align to 0-127. This works fine for controlling inside Drambo, but when using the Midi Output module, the max output is 126, even though the monitor shows a value of 127 for the same message. This doesn't happen however when I run Knob directly into MIDI CC generator.

To me it looks like MIDI Output is rounding differently than MIDI Monitor. For what its worth I made sure Shaper was "snapping" to the max value.

Comments

  • Hi. Drambo actually makes this easy for you. Remove the shaper and enable Bipolar Input on the CC Generator. Output is 0 for input -1, 127 for +1.

  • edited July 2020

    @uncleDave Wow, that was right infront of me! Sometimes there are so many options in Drambo my brain stops processing them! Thanks :) That fixes my reported control issue as it allows 127.

    Sadly, this is still a bug that has to be worked around, as it also effect LFOing a CC Output. It happens regardless of the bipolar setting on LFO and CC Output.

  • If you hate that the CC Generator sends a CC for any input change, you can use this quantizer to stop it. The logic is as follows:

    We want to quantize the input to N levels. The input value is x, ranging from 0 to 1.

    a = 0.5 + (N-1) * x

    b = int(a)

    y = b / (N-1)

    The modules from Number2 through Divide implement this logic. The Quantize module actually truncates to integer. The scaling and rounding (addition of 0.5) are key to producing uniform results over the full range. The screenshot shows N=9, so the multiplier N-1 is 8. The quantizer is driven by an LFO, and the result is converted to CC and displayed on the scope. The screenshot confirms that each CC is generated only once. The scope shows that each level is held for the same duration. This means the steps are equal, with half steps at the ends. For a full range CC, N=128 (values 0 to 127), and the multiplier N-1 is 127. (I posted this previously, but without the rounding step. This version is more precise at the ends of the range.)

    The best way to handle a bipolar input is to convert it to unipolar, as follows:

    x = 0.5 + 0.5 * z

    where z is the bipolar signal. You can do this in various ways; this one is handy because you can use the Number 0.5 twice. You cannot gracefully get the rounding right processing the bipolar value directly. The attached sample project file implements the bipolar case. You can switch to unipolar by bypassing the first few steps.


  • edited July 2020

    @uncleDave This is rad! I think I could use this to get the CC output to actually output 127 via Midi Output (tho maybe the rounding issue would rear its head). I'll likely wait on controlling my synth until @giku gets a chance to look at the issue. But quantizing the values it something I could see myself using to spam my synth less.

  • Right. If you're sending several LFOs via different CCs, the MIDI traffic could be awful, if you don't quantize them.

  • edited July 2020

    I hooked up the 9-level quantizer (factor of 8) in AB3, with output to MIDISpy. It definitely outputs 127 for a significant interval. But I see the following discrepancy:

    MIDISpy shows CC values 0, 15, 31, 47, 63, 79, 95, 111, 127.

    Drambo Monitor shows 0, 16, 32, 48, 64, 79, 95, 111, 127.

    Now, there has to be an odd step (15, not 16) somewhere, in order to end on 127. But it seems like the Drambo monitor is not showing the actual CC values being transmitted, but just conversions of the internal "analog" CV values. And it does this slightly different from the MIDI Output module, where CC messages are actually created. Hmmm...

    I've noticed that, if you get the rounding wrong, only the exact maximum (1.000) value converts to 127, while anything less gives 126 or lower. That might be what you were seeing when there was no 127 output. The rounding creates a "flat spot" at the max (and min) value, so it's treated symmetrically with the other values.

    Replaced MIDISpy with another Drambo, converted CC back to analog. Looks OK on scope. Monitor confirms MIDISpy results. The transmitted CC value is slightly different from shown on the sending internal monitor. (But it's really close.;)

  • I will look at the issue and let you know.. (coming back in 2 days)

  • Thanks! Sorry, didn't mean to summon you now :) . Hope you are enjoying time away.

Sign In or Register to comment.