DISTRHO / Cardinal

Virtual modular synthesizer plugin
https://cardinal.kx.studio/
GNU General Public License v3.0
2.07k stars 141 forks source link

MIDI-CV device doesn't recieve any clock data from DAW #25

Closed vcvrackideas closed 2 years ago

vcvrackideas commented 2 years ago

So CLK and CLK\N outputs don't produce any data if transport is in play mode. However CV-MIDI device works nicely in case if need send a sequence to any other synth in ableton (another track in routing menu), and that's very nice!

falkTX commented 2 years ago

Those are meant for MIDI clock messages, typically hosts do not send those.

There is in the plans to provide host-mapped transport information as CV sources, as done for the parameters module. I haven't done this part yet.

vcvrackideas commented 2 years ago

Thanks, looking forward for that! Also just saw on miRack page that he used Ableton link sync inside mirack for that purpose but I don't compelety sure what it means because I'm not mac os user - https://mirack.app/vst/

zezic commented 2 years ago

Just to note – official VST version has CLK and CLK/N producing the clock ticks as well as STRT, STOP and CONT producing triggers on corresponding DAW transport events.

falkTX commented 2 years ago

Huh interesting. I have not used the official plugin version, so was not aware of this. Seems weird to do such mapping IMO.

So how would this work, lets see it mapped to host controls...

So what is different from START and CONT exactly? Should START always trigger, or only if starting from zero position?

Also, not sure how long these pulses usually go for. Shouldn't be 1 sample as that would tied them to the device/host sample rate, so a few ms then. Is there a predefined value for these?

falkTX commented 2 years ago

On a related subject, I still think a dedicated host-transport module is useful. A "tick within beat" kinda signal that flows in saw-tooth like shape would be cool and not possible with MIDI like signals. And whatever else we can think of that simple MIDI transport can't do, specially if it involves looping (though DPF does not provide such APIs yet)

zezic commented 2 years ago

At its current state it works like this:

Triggers are currently that long: https://github.com/VCVRack/Rack/blob/v1/src/core/MIDI_CV.cpp#L238 Also, this is the place where you can look for all trigger conditions.

The general info about VCV trigger timing & voltage parameters: https://vcvrack.com/manual/VoltageStandards#Triggers-and-Gates

zezic commented 2 years ago

A "tick within beat" kinda signal that flows in saw-tooth like shape would be cool and not possible with MIDI like signals.

Yes, that could be useful. Something similar to general phasor concept. I've created some modules to work with phase-based clocks – https://library.vcvrack.com/ZZC, but they are not ported to v2 yet. Will port them soon. They are using a sawtooth signal in a range of [0.0, 10.0).

falkTX commented 2 years ago

So we have to deal with PPQN instead of BBT, thanks I hate it. :sweat_smile: An extra case for supporting new/alternative host-timeinfo module then, I want units that make sense and not PPQ stuff.

In any case, mimicking the official plugin version sounds good to me, more consistency and all.

falkTX commented 2 years ago

Implemented start, stop and continue. For the clock pulses I am simply not going to do it, the way MIDI-CV module is handling timing - basically triggering 0xF8 MIDI Clock Pulse signals - is something I consider legacy silliness. Even the MIDI association knows they are troublesome, and why MIDI 2 introduces extra timing information so those pulses can be made more accurate. Also, it would be a bit tricky to implement due to needing to mix/interleave host MIDI events with ones created by us based on host timing. Not to mention that converting host time to MIDI and then to CV is quite awkward to work with.

We have a dedicated panel for host-time information, so let's just use that instead.

In order to not lead into confusion I have made the CLK and CLK/N not visible on the MIDI-CV module.

image

Perhaps not the best approach, but for an initial release I think it is quite fine. And with this I close the ticket.