Compare commits
2 commits
89f8a74f34
...
8981111193
Author | SHA1 | Date | |
---|---|---|---|
8981111193 | |||
5525dfff4d |
6 changed files with 48 additions and 36 deletions
|
@ -1,8 +1,8 @@
|
|||
1. Execute the `prepare-image.sh [image]` script as `root` where `[image]` is the url to raspiOS.
|
||||
|
||||
2. Flash the `vcpi.img.xz` with for example Balena Etcher to a SD Card
|
||||
2. Flash the `vcpi.img` to SD card. You can use Rpi Imager to set additional settings like wifi.
|
||||
|
||||
3. Boot Rpi on DHCP enabled network. The boot script should run `setup.sh` on first boot.
|
||||
3. Boot Rpi on DHCP enabled network. The boot script should run `setup.sh` on first boot and reboot the system when its done.
|
||||
|
||||
4. Login using user: `pi` pass: `vcpi`
|
||||
|
||||
|
|
28
patch/init.pd
Normal file
28
patch/init.pd
Normal file
|
@ -0,0 +1,28 @@
|
|||
#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,20 +0,0 @@
|
|||
# Coded by Sam Aaron
|
||||
|
||||
load_samples(sample_names :ambi)
|
||||
sleep 2
|
||||
|
||||
with_fx :reverb, mix: 0.8 do
|
||||
live_loop :foo do
|
||||
# try changing the sp_ vars..
|
||||
sp_name = choose sample_names :ambi
|
||||
# sp_name = choose sample_names :drum
|
||||
sp_time = [1, 2].choose
|
||||
#sp_time = 0.5
|
||||
sp_rate = 1
|
||||
#sp_rate = 4
|
||||
|
||||
s = sample sp_name, cutoff: rrand(70, 130), rate: sp_rate * choose([0.5, 1]), pan: rrand(-1, 1), pan_slide: sp_time
|
||||
control s, pan: rrand(-1, 1)
|
||||
sleep sp_time
|
||||
end
|
||||
end
|
|
@ -46,7 +46,7 @@ ln -v -s /lib/systemd/system/payload.service /tmp/rpi-img/etc/systemd/system/gra
|
|||
|
||||
#provision project files
|
||||
cp -v ./src/setup.sh /tmp/rpi-img/root/setup.sh
|
||||
cp -v ./patch/init.rb /tmp/rpi-img/root/init.rb
|
||||
cp -v ./patch/init.pd /tmp/rpi-img/root/init.pd
|
||||
|
||||
echo "] press enter to write the image"
|
||||
read
|
||||
|
|
|
@ -6,8 +6,8 @@ Environment=DISPLAY=:0
|
|||
Environment=XAUTHORITY=/home/pi/.Xauthority
|
||||
User=pi
|
||||
Group=pi
|
||||
ExecStartPre=/bin/sleep 60
|
||||
ExecStart=/opt/sonic-pi/bin/sonic-pi
|
||||
ExecStartPre=/bin/sleep 30
|
||||
ExecStart/usr/bin/plugdata /home/pi/init.pd
|
||||
Restart=always
|
||||
RestartSec=10s
|
||||
KillMode=process
|
||||
|
|
26
src/setup.sh
26
src/setup.sh
|
@ -1,16 +1,18 @@
|
|||
#!/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
|
||||
apt-get update
|
||||
apt-get upgrade -y --autoremove
|
||||
apt-get upgrade -y
|
||||
|
||||
# setup apps
|
||||
apt-get install htop wget -y
|
||||
apt-get install htop wget curl -y
|
||||
|
||||
# setup sonic-pi
|
||||
wget https://sonic-pi.net/files/releases/v4.6.0/sonic-pi_4.6.0_1_bookworm.arm64.deb
|
||||
dpkg -i sonic-pi_4.6.0_1_bookworm.arm64.deb
|
||||
apt-get --fix-broken install -y
|
||||
# setup plugdata
|
||||
apt-get install plugdata
|
||||
|
||||
# setup udev
|
||||
echo "SUBSYSTEM==\"usb\", ENV{DEVTYPE}==\"usb_device\", MODE=\"0666\"" > /etc/udev/rules.d/50-udev-default.rules
|
||||
|
@ -21,14 +23,16 @@ ufw allow ssh
|
|||
ufw enable
|
||||
|
||||
# deploy patch
|
||||
mkdir -vp /home/pi/.sonic-pi/config/
|
||||
mv -v /root/init.rb /home/pi/.sonic-pi/config/init.rb
|
||||
chown -R pi:pi /home/pi/.sonic-pi
|
||||
chown -R pi:pi /home/pi/.sonic-pi/config
|
||||
mkdir -vp /home/pi/
|
||||
mv -v /root/init.pd /home/pi/init.pd
|
||||
chown pi:pi /home/pi/init.pd
|
||||
|
||||
# cleanup
|
||||
mv /root/setup.sh /root/setup.sh.done
|
||||
chmod -x /root/setup.sh.done
|
||||
|
||||
|
||||
echo "done :)"
|
||||
|
||||
# reboot and exit
|
||||
reboot
|
||||
exit 0
|
Loading…
Add table
Reference in a new issue