test with supercolider

This commit is contained in:
deflax 2025-08-26 00:18:46 +00:00
parent 27b1279012
commit 3b6711067f
5 changed files with 51 additions and 50 deletions

View file

@ -1,28 +0,0 @@
#N canvas 619 34 526 667 12;
#X obj 113 129 osc~ 440;
#X obj 113 188 dac~;
#X obj 113 158 *~ 0.05;
#X text 152 13 MAKING A SINE WAVE;
#X text 42 226 Audio computation can be turned on and off by sending messages to the global "pd" object as follows:, f 56;
#X msg 108 277 \; pd dsp 1;
#X msg 212 277 \; pd dsp 0;
#X text 123 314 ON;
#X text 232 314 OFF;
#X text 39 353 You should see the Pd window change to reflect whether audio is on or off. You can also turn audio on and off using the "audio" menu \, but the buttons are provided as a shortcut.;
#X text 40 405 When DSP is on \, you should hear a tone whose pitch is A 440 and whose amplitude is 0.05. If instead you are greeted with silence \, you might want to read the HTML documentation on setting up audio.;
#X text 40 471 In general when you start a work session with Pd \, you will want to choose "test audio and MIDI" from the help window \, which opens a more comprehensive test patch than this one., f 60;
#X text 246 44 Audio computation in Pd is done using "tilde objects" such as the three below. They use continuous audio streams to intercommunicate \, as well as communicating with other ("control") Pd objects using messages.;
#X text 296 285 <= click these;
#X text 155 188 <=== send to the audio output device;
#X text 183 157 <= reduce amplitude to 0.05;
#X text 183 128 <= 440 Hz. sine wave at full blast;
#X obj 309 545 ../5.reference/set-dsp-tgl;
#X text 310 524 DSP on/off;
#X msg 309 582 \; pd dsp \$1;
#X text 291 635 updated for Pd version 0.54;
#X text 345 549 <-- open abstraction;
#X text 24 541 These examples also use a helper abstraction from the documentation help files of Pd. Check it to the right and see how the toggle shows the DSP state., f 35;
#X obj 42 45 abl_link~;
#X connect 0 0 2 0;
#X connect 2 0 1 0;
#X connect 17 0 19 0;

1
patch/autorun.scd Normal file
View file

@ -0,0 +1 @@
s.waitForBoot{ {SinOsc.ar([400, 404])}.play }

View file

@ -46,10 +46,7 @@ ln -v -s /lib/systemd/system/payload.service /tmp/rpi-img/etc/systemd/system/gra
#provision project files #provision project files
cp -v ./src/setup.sh /tmp/rpi-img/root/setup.sh cp -v ./src/setup.sh /tmp/rpi-img/root/setup.sh
cp -v ./patch/autorun.pd /tmp/rpi-img/root/autorun.pd cp -v ./patch/autorun.scd /tmp/rpi-img/root/autorun.scd
echo "] press enter to write the image"
read
sync sync
@ -60,4 +57,4 @@ umount /tmp/rpi-img
rmdir -v /tmp/rpi-img rmdir -v /tmp/rpi-img
#write image #write image
mv -v src.img vcpi.img mv -i src.img vcpi.img

View file

@ -4,10 +4,12 @@ Description=Autorun GUI payload
[Service] [Service]
Environment=DISPLAY=:0 Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority Environment=XAUTHORITY=/home/pi/.Xauthority
Environment=QT_QPA_PLATFORM=offscreen
Environment=JACK_NO_AUDIO_RESERVATION=1
User=pi User=pi
Group=pi Group=pi
ExecStartPre=/bin/sleep 30 ExecStartPre=/bin/sleep 10
ExecStart=/usr/bin/plugdata /home/pi/Documents/plugdata/autorun.pd ExecStart=/usr/local/bin/sclang /home/pi/autorun.scd
Restart=always Restart=always
RestartSec=10s RestartSec=10s
KillMode=process KillMode=process

View file

@ -1,22 +1,38 @@
#!/bin/bash #!/bin/bash
# set opensuse raspbian repo for plugdata
echo 'deb http://download.opensuse.org/repositories/home:/plugdata/Raspbian_12/ /' | tee /etc/apt/sources.list.d/home:plugdata.list
curl -fsSL https://download.opensuse.org/repositories/home:plugdata/Raspbian_12/Release.key | gpg --dearmor | tee /etc/apt/trusted.gpg.d/home_plugdata.gpg > /dev/null
# upgrade system # upgrade system
apt-get update apt-get update
apt-get upgrade -y apt-get upgrade -y
# setup apps # setup apps
apt-get install htop wget curl -y apt-get install htop \
curl \
cpufrequtils -y
# setup dev packages # setup packages
apt-get install puredata-dev libjack-jackd2-dev libwebkit2dgtk-4.0-dev libcurl4-openssl-dev libasound2-dev -y apt-get install \
build-essential \
cmake \
libjack-jackd2-dev \
libsndfile1-dev \
libfftw3-dev \
libxt-dev \
libavahi-client-dev \
libudev-dev \
libasound2-dev \
libreadline-dev \
libxkbcommon-dev \
jackd2 -y
# Accept realtime permissions for jackd when asked
# setup plugdata apt-get install \
#apt-get install plugdata qt6-base-dev \
# disabled until 0.9.2 qt6-svg-dev \
qt6-tools-dev \
qt6-wayland \
qt6-websockets-dev -y
apt-get install qt6-webengine-dev -y
# setup udev # setup udev
echo "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", MODE=\"0666\"" > /etc/udev/rules.d/50-udev-default.rules echo "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", MODE=\"0666\"" > /etc/udev/rules.d/50-udev-default.rules
@ -26,10 +42,24 @@ apt-get install ufw -y
ufw allow ssh ufw allow ssh
ufw enable ufw enable
#build supercolider
echo "building in:"
pwd
git clone --branch main --recurse-submodules https://github.com/supercollider/supercollider.git
cd supercollider
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSUPERNOVA=OFF -DSC_EL=OFF -DSC_VIM=ON -DNATIVE=ON ..
make -j3
make install
ldconfig
#setup jack
echo /usr/bin/jackd -P75 -p16 -dalsa -dhw:0 -p1024 -n3 > /home/pi/.jackdrc
# deploy patch # deploy patch
mkdir -vp /home/pi/Documents/plugdata/ mv -v /root/autorun.scd /home/pi/autorun.scd
mv -v /root/autorun.pd /home/pi/Documents/plugdata/autorun.pd chown pi:pi -R /home/pi/autorun.scd
chown pi:pi -R /home/pi/Documents/plugdata
# cleanup # cleanup
mv /root/setup.sh /root/setup.sh.done mv /root/setup.sh /root/setup.sh.done
@ -37,6 +67,5 @@ chmod -x /root/setup.sh.done
echo "done :)" echo "done :)"
# reboot and exit # reboot
reboot
exit 0 exit 0