Converting MIDI CC value to pitchbend

Hi.

I have issue with controlling pitch bend via Cardinal from Control2CV:

My expectations are that in the middle position of Control2CV there should be no pitchbend (8192) value.
However, in both the middle position and max positions I get 16k, and get 8192 when in min position.

Basically, looks like pitchbend works only one way, and only half of the range is in use.

Context:

I have a Artiphone Re.corder midi bluetooth flute.
It does not have pitchbend, but can generate CC signals from rotation, and want to use that for pitchbend - rotation left (towards 0 CC value) - pitchbend down, rotation right ( towards 127 CC value) - pitchbend up, 64(63?) is the middle.

It proved to be surprisingly convinient when done with M4L devices in ableton, and I am trying to repeat that on MOD by mapping midi CC to Control2CV and converting signal to pitchbend using Cardinal.

P.S.
My guess is that there is a [-5; +5v] / [0;+10V] logic mismatch, but cannot find how to express that idea as a usable workaround. Something like constantly subtract 5v from the Control2CV output.

UPD:
Scope seems to read from 0 to 10 voltage just fine, with 5 volts in the middle position of the flute/Control2CV/64CC value, and 0 and 10 in the edge positions.

Looks like it is Cardinal Host midi sending incorrect pitchbend values.

I’ve had a sort of similar issue assigning cc7 as a negative unipolar to any parameter on the dwarf. Except it locks the parameter in place and doesn’t modify it. Might it be related?

Just to make sure, have you checked that the ‘advanced’ menu where you assign parameter is set to bipolar?

This might be a case for a pd-patch with heavy!
Can you give the CC numbers? I can try to mock up a conversion plugin.

I am using CC 12 for my case, thanks!

Something like this should do it:

(ignore the top right, that’s just for testing)

I can’t upload the patch here, but you can easily replicate this in plugdata and totally seems to work in a quick local test build :slight_smile:

You could of course also add parameters for setting the specific CC and channel.

It is now hardcoded for CC 12 and omnichannel.
So depending on your midi chain this could mess up another instrument :wink:

oops, I forgot that MOD Cloud Builder cannot configure midi ports yet

Seems like i’ve answered into the original thread and my question was moved to a separated topic while i was writing. Duplicating here as well.


Interesting) Never tried pd, and looks like I’ve missed some important topic which explains how to launch that on MOD, would try to find it on the forum.

But if you know a good place to start, I would apprecate the link.
This visual code really looks similar to Max4live.

Meanwhile, looks like after looking into all the available plugins I’ve found offset plugin that fixed issue for me:

With this offset of -5v I’ve started getting values from 0 to 16k of pitchbend and it works correctly.
I wonder if this should be consided to be a bug that pitchbend output requires -5 to 5v or not?


Still makes sense to look into PD approach, as some “dead zone” theshold is a nice addition to the CC to Bend conversion, to avoid unintended bends, thank you for your PoC effort.

Oops, sorry. Hope you don’t mind!

There is a whole section on PD: Pure Data - MOD Audio Forum
The online builder is a little bit hidden still. It was announced last September: Release 1.13.3

1 Like

Oh yes, good idea. Right now it goes from CC 63 = -65 to CC 64 = 64 but it would be nice if say CC 59 through 68 (10 CC values in the middle) would just output 0. Or something?

Ok this was fun to try, now it has a little dead-zone of 8 CC in the middle (seemed to work allright on the test-slider, but this could also be configurable of course :D):

2 Likes

Thank you for your help, I would try that after getting some sleep)
Looks promising.

Seems like forum settings should be tuned to allow PD files. Forum has a whole PD dedicated section after all.

@gianfranco Sorry to disturb, but I do not know who is exactly responsible for the forum settings or who can be considered as a “first line support entry point” and therefore whom to tag. I believe .pd files should be allowed for upload and that would be good for the community. I hope you can pass it to the responsible team member.

I was able to find mod cloud builder, have replicated your patch in a vanilla PD editor
(Looks like you used some much more fancy dark themed editor, interesting what editor is it?)

And currently stuck with a plugin succesfully uploaded, but is has no inputs or outputs.

Is that what you ment here?

Am I supposed to mangle manifest ttl files to enable the midi ports?

I am using plugdata: https://plugdata.org/ - which can also run as a plugin, and has a built in toolchain with the Heavy compiler and a mode for warning when using incompatible objects.

And no this is not done on the manifest level, the plugin build needs to be configured for midi ports, which the Cloud Compiler currently cannot do.

Meanwhile seems like achieving deadzone threshold is possible with stock CV modules, while it looks a bit scary.

  1. We get input 0-127 CC mapped to 0-10v voltage with 5 in the middle.

  2. Two dividers handle ranges of 0-3.5v and 6.5-10v, leaving 1.5v on each side for a deadzone.
    Their “in range” output is fed to cardinal voltage2pitchbend conversion.

  3. When signal is within 3.5-6.5v dead zone range , it is out of range for dividers, and their output is 0.
    At this moment we do not want 0, we want to transmit 5v meaning middle.

This 5v is thrown in when dead zone is active, using a third divider handling 3.5-6.5 voltage range. It’s amplified output controls CV gate, which pours static 5v from a Control2CV module to Cardinal only when we are in a dead zone.

Seems to work fine, with a Skew limiter as a way to smoothen sudden jumps from 5v to 3.5 or 6.5.

2 Likes

Just in case if somebody would struggle with CC to Pitchbend conversion, or would like to try using Artinoise Re.corder with MOD as a synth:

1 Like

Hah, neat! Crazy patch but cool to see what is possible with stock plugins using some ingenuity :slight_smile:

I will look at making the patch better this week and maybe publishing a test build.

Ive tried to understand how to use heavy to build the plugin, and read all the posts, but ended up with just writing lv2 plugin in DPF to do the same cc2pitchbend conversion.

Also I was able to make pitchbend smoother by a bit more complex logic.
In initial Cardinal+CV setup it was 0:127 mapped to 0:16383, with deadzone area (64-deadzone):(64+deadzone) range values being hardly overrided to 8192, so when we were going outside of the dead zone there was a significant jump of the pitchbend.

Now it is
0:(64-deadzone) mapped to 0 : 8192 and
(64+deadzone):127 mapped to 8193:16383
in my plugin, so there is no jump now.

P.S.
Maybe I am missing something, but using PD patches in MOD seems like an undocumented bleeding edge currently, it need some guidelines I guess,to make it more accessible.

1 Like