Compare commits

..

No commits in common. 'master' and 'main' have entirely different histories.
master ... main

3
.gitignore vendored

@ -1,6 +1,3 @@
*.mp3
*.wav
*.bak
*.webm
.*
!.gitignore

@ -0,0 +1,13 @@
[Unit]
Description=My Miscellaneous Service
After=network.target
[Service]
Type=simple
User=riviera
WorkingDirectory=/home/riviera/XPUB/trimester-1/week-12/OSC
ExecStart=/home/riviera/XPUB/trimester-1/week-12/OSC/pyosc.sh
Restart=always # or on-failure, on-abort, etc
[Install]
WantedBy=multi-user.target

@ -0,0 +1,2 @@
#!/bin/bash
python server.py

@ -0,0 +1,14 @@
[Unit]
Description=My Miscellaneous Service
Requires=pyosc.service
After=network.target
[Service]
Type=simple
User=riviera
WorkingDirectory=/home/riviera/XPUB/trimester-1/week-12/OSC
ExecStart=/home/riviera/XPUB/trimester-1/week-12/OSC/scmixer.sh
Restart=always # or on-failure, on-abort, etc
[Install]
WantedBy=multi-user.target

@ -1,3 +1,3 @@
#!/bin/bash
export QT_QPA_PLATFORM=offscreen
sclang -D /home/xpub/mixer.scd
sclang -D mixer.scd

@ -0,0 +1,2 @@
#!/bin/bash
sclang -D

@ -12,54 +12,54 @@ def send_message(channel, message):
client.send_message(channel, message)
def track_0():
cmd_0 = "cp \"$(tree -if /var/www/html/radio/random-radio-radio/webinterface/uploads | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/00.wav"
cmd_0 = "ffmpeg -y -i \"$(tree -if ./audio_0 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/00.wav"
proc_0 = subprocess.Popen(cmd_0,shell=True)
wav_0 = proc_0.communicate()[0]
def track_1():
cmd_1 = "cp \"$(tree -if /var/www/html/radio/random-radio-radio/webinterface/uploads | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/01.wav"
cmd_1 = "ffmpeg -y -i \"$(tree -if ./audio_0 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/01.wav"
proc_1 = subprocess.Popen(cmd_1,shell=True)
wav_1 = proc_1.communicate()[0]
def track_2():
cmd_2 = "cp \"$(tree -if /home/xpub/audio_1 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/02.wav"
cmd_2 = "ffmpeg -y -i \"$(tree -if ./audio_1 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/02.wav"
proc_2 = subprocess.Popen(cmd_2,shell=True)
wav_2 = proc_2.communicate()[0]
def track_3():
cmd_3 = "cp \"$(tree -if /home/xpub/audio_1 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/03.wav"
cmd_3 = "ffmpeg -y -i \"$(tree -if ./audio_1 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/03.wav"
proc_3 = subprocess.Popen(cmd_3,shell=True)
wav_3 = proc_3.communicate()[0]
def track_4():
cmd_4 = "cp \"$(tree -if /home/xpub/audio_2 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/04.wav"
cmd_4 = "ffmpeg -y -i \"$(tree -if ./audio_2 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/04.wav"
proc_4 = subprocess.Popen(cmd_4,shell=True)
wav_4 = proc_4.communicate()[0]
def track_5():
cmd_5 = "cp \"$(tree -if /home/xpub/audio_2 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/05.wav"
cmd_5 = "ffmpeg -y -i \"$(tree -if ./audio_2 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/05.wav"
proc_5 = subprocess.Popen(cmd_5,shell=True)
wav_5 = proc_5.communicate()[0]
def track_6():
cmd_6 = "cp \"$(tree -if /home/xpub/audio_3 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/06.wav"
cmd_6 = "ffmpeg -y -i \"$(tree -if ./audio_3 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/06.wav"
proc_6 = subprocess.Popen(cmd_6,shell=True)
wav_6 = proc_6.communicate()[0]
def track_7():
cmd_7 = "cp \"$(tree -if /home/xpub/audio_3 | grep -Eo '^(.*/)([^/]*)\.wav$' | shuf -n 1)\" /home/xpub/wav_files/07.wav"
cmd_7 = "ffmpeg -y -i \"$(tree -if ./audio_3 | grep -Eo '^(.*/)([^/]*)\.mp3$' | shuf -n 1)\" ./wav_files/07.wav"
proc_7 = subprocess.Popen(cmd_7,shell=True)
wav_7 = proc_7.communicate()[0]
def init(address: str, *args: List[Any]) -> None:
track_0()
send_message("/begin/00", "/home/xpub/wav_files/00.wav")
track_2()
send_message("/begin/02", "/home/xpub/wav_files/02.wav")
track_4()
send_message("/begin/04", "/home/xpub/wav_files/04.wav")
track_6()
send_message("/begin/06", "/home/xpub/wav_files/06.wav")
send_message("/begin/00", "./wav_files/00.wav")
send_message("/begin/02", "./wav_files/02.wav")
send_message("/begin/04", "./wav_files/04.wav")
send_message("/begin/06", "./wav_files/06.wav")
track_1()
track_3()
track_5()
@ -71,35 +71,38 @@ def set_done(address: str, *args: List[Any]) -> None:
print(f"done{doneno}: {value1}")
if doneno == "00":
send_message("/begin/01", "/home/xpub/wav_files/01.wav")
send_message("/begin/01", "./wav_files/01.wav")
track_0()
if doneno == "01":
send_message("/begin/00", "/home/xpub/wav_files/00.wav")
send_message("/begin/00", "./wav_files/00.wav")
track_1()
if doneno == "02":
send_message("/begin/03", "/home/xpub/wav_files/03.wav")
send_message("/begin/03", "./wav_files/03.wav")
track_2()
if doneno == "03":
send_message("/begin/02", "/home/xpub/wav_files/02.wav")
send_message("/begin/02", "./wav_files/02.wav")
track_3()
if doneno == "04":
send_message("/begin/05", "/home/xpub/wav_files/05.wav")
send_message("/begin/05", "./wav_files/05.wav")
track_4()
if doneno == "05":
send_message("/begin/04", "/home/xpub/wav_files/04.wav")
send_message("/begin/04", "./wav_files/04.wav")
track_5()
if doneno == "06":
send_message("/begin/07", "/home/xpub/wav_files/07.wav")
send_message("/begin/07", "./wav_files/07.wav")
track_6()
if doneno == "07":
send_message("/begin/06", "/home/xpub/wav_files/06.wav")
send_message("/begin/06", "./wav_files/06.wav")
track_7()
if __name__ == "__main__":

