tur/tidal

stdlib/tidal.tur
defn

scale-pat

(scale-pat [scale & [tonic 60])

build a cycling MIDI note pattern from a scale and tonic.

scalelist of semitone offsets from the tonic
tonicbase MIDI note number (default: 60 = middle C)
NumPattern cycling through the MIDI notes of the scale.

  (scale-pat MAJOR_SCALE 60)
defn

play

(play [session def-name pattern-string bpm])

parse a mini-notation string and start a synth player.

sessionscscm session
def-nameSynthDef name
pattern-stringmini-notation pattern string
bpmtempo in beats per minute
PatternPlayer (already started).

  (play session "default" "bd sd bd sd" 120)
defn

hush

(hush [session])

stop all patterns in a session.

sessionLiveSession or scscm session
defn

drum-machine

(drum-machine [kick-pattern snare-pattern hat-pattern])

combine kick, snare, and hi-hat patterns into a stacked drum part.

kick-patternPattern for kick drum
snare-patternPattern for snare drum
hat-patternPattern for hi-hat
Pattern<vec<map>> stacking all three drum voices.

  (drum-machine DRUM_KICK DRUM_SNARE DRUM_HAT)
defn

bass-line

(bass-line [notes & [duration (pattern/const 0.25) velocity (pattern/const 100)])

create a bass line note pattern.

notesPattern for MIDI note pitches
durationPattern for note durations in beats (default: 0.25)
velocityPattern for velocities (default: 100)

Pattern<map> suitable for a bass synth.

defn

lead

(lead [notes & [duration (pattern/const 0.5) velocity (pattern/const 90)])

create a lead melody note pattern.

notesPattern for MIDI note pitches
durationPattern for note durations in beats (default: 0.5)
velocityPattern for velocities (default: 90)

Pattern<map> suitable for a lead synth.

defn

pad

(pad [chords & [duration (pattern/const 1.0) velocity (pattern/const 70)])

create a pad chord pattern.

chordsPattern<vec<int>> for chord voicings (MIDI notes)
durationPattern for chord durations (default: 1.0)
velocityPattern for velocities (default: 70)

Pattern<vec<map>> suitable for a pad synth.