Auto link |0| to |9| to supercollider out

Hi there,

I’m looking at the source code, but don’t know what entry point to take. What I want to do is make the |tabs| right clickable and “set link” to SuperCollider out. If that makes sense? I have 16 outputs in SuperCollider and I would like to do the fades with my midi keyboard and record from different tabs into Ardour.

Which code do I need to change, in stable?

Welcome @SonicTheHedgeHog !

It’s perhaps worth clarifying first whether you are aware of Sonic Pi’s existing handling of multi-channel output. Have you seen Tutorial Chapter 13.3 - Sound Out?

The :sound_out and :sound_out_stereo FX allow you to pipe sound to specific outputs of the active soundcard. This means any code segments wrapped with these FX can have their sounds routed to the soundcard’s outputs as desired.

It’s worth mentioning the :record FX also if you aren’t already aware of it - this allows recording to a sample that you initialise in your code either before or when the FX starts. This could be used to record different samples to use later in Ardour. (Unless you’re imagining a different workflow of course).

If you have already read about these, ok! - in which case I assume you might be after your particular idea of assigning the combined sounds of a Sonic Pi buffer to a specific output as more of a convenience over the existing functions.

There’d be a bunch of work involved, for sure.
As a brief starter, the buffer tab buttons are created here:

Maybe it would involve providing some mechanism in the GUI (somewhere in mainwindow.cpp) for choosing the particular buffer->soundcard output assignment, and displaying the choice.
Then invisibly wrapping a buffer’s contents in one of these :sound_out* FX behind the scenes, just before it is sent to scsynth - several examples of adding ‘invisible code’ can be seen starting from here:

There would probably need to be thought about how this might interact with any ‘normal’ use of the existing :sound_out* FX in a buffer too…

If you decide to go ahead with attempting this feature, would you be intending to share it back to the official repo? (It’s worth having a much more detailed discussion beforehand if that’s the case)

1 Like

Thx for your expedient reply.

Hmm you make me doubt if I’ve had :sound_out, I believe I was messing with :output but it wouldn’t work. If it works good like that I could as well create a template where the main thread of each tab is exported to :sound_out. If that fails I’ll try to make a right-click and share it with the community.

It’ll be some getting used to, c++ has been a while… I was on a rust Roll :stuck_out_tongue:. But I’m always up for a challenge…

I’ve just been messing around with sonic-pi today and I was a bit drunk… What is the relation between supercollider (it was a dependency and sound goes out through supercollider…). Does it use scsynth under the hood?

Does it use scsynth under the hood?

Yes :slightly_smiling_face: