stoermelder / vcvrack-packone

Modules for VCV Rack
GNU General Public License v3.0
175 stars 39 forks source link

SAIL #82

Closed tokkeherfst closed 4 years ago

tokkeherfst commented 4 years ago

Continuing this thread from vcv rack...

Wow Ben, SAIL is awesome! Just mapped modwheel CC output from one of my beatstep pro knobs and it works absolutely great ;-) The only downside I can see if the knob is already in a low CC value 'positition' going lower on a control that is set to a higher value doesn't work, but nevertheless they way you've implemented this works quite well!!!

You might just have saved me from a hardware eurorack addiction, because having a hardware knob to wiggle was my main reason for preferring hardware ;-)

Now I am just wondering how I might go about mapping a set of computer keyboard keys to a changable CV value so I can use my shuttlePRO as well for this. Or would you be able to add this into SAIL easily?

Another improvement that comes to mind is support for relative midi CC, which would be a way to fix the position issue. There are 3 relative modes supported on my Beatstep Pro endless encoders; I suspect other endless knob controllers implement something similar as well:

Absolute: turning the knobs sends everything from 0 to 127 relative #1: clockwise sends 51%, counter-clockwise sends 50% relative #2: clockwise sends 0%, counter-clockwise sends 100% (I don't know why it's in reverse) relative #3: clockwise sends 12%, counter-clockwise sends 13%

I can dump you the actual midi values if you would need them.

Tom.

stoermelder commented 4 years ago

Mapping keyboard keys is a problem as modules receive only keyboard events when currently in focus. The only way right now is using the keyboard MIDI driver in one of the MIDI modules.

I don't own a Beatstep Pro so it would be a bit hard to test these relative modes. There had been several request about this in the last months, so I will see what I can do.

stoermelder commented 4 years ago

https://github.com/VCVRack/Rack/issues/1677

tokkeherfst commented 4 years ago

Thanks, I will have look what I can get out of the keyboard midi driver. Being able to use the shuttle wheel would be cool, but the BSP knob control addresses most of my tactile gripe already ;-)

I'd be happy to run any tests for you on those relative CC modes. It comes down to statically mapping specific static midi cc values to a 'mouse value increase/decrease', instead of mapping the diff in CC values to a CV value. Should actually be simpler than what you've implemented in SAIL currently ;-)

Tom.

stoermelder commented 4 years ago

I'm trying to avoid any MIDI code within this module. I have a Maschine Jam here and the faders support two relative modes but none of them seem to work like you described. Some sort of dump of the MIDI data or CV out of MIDI-CC would be helpful indeed.

tokkeherfst commented 4 years ago

Ok, did some measurements on the MIDI-CC mode (using scope and CC number 75 on the beatstep pro)

ABSOLUTE: MIDI CC values: 00-0F / Voltage: 0-10V

RELATIVE1: Single Increase -> MIDI CC values: sequence of 40 and 41 / Voltage change to 5,12V Single Decrease-> MIDI CC values: sequence of 40 and 3F / Voltage change to 4,96V

However when turning the lightly knob in the same direction I don't really see MIDI-CC sending the value equivalent to CC value 40 (5,04V).

I do see a difference in voltage when turning the knob a bit faster: Multiple increase: MIDI CC repeated sequence of 40 and values up to 4E / Voltage peaks briefly to around 5,9V (all depending on how fast I turn) Multiple decrease: MIDI CC repeated sequence of 40 and as low as 3A / Voltage drops briefly to around 4,83V

Strangely the faster I turn the higher/lower the voltage goes...

I guess if you want to implement this you would need some hysteresis in your algorithm:

Ofcourse a light twist in the same direction won't be detected that way...

Also, this is only for relative mode 1. I can take the same measurements for the other two relative modes, should I?

image

image

vcvrackideas commented 4 years ago

So cool device, a gamechanger at least. But takeover mode is not always ok. Sometimes I always have to turning up (fully CW) to turn down some knob and vice versa with CCW position...It would be awesome if you can make some mode with no takeover mode to allows parameters jumps exactly in the knob position of end. I suppose that it would be remove some "slew" in midi behavior that you have been achieved but would pretty helpful for faster work indeed.

tokkeherfst commented 4 years ago

