Difference between revisions of "MIDI Clock"

From TidalCycles userbase
Jump to: navigation, search
Line 7: Line 7:
 
</source>
 
</source>
  
Your MIDI device should then adjust it's BPM to Tidal's [[cps]]. Then it's worth sending a 'stop' message like this:
+
Your MIDI device should then adjust its BPM to Tidal's [[cps]]. Then it's worth sending a 'stop' message like this:
  
 
<source>
 
<source>
Line 13: Line 13:
 
</source>
 
</source>
  
and then a start message. The following sends a start message every fourth cycle:
+
and then finally a start message to start the MIDI clock at the right time. The following sends a start message every fourth cycle:
  
 
<source>
 
<source>
Line 25: Line 25:
 
</source>
 
</source>
  
However now if you do <source inline>hush</source>, the midiclock will stop as well as all the other patterns. Do avoid this, you can overwrite the <source inline>hush</source> function that silences particular patterns:
+
However now if you do <source inline>hush</source>, the midiclock will stop as well as all the other patterns. To avoid this, you can overwrite the <source inline>hush</source> function with a version that silences particular patterns:
  
 
<source>
 
<source>
Line 37: Line 37:
 
</source>
 
</source>
  
Make sure any offset on the MIDI side is also set to 0, then gradually adjust them until they align. If they stay in alignment when you change the cps, all is good!
+
Make sure any offset on the MIDI side is also set to 0, then gradually adjust one of them until they align. If they stay in alignment when you change the cps, all is good!

Revision as of 09:57, 21 December 2018

Once you've set up SuperDirt MIDI by following the tutorial, sending midiclock is fairly straightforward and works well, although still in development. This will become easier still in the future.

First, you can start sending MIDI clock messages, 48 per cycle, like this:

p "midiclock" $ midicmd "midiClock*48" # s "midi"

Your MIDI device should then adjust its BPM to Tidal's cps. Then it's worth sending a 'stop' message like this:

once $ midicmd "stop" # s "midi"

and then finally a start message to start the MIDI clock at the right time. The following sends a start message every fourth cycle:

p "midictl" $ midicmd "start/4" # s "midi"

Once everything's started and in sync, it's probably best to stop sending the start messages to avoid glitching:

p "midictl" $ silence

However now if you do hush, the midiclock will stop as well as all the other patterns. To avoid this, you can overwrite the hush function with a version that silences particular patterns:

let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16]

You will probably find that the downbeats for superdirt and your MIDI devices don't align. As a starting point, set MIDI latency in supercollider to 0:

~midiOut.latency = 0;

Make sure any offset on the MIDI side is also set to 0, then gradually adjust one of them until they align. If they stay in alignment when you change the cps, all is good!