hello there,
Up this topic as i just decide to dive into this feature.
Does sonic pi (version 3.3.1) can impose its tempo to an external soft ?
i’d like to set the tempo from sonicpi to Cantabile or to MPC Beats or to Ableton live
Any code is welcomed to reach this goal !!!
# logiciels nécessaires :
# sonic pi
# loopmidi
# Cantabile comme vst host
# vb-audio pour un retour de l'audio vers sonic pi afin d'enregistrer le retour audio des VSTs
# vsts :
midi_all_notes_off
use_bpm 120
use_midi_defaults port: "lp-01_3"
live_loop :clock do
midi_clock_beat
sleep 1
end
live_loop :vers_canal_01 do
##| stop
##| midi (scale :c4, :acem_asiran).tick,
midi (ring :c3).tick,
channel: 1, sustain: 0.5
sleep [0.5].tick('s')
end
live_loop :vers_canal_04 do
##| stop
midi (scale :c4, :bartok).pick, channel: 4, velocity: 65, sustain: 0.5
sleep [2].tick('s')
end
live_loop :drumdrums do
with_fx :reverb, mix: 0.6, room: 0.7 do
2.times do
sample :drum_bass_hard, lpf: 70
sleep 2
sample :drum_snare_hard, hpf: 75
sleep 2
end
sample :drum_bass_hard, lpf: 70
sleep 0.5
sample :drum_bass_hard, lpf: 70
sleep 1.5
sample :drum_snare_hard, hpf: 75
sleep 2
sample :drum_bass_hard, lpf: 70
sleep 2
sample :drum_snare_hard, hpf: 75
sleep 1
sample :drum_snare_hard, hpf: 75
sleep 1
end
end
live_loop :hithats do
sample :drum_snare_soft, hpf: 90, finish: 0.5, amp: [0.5, 0.75, 1, 0.5].tick, amp: 0.5
sleep 0.5
end
##| live_loop :audioFromCantabile do
##| live_audio :back, input: 1
##| sleep 8
##| end
stop
a = "D:/audio/mesSamples/drumbeats/acoustic_2_3.wav"
b = "D:/audio/mesSamples/drumbeats/breakbeats_2_1.wav"
s = (ring a, b)
a = s.to_a
s.length.times do
current = s.tick
sample current
sleep sample_duration(current)
end
sample a[1]
sleep sample_duration(a[1])
sample a[0]
stop
# Splat version thanks to Ethan :-)
# A shorty solution
# send chord via osc
use_osc "localhost", 4560
use_osc_logging false
use_debug false
use_bpm 240
live_loop :sendChordsNotesViaOSC do
use_real_time
notes = chord :c, :madd11
osc "/foo/notes", *notes
# just send a amp integer value
osc "/foo/notes/amp", [0.5, 1, 2, 4].tick
sleep 1
end
Of course this does not work with Cantabile. The tempo stays to 96 bpm.
Cheers