@ -1,2 +0,0 @@
#!/bin/bash
python /home/xpub/server.py

@ -1,14 +0,0 @@
[Unit]
Description=JACK
After=sound.target
[Service]
Type=simple
LimitRTPRIO=infinity
LimitMEMLOCK=infinity
User=xpub
Environment="JACK_NO_AUDIO_RESERVATION=1"
ExecStart=/usr/bin/jackd -R -dalsa -dhw:1
[Install]
WantedBy=multi-user.target

@ -1,16 +0,0 @@
[Unit]
Description=Start the Python OSC application
After=syslog.target network.target
[Service]
Type=simple
User=xpub
Group=xpub
WorkingDirectory=/home/xpub
ExecStart=/home/xpub/server.sh
Restart=always
[Install]
WantedBy=multi-user.target

@ -1,18 +0,0 @@
[Unit]
Description=Start the Supercollider Application
After=syslog.target network.target
Requires=jack.service oscserver.service
Conflicts=vlc.service
[Service]
Type=simple
User=xpub
Group=xpub
WorkingDirectory=/home/xpub
ExecStart=/home/xpub/scmixer.sh
Restart=always
[Install]
WantedBy=multi-user.target

@ -1,13 +0,0 @@
[Unit]
Description=VLC
After=sound.target
[Service]
Type=forking
User=xpub
Environment="DISPLAY=:0.0"
ExecStart=/home/xpub/vlcwrapper.sh
Restart=always
[Install]
WantedBy=multi-user.target

@ -1,9 +0,0 @@
[Unit]
Description=Run VLC every minute
[Timer]
OnCalendar=*-*-* *:*:00
Unit=vlc.service
[Install]
WantedBy=multi-user.target

@ -1,4 +0,0 @@
#!/bin/bash
# cvlc --alsa-audio-device jack https://streaming.domainepublic.net/radiopanik.mp3?94ba3374-26b9-4f04-91d2-293ebe24d5c0
cvlc --alsa-audio-device jack https://s2.radio.co/sde6c7b42e/listen
# --alsa-audio-device jack / hw:1
Loading…
Cancel
Save