Difference between revisions of "MIDI Clock"

From TidalCycles userbase
Jump to: navigation, search
(Marked this version for translation)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
<languages/>
 +
<translate>
 +
<!--T:1-->
 
Once you've set up SuperDirt MIDI by following [[SuperDirt_MIDI_Tutorial|the tutorial]], sending midiclock is fairly straightforward and works well, although still in development. This will become easier still in the future.
 
Once you've set up SuperDirt MIDI by following [[SuperDirt_MIDI_Tutorial|the tutorial]], sending midiclock is fairly straightforward and works well, although still in development. This will become easier still in the future.
  
 +
<!--T:2-->
 
First, you can start sending MIDI clock messages, 48 per cycle, like this:
 
First, you can start sending MIDI clock messages, 48 per cycle, like this:
  
 +
<!--T:3-->
 
<source>
 
<source>
 
p "midiclock" $ midicmd "midiClock*48" # s "midi"
 
p "midiclock" $ midicmd "midiClock*48" # s "midi"
 
</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:
+
<!--T:4-->
 +
Your MIDI device should then adjust its BPM to Tidal's [[cps]]. Then it's worth sending a 'stop' message like this:
  
 +
<!--T:5-->
 
<source>
 
<source>
 
once $ midicmd "stop" # s "midi"  
 
once $ midicmd "stop" # s "midi"  
 
</source>
 
</source>
  
and then a start message. The following sends a start message every fourth cycle:
+
<!--T:6-->
 +
and then finally a start message to start the MIDI clock at the right time. The following sends a start message every fourth cycle:
  
 +
<!--T:7-->
 
<source>
 
<source>
 
p "midictl" $ midicmd "start/4" # s "midi"  
 
p "midictl" $ midicmd "start/4" # s "midi"  
 
</source>
 
</source>
  
 +
<!--T:8-->
 
Once everything's started and in sync, it's probably best to stop sending the start messages to avoid glitching:
 
Once everything's started and in sync, it's probably best to stop sending the start messages to avoid glitching:
  
 +
<!--T:9-->
 
<source>
 
<source>
 
p "midictl" $ silence
 
p "midictl" $ silence
 
</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:
+
<!--T:10-->
 +
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:
  
 +
<!--T:11-->
 
<source>
 
<source>
 
let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16]
 
let hush = mapM_ ($ silence) [d1,d2,d3,d4,d5,d6,d7,d8,d9,d10,d11,d12,d13,d14,d15,d16]
 
</source>
 
</source>
  
 +
<!--T:12-->
 
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:
 
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:
  
 +
<!--T:13-->
 
<source>
 
<source>
 
~midiOut.latency = 0;
 
~midiOut.latency = 0;
 
</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!
+
<!--T:14-->
 +
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!
 +
</translate>

Latest revision as of 12:27, 15 December 2019

Other languages:
English • ‎français

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!