Which audio I/F?

Hi,
I’m close to get a raspberry pi 4, and to try out Sonic Pi, but I wonder which audio interface would be recommended ? My use would be to use Sonic Pi as on the fly effect for vocals, so I would need at least 1 input, and of course 1 output, at least 44.1 kHz 16 bit. What I found up to now :

  • Hifiberry : very compact but seems to be dedicated to audio streaming (small RCA connectors without any input)

  • Pi sound : very expensive and way too high performances for my application

I would like to find some small and reliable solution… :thinking: Any advice ?

Thanks :grinning_face:

I think it’s a good question. There are many inexpensive USB audio interface options that are guaranteed to work with Pi, but I would like to know whether more fully featured USB audio interfaces such as from Focusrite’s Scarlett range, would work well.

Many such devices offer excellent fidelity and can be found in the used market at affordable prices.

From my research, and in the absence of such interfaces being tested by Pi communicators (and I don’t understand why not), the key for such a USB device is that it is “class-compliant”.

1 Like

Hi, I have a basic Clarett2Pre+ from Focusrite - Sonic Pi finds it in the I/O automatically. Also picked up an old 2ndhand Thunderbolt one. It needed a new driver because of a change in Mac security.

Haven’t tried live input into Sonic Pi yet. Will have a go, next chance I get :slight_smile:

Edit: tried live_audio and Focusrite Clarett2Pre. It was fun!

I’ve read the tutorials and looked on here, but can’t find many examples. @robin.newman is your Frere Jacques still up somewhere? Would love to hear/see.

Is live_audio similar to live_loop, just inputting the live instrument? Does it need a sleep line or sync, or does it just stay constantly open? Sorry if these are basic Qs! Thanks.

1 Like

I think this may be what you are looking for Frere Jaques Records my violin and generates a four part round in Sonic Pi.
The program is shown here

live_audio is essentially just a switch which enables sound input as specified in the parameters. Once starterd it is active until a live_audio :stop command is issued with the same name parameter.
I use live_audio :violin,input: 2 to start it running, :violin is just the name I assign to the input stream, and input: 2 was the input channel I used (only recording mono here from the pickup. Input channels are numbered according to the number of input channels you have enabled. This depends on your audio input card.
Later I stop the input stream using live_audio :violin, :stop
The duration of the buffer is set by the time between these two commands
I use fx :record to specify where the input stream is recorded using three buffers named :v0,:v1,:v2 and :v3 to store the four seperate recordings.
At the beginning I played some tones (in my headphones) to hep me get the tempo and the point at which to start playinfg.

It doesn’t have to be a violin. You can record any instrument or even just sing into a mic. Let me know if you need more info to get going.

2 Likes

Wow - so helpful - thanks @robin.newman! I had no idea Sonic Pi can do this, couldn’t find much info. Also have never used buffers in this way before. I got some FX including ring_mod working on live input over SP backdrop last night, wasn’t sure how to end it. Look forward to having a go. @simon1618 hope this info is useful for you, too :slight_smile:

1 Like

Thanks for all these useful information and sorry for my late answer !

Finally I’ve choosen a hifiberry dac+adc soundcard and it works.

I am building my code (looper project) step by step and this way of indexing buffers at each iteration is a great hint thanks !

I hope to be able to share a descent code soon… :sweat_smile: