Trying to do a reverse delay fx for live performance

Hello again! So I’ve been really digging sonic pi and want to use it in all my music lately :slight_smile:

So I have been trying to cover this live version of Radiohead’s Bloom. I figured out the notes this evening and I was thinking of recreating the effect used in the video. On the video the vocalist sings over a loop recorded live with some soft of reverse delay effect.

My original plan was to use ableton live on my laptop hooked up to a microphone to record the piano loop and use two looper effects to accomplish a similar effect. One playing the loop and the other playing the same loop in reverse. But albeton live is no fun, so I’ve been trying to make it work on Sonic Pi!

So far I have a very rudimentary prototype as a proof of concept:

use_bpm 60

with_fx :record, buffer:["piano",4] do
  live_audio :mic, input: 1, amp: 2
end

sleep 8

  live_loop :reverseDelay do
    sample buffer[:piano,4], rate: -1
    sample buffer[:piano,4], rate: 1
    sleep 4
  end

On my prototype code I record a 4 second loop onto a buffer called piano and then wait 8 seconds and play the loop backwards and forwards on the reverseDelay live loop.

But I have a question about midi controllers :thinking:

How can I go about setting up a midi controller with pads to trigger sonic pi to “record” a loop and another pad to play back the recorded loop with the reverse delay effect like on my sketch?

I got a midi controller with pads from my piano teacher as a gift. the controller has 16 pads that send MIDI notes and a few knobs + you can connect a keyboard and two sustain pedals to it. My plan is to set it up so I can assign one pad to record one loop and another one to playback the loop. Since My controller has multiple pads I could record and run multiple loops at once.

Haven’t really figured out how would I can accomplish this, hoping to get some ideas or maybe my design is not possible with sonic pi. Anyways, thanks in advance!

Hi there
Had a brief play with this, and used two of the transport keys on my midi keyboard, one controlling midi control 20, then other midi control 24. Using these I was able to trigger 8 seconds of recording (from the default input), and separately 8 seconds of playback from the recorded buffer (forwards and reverse together).
Hopefully this will give an idea of how you might proceed.

Of course adjust your midi port name to suit what you are using.

use_midi_defaults port: "usb_oxygen_8_v2",channel: 1

use_bpm 60

define :record do
  with_fx :record, buffer:["piano",8] do
    live_audio :mic, input: 1,amp: 2
    sleep 8
    live_audio :mic,:stop
  end
end
define :playback do
  sample buffer[:piano,8],rate: -1
  sample buffer[:piano,8],rate: 1
  sleep 8
  
end

live_loop :min do
  use_real_time
  m = sync "/midi:usb_oxygen_8_v2:1:1/control_change"
  if m[0]==20 
    puts "record"
    record
    
  elsif
    m[0]==24
    puts "playback"
    playback
  end
end

activate in my case midi_cc 20 to start recording, activate midi_cc 24 to playback

A little typo in playback but as usual a very good answer !

Oops thanks for letting me know. Corrected in the post now.

1 Like