Pass SuperCollider sound as microphone input for other apps on Linux

Setting method when you want to pass the output of SC as input of another application, such as when you want to pass the sound of SuperCollider (hereinafter SC) to the browser in a remote session Finally do this. qjackctl.png

This figure is a graph that can be displayed with qjackctl. The point is that the SC output is connected to the Pulse Audio JACK Source

PulseAudio is a Linux audio server, and most modern apps, such as browsers, use it to make sounds. Apps that require real-time performance, such as SC, use JACK / ALSA instead of PulseAudio.

With PulseAudio's jack module, you can handle PulseAudio input and output on jack. It is also convenient to include qjackctl (GUI for jack settings) and pavucontrol (GUI for pulseaudio settings). In case of arch linux, you can install various apps / modules with the following command

> sudo pacman -S pulseaudio-jack qjackctl pavucontrol

The important point is that PulseAudio must be stopped when you start jack. Stop with pulseaudio -k.

> pulseaudio --check -v
I: [pulseaudio] main.c: Daemon running as PID 2959
> pulseaudio -k
> pulseaudio --check -v
I: [pulseaudio] main.c: Daemon not running

After confirming that PulseAudio has stopped, set it according to the following procedure.

  1. Press the "Start" button of qjackctl to start jack

  2. Load the PulseAudio jack module

pactl load-module module-jack-sink channels=2 pactl load-module module-jack-source


 3. Start SuperCollider

 4. Launch the app that uses `PulseAudio` and put it in a state where you can use the microphone input.
 You can confirm that the app launched from the "Recording" tab of `pavucontrol` is connected to` Jack source`.
 ![pavucontrol.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/12251/10d6775a-3683-3f92-1a27-9bad05d997ca.png)

 5. Connect to `PulseAudio JACK Source` with qjackctl's Graph as shown in the first figure on this page.




Recommended Posts

Pass SuperCollider sound as microphone input for other apps on Linux
pykintone on Windows Subsystem for Linux