@vcvrackideas yeah that is the problem with using Absolute CC mode If (a) relative CC mode could be supported (doesn't look to be a standard though) then that could be a solution for this issue you are seeing ....

stoermelder commented 4 years ago

It would be awesome if you can make some mode with no takeover mode to allows parameters jumps exactly in the knob position of end.

This will be no problem but I’m not quite sure when to apply the value. Should it be on the first change while hovering a parameter?

vcvrackideas commented 4 years ago

It would be awesome if you can make some mode with no takeover mode to allows parameters jumps exactly in the knob position of end.

This will be no problem but I’m not quite sure when to apply the value. Should it be on the first change while hovering a parameter?

don't know yet exactly but I think we should start trying from this one

stoermelder commented 4 years ago

Ok, I had to rewrite the module from scratch:

stoermelder commented 4 years ago

Ok, did some measurements on the MIDI-CC mode (using scope and CC number 75 on the beatstep pro)

Thanks! I've read somewhere that CC data 63 (decimal) is the "center", +/-1 means slow knob movements, +/-2 faster, +/-3 really fast. I will try to implement it but I will be dependent on your testing as none of my controllers seem to support this protocol.

vcvrackideas commented 4 years ago

Ok, I had to rewrite the module from scratch:

  • Parameter changes were not very smoothly before, now they are, I also added a Smoothing-option (not needed for MIDI-CC, but anyway...)
  • Holding the SHIFT-key will increase the precision by factor 10 (same as MOD-port)
  • Added Absolute-mode, needs some testing if it is useful this way.

oh wow, thanks! that becomes more interestingly. So here are my results -

tokkeherfst commented 4 years ago

Separate Coarse/fine inputs are an excellent idea! Would rather like that too rather than the Mod input.

Both modes work fine for me with beatstep pro set to absolute mode. I find the naming a bit confusing: I suspect they mean this:

This confused me at first, as I though "relative" was meant for "Relative1" CC mode on the controller but it doesn't appear to be.

So why not rename these

I suspect you will get requests for other relative CC modes once this module starts getting popular, so some kind of "RelativeX" is probably the wisest choice.

I recently discovered the "specific value" module from Alikins, so I remeasured the voltages coming out of MIDI-CC for Relative1 CC mode on the Beatstep Pro;

There should be two thresholds in your algorithm (hysteresis):

So when the voltage drops back to the middle, the controlled value doesn't drop back...

Tom

stoermelder commented 4 years ago

Ok, I had to rewrite the module from scratch:

  • Parameter changes were not very smoothly before, now they are, I also added a Smoothing-option (not needed for MIDI-CC, but anyway...)
  • Holding the SHIFT-key will increase the precision by factor 10 (same as MOD-port)
  • Added Absolute-mode, needs some testing if it is useful this way.

oh wow, thanks! that becomes more interestingly. So here are my results -

  • smoothing has no affect on absolute mode (CV curve has same SLEW pass with on or off setting) and it's quite ok but if you can add an option or slider with ability to set slew amount from perhaps 0.2 s to 5s (slow ones good for live performances) or this value could control by CV too...
  • however absolute mode has pretty expected behavior that I wanted from NO takeover mode and endless encoder. In very ideal situation it would be cool to get info to controller about knob position, read midi-feedback, it would be absolutest amazing thing in the world but you said above that you don't want to add any midi code to it and I don't even sure about possibility of getting absolute knob position from hovering the mouse.
  • so while thinking forward I got myself thinking on having two knobs of controlling - one for absolute (let's call it ROUGH tune) and another for relative (let's call it FINE tune). And yeah the initial idea for getting relative only CV from controller is a pretty amazing thing for fine tune any knob if needed - no jumps, lags or unneeded manipulations. So I've tried to add two sails in the patch, one in absolute and another in relative and connected two different knobs and it worked but there was some lags in absolute side but still quite ok.

"Smoothing" is meant for more steppy CV sources but it has no effect on CV out of MIDI-CC because this module outputs smooth values already. I can add a slew control with CV if this might be interesting.

stoermelder commented 4 years ago

Separate Coarse/fine inputs are an excellent idea! Would rather like that too rather than the Mod input.

You can add two instances of the module, one with MOD-port set to a constant high value. This way you can use one knob for coarse and one knob for fine.

Edit: There is bug in the latest build. It needs voltage >1V on MOD but I intended >=1V. Will be fixed.

Edit2: The idea of MOD was to use a button on your controller for enabling fine control but use the same knob.

vcvrackideas commented 4 years ago

"Smoothing" is meant for more steppy CV sources but it has no effect on CV out of MIDI-CC because this module outputs smooth values already. I can add a slew control with CV if this might be interesting.

Yes, I'm very interesting in it. Thanks. And thanks for clarifying on how input MOD should be using. A button on the controller really makes sense.

stoermelder commented 4 years ago

I've added exponential slew limiting a few seconds ago. I think an exponential curve is more useful than linear but nothing is decided yet. Let me know what you think.

I'm a bit undecided about relative mode on the Beatstep Pro. I like to support it but a module needs to inspect the incoming MIDI messages to handle it correctly, CV from MIDI-CC is not enough. On the other side it might be a better idea to put MIDI related stuff in a seperate module so someone can use these special MIDI protocols for some other purpose.

stoermelder commented 4 years ago

On MIDI-feedback: I can easily add an output port which sends the current value of the hovered parameter. Then you can patch it to CV-CC and send it to the same CC as receiving...

tokkeherfst commented 4 years ago

Yeah, based on CV from MIDI-CC alone it is not going to be optimal... you'd have to turn pretty hard to get below that lower voltage threshold or above the upper one. That would make it very unresponsive.

Maybe a midi-based module that outputs an positive voltage gate when an 'increase' relative CC sequence is received and negative voltage for the 'decrease' relative CC sequence. When nothing is received it would have to output a zero voltage.

Sail would then have to have some kind of trigger input that will react to these positive and negative voltages though.

Tom.

vcvrackideas commented 4 years ago

On MIDI-feedback: I can easily add an output port which sends the current value of the hovered parameter. Then you can patch it to CV-CC and send it to the same CC as receiving...

Amazing Idea! looking forward to it because touchOSC-like controllers are really needed feedback for smoothing performance.

stoermelder commented 4 years ago

Amazing Idea! looking forward to it because touchOSC-like controllers are really needed feedback for smoothing performance.

Done.

stoermelder commented 4 years ago

Mapping keyboard keys is a problem as modules receive only keyboard events when currently in focus. The only way right now is using the keyboard MIDI driver in one of the MIDI modules.

I‘m thinking about a new utility module which would be useful for working with keyboard events and some potential Beatstep relative protocol implementation.

It has three input ports. INC and DEC for increment and decrement. There is also a RESET port. And parameter for the stepsize. Everytime a trigger is received on INC or DEC the output voltage is increased or decreased by the stepsize, within the range 0-10V.

I am not aware of a similar module that could do that?

tokkeherfst commented 4 years ago

Tried to use the OUT port to feedback the controlled value to the Beatstep Pro but it looks that is not supported by Arturia. Would have been a nice solution as well to the relative knob issue.

But the Mod/Fine control works great when assigned to a toggle button CC!

About your new utility module idea, nice idea but we will have the same issue there. Eventually you will hit the 10V ceiling or 0V floor if the controlled hover-over value is not synced to this CV value...

Tom.

vcvrackideas commented 4 years ago

Amazing Idea! looking forward to it because touchOSC-like controllers are really needed feedback for smoothing performance.

Done.

Wow yeah. Overall - this is working solution already. But I've noticed some strange lags:

Otherwise it brings so much fun to control VCV Rack like that, thank you Ben!)

stoermelder commented 4 years ago

About your new utility module idea, nice idea but we will have the same issue there. Eventually you will hit the 10V ceiling or 0V floor if the controlled hover-over value is not synced to this CV value...

Yes, you’re right. But... I can use the OUT-port of SAIL to reset it to the parameter‘s current value. This way hitting the ceiling or bottom would be the end of the parameter‘s range anyway.

stoermelder commented 4 years ago

Amazing Idea! looking forward to it because touchOSC-like controllers are really needed feedback for smoothing performance.

Done.

Wow yeah. Overall - this is working solution already. But I've noticed some strange lags:

  • look at this gif please. you will notice that sometimes scope is showing us strange behavior that looks like as AD envelopes (or inverted ones sometimes). This react visually as a knob or fader in this case runs faster up or down and after approx. 0.3 sec it fit in that knob position and behaves as expected. sail bug

Are you sure SLEW is set to zero? Could be the same issue as your last bullet point...

  • Feedback from MIDI-CC to CV-CC looks a little bit glitchy on touchosc. I think there is some 30ms lag between midi in or out when same knob sends and receives CC messages simultaneously. But it still works and has good cv curves. I think there is no solution until midi-jitter free Rack v2..

I’m processing only every 64th sample which is about Avery 1,5ms at 44100Hz, MIDI is much slower anyway. But I can reduce the delay to every 32th sample but I’m not sure if this solves anything.

  • when I'm changing hover of mouse too fast (faster than 1 second or 2 for example) previous value can be copied to the next one. But no trouble when I'm waiting a bit.

Hm, this is most probably a bug. I’ll check.

vcvrackideas commented 4 years ago

Are you sure SLEW is set to zero? Could be the same issue as your last bullet point...

Yep checked twice. Settings are - mode absolute, smoothing off (on doesn't change anything), and slew 0 sec. This looks like a small ricochet, I think it depends on where the knob is. But quite strange just because it's and endless encoder with proper (maybe, don't know yet about lag or so) midi feedback. About delay - yes, maybe it will work, should try.

vcvrackideas commented 4 years ago

EDIT: when slew is up that odd ricochet is still present in absolute mode. maybe it's just too fast for midi to place the encoder in the right position and then it need a few milliseconds to figure it out? EDIT: and fine knob doesn't react in absolute mode at all but works ok in relative

stoermelder commented 4 years ago

EDIT: when slew is up that odd ricochet is still present in absolute mode. maybe it's just too fast for midi to place the encoder in the right position and then it need a few milliseconds to figure it out?

I've just made a new commit. Hopefully it is gone though I couldn't reproduce it yet.

EDIT: and fine knob doesn't react in absolute mode at all but works ok in relative

Yes, in absolute mode FINE does nothing. Feels strange to me as it should be absolute.

vcvrackideas commented 4 years ago

I've just made a new commit. Hopefully it is gone though I couldn't reproduce it yet.

thanks. but nope kinda bug is still here. it can be touchosc thing I should check it on my BCR2000 later at home. I think this is something about not proper midi feedback CV-CC can't get that to touchosc just because this kind of jumping looks similar when regular controller knob assign to the different parameter but I don't sure.

vcvrackideas commented 4 years ago

still can't figure out how to control buttons in vcv rack with SAIL. I've created PUSH button in touchosc but it only press the button and don't want to release the parameter to zero so works as a toggle one. As far as I remember there was no problem with MIDI-cat to do same thing

stoermelder commented 4 years ago

I've just made a new commit. Hopefully it is gone though I couldn't reproduce it yet.

thanks. but nope kinda bug is still here. it can be touchosc thing I should check it on my BCR2000 later at home. I think this is something about not proper midi feedback CV-CC can't get that to touchosc just because this kind of jumping looks similar when regular controller knob assign to the different parameter but I don't sure.

Can you try to disable "Smoothing" in the context menu?

vcvrackideas commented 4 years ago

I've just made a new commit. Hopefully it is gone though I couldn't reproduce it yet.

thanks. but nope kinda bug is still here. it can be touchosc thing I should check it on my BCR2000 later at home. I think this is something about not proper midi feedback CV-CC can't get that to touchosc just because this kind of jumping looks similar when regular controller knob assign to the different parameter but I don't sure.

Can you try to disable "Smoothing" in the context menu?

yep but it's still the same. I think there is something in MIDI-CC module. I monitor its output instead of SAIL's one and it's showing me same jumps but they look slewed at attack instead AD "sharp style" in SAIL

vcvrackideas commented 4 years ago

SOLVED ALL TROUBLES with all of these jumps and strange behavior 2020-01-06_18-13-19 EDIT: out option is continuous EDIT2: in that way there is no issue only when SLEW is zero. if more than zero = big jumps to the different side of rotating knob\fader

stoermelder commented 4 years ago

Ah, I see. Then the cause might be the value smoothing built into the MIDI-CC module :-(

stoermelder commented 4 years ago

EDIT2: in that way there is no issue only when SLEW is zero. if more than zero = big jumps to the different side of rotating knob\fader

I'm not so sure about the OUT-port anymore :-( You can try Reduced-mode for OUT. It is a really bad name but it outputs only changes of the parameter which are not done by the module itself. Especially any slew going on won't be sent to OUT.

vcvrackideas commented 4 years ago

EDIT2: in that way there is no issue only when SLEW is zero. if more than zero = big jumps to the different side of rotating knob\fader

I'm not so sure about the OUT-port anymore :-( You can try Reduced-mode for OUT. It is a really bad name but it outputs only changes of the parameter which are not done by the module itself. Especially any slew going on won't be sent to OUT.

tokkeherfst commented 4 years ago

Did some tests with the INC/DEC inputs in order get some kind of keyboard mapping (and from that ShuttlePro) working:

I do get a reaction from sail, but this setup only allows me to decrease the value only once. It seems MIDI-CC keeps sending the last note CV and comparator only sends a Trig when crossing the threshold... any ideas ?

image

Tom.

stoermelder commented 4 years ago

I do get a reaction from sail, but this setup only allows me to decrease the value only once. It seems MIDI-CC keeps sending the last note CV and comparator only sends a Trig when crossing the threshold... any ideas ?

Did you try MIDI-GATE instead? In my test this module patched to INC/DEC worked fine.

vcvrackideas commented 4 years ago

On dec\inc mode I've only got OK result with these connections (SAIL works only in absolute mode but again with ricochet I've mentioned on absolute mode before) and only works with Pile just because sail dec\inc doesn't want to work at all, odd. 2020-01-07_10-21-20

vcvrackideas commented 4 years ago

I do get a reaction from sail, but this setup only allows me to decrease the value only once. It seems MIDI-CC keeps sending the last note CV and comparator only sends a Trig when crossing the threshold... any ideas ?

Did you try MIDI-GATE instead? In my test this module patched to INC/DEC worked fine.

Same behavior described in my post above

tokkeherfst commented 4 years ago

Ahh, didn't even knew that MIDI-GATE module existed! Setup below works great, also with my Shuttle Pro! Next to try is to map some extra keys/notes for Fine control ;-) Shift Pedal may also be a good way to do this!

image

vcvrackideas commented 4 years ago

Ahh, didn't even knew that MIDI-GATE module existed! Setup below works great, also with my Shuttle Pro! Next to try is to map some extra keys/notes for Fine control ;-) Shift Pedal may also be a good way to do this!

image

HM when I connected directly into the sail I get missed steps sometimes but it's all ok when through the Pile ...

vcvrackideas commented 4 years ago

Just downloaded latest build - same behavior and needed to set Pile to 0-10v range to work all knobs correctly in inc\dec mode EDIT: but it's ok now in relative mode of sail

You don't need Pile for this IMHO as you can connect directly to Sail inc/dec

As I said before somehow I've got missed steps with direct connection to Sail(

tokkeherfst commented 4 years ago

You don't need Pile for this IMHO as you can connect directly to Sail inc/dec

stoermelder commented 4 years ago

As I said before somehow I've got missed steps with direct connection to Sail(

Unfortunately I can't reproduce this behaviour... also, it seems to work for Tom. Can you test it without anything patched to the IN-port?

stoermelder commented 4 years ago
  • Still can't figure out how operate with momentary buttons in VCV Rack...I understand that it's quite ok to use mouse click) But the brain has a bit of trouble to switching these operations.

I have to look into that if I can anything do about it. The problem is that the API allows setting the value 0.5 for a button which should only have 0 or 1.

tokkeherfst commented 4 years ago

image

Testing with FINE linked to SHIFT in combination with INC/DEC from MIDI-GATE, seems to somewhat work: value moves fine-grained when SHIFT is pressed but only for a limited range. I suspect this has something to do with the way the internal voltage of SAIL gets adapted by FINE?

Tom

stoermelder commented 4 years ago

I suspect this has something to do with the way the internal voltage of SAIL gets adapted by FINE?

Yes, you are right. There is most probably a problem with my calculations.

vcvrackideas commented 4 years ago

As I said before somehow I've got missed steps with direct connection to Sail(

Unfortunately I can't reproduce this behaviour... also, it seems to work for Tom. Can you test it without anything patched to the IN-port?

Same but noticed FUN thing - some modules (tested on faders of mindmeld and befaco slew, same behavior) needs a more voltage to switch the step than inc dec mode of sail can offers to it. Pretty strange. And that's why Pile into IN of Sail works - it's just ignore this limitation, don't know why.