tidalcycles / tidal-midi

This package and method of using MIDI in Tidal is obsolete. Please use SuperDirt MIDI instead.
GNU General Public License v3.0
74 stars 36 forks source link

how to deal with latency issues #32

Open lennart opened 7 years ago

lennart commented 7 years ago

I think tidalcycles/Tidal#133 should be resolved before working on the latency issues in tidal-midi.

For future users we should therefore make sure that:

see #14 and #22 for background.

lennart commented 7 years ago

quick fix might be to get rid of the really old default of latency = 0.01 for all Volca Controllers which seems frequently used.

background: these defaults were originally used to set the latency for alsa in the first implementation of tidal-midi.

originally the keyproxy (which became midiproxy) used this latency to delay sending out midi events, however this was added to the latency already existing in the proxy connection to tidal via OSC.

with tidal 0.7 and tidal midi being implemented with portmidi, we have no more proxying for MIDI but a generic tidal stream interface (decoupled from OSC).

now latency in ControllerShape becomes latency in tidal's Shape when you use a stream made from midiStream.

So if I remember correctly, the original alsa implementation used a shape latency of 0.04 (like dirt/superdirt still do) and added another 10ms on top for the proxy, if we want to restore the original latency this would now be 0.5.

However since 0.8/0.9 added multichannel (which adds load) it might still be best to increase default latency to 100ms (as said above latency = 0.1).

lennart commented 7 years ago

@telephon I read you updated superdirt to default to latency = 0.2, is this something we should consolidate as well across tidal/tidal-midi? e.g. let tidal-midi 0.9.1 switch to 0.2 as well?

telephon commented 7 years ago

yes we should definitely consolidate this, in particular because you may want to use midi and osc in combination.

It would be optimal if one could set that value at runtime.

diegodorado commented 7 years ago

+1 for setting that value at runtime.