-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathradiopyo_template.py
59 lines (47 loc) · 2 KB
/
radiopyo_template.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/usr/bin/env python
# encoding: utf-8
"""
Template for a RadioPyo song (version 1.0).
A RadioPyo song is a musical python script using the python-pyo
module to create the audio processing chain. You can connect to
the radio here : http://radiopyo.acaia.ca/
There is only a few rules:
1 - It must be a one-page script.
2 - No soundfile, only synthesis.
3 - The script must be finite in time, with fade-in and fade-out
to avoid clicks between pieces. Use the DURATION variable.
belangeo - 2014
"""
from pyo import *
import sys
################### USER-DEFINED VARIABLES ###################
### READY is used to manage the server behaviour depending ###
### of the context. Set this variable to True when the ###
### music is ready for the radio. TITLE and ARTIST are the ###
### infos shown by the radio player. DURATION set the ###
### duration of the audio file generated for the streaming.###
##############################################################
READY = False # Set to True when ready for the radio
TITLE = "Song Title" # The title of the music
ARTIST = "Artist Name" # Your artist name
DURATION = 300 # The duration of the music in seconds
##################### These are optional #####################
GENRE = "Electronic" # Kind of your music, if there is any
DATE = 2014 # Year of creation
if __name__ == "__main__":
####################### SERVER CREATION ######################
if READY:
s = Server(duplex=0, audio="offline").boot()
s.recordOptions(dur=DURATION, filename=sys.argv[1], fileformat=7)
else:
s = Server(duplex=0).boot()
##################### PROCESSING SECTION #####################
# global volume (should be used to control the overall sound)
fade = Fader(fadein=0.001, fadeout=10, dur=DURATION).play()
###
### Insert your algorithms here...
###
#################### START THE PROCESSING ###################
s.start()
if not READY:
s.gui(locals())