-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathhello-world-example.py
executable file
·30 lines (25 loc) · 1.04 KB
/
hello-world-example.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
#!/usr/bin/env python3
#------------------------------------------------------------------------
# SignalFlow: Hello World example.
#
# Play a sine tone.
#------------------------------------------------------------------------
from signalflow import *
def main():
#------------------------------------------------------------------------
# Create the global processing graph.
#------------------------------------------------------------------------
graph = AudioGraph()
#------------------------------------------------------------------------
# Create a sine oscillator, attenuate by 12dB, and pan to stereo.
#------------------------------------------------------------------------
sine = SineOscillator(440)
sine = sine * db_to_amplitude(-12)
stereo = StereoPanner(sine)
#------------------------------------------------------------------------
# Play the
#------------------------------------------------------------------------
graph.play(stereo)
graph.wait(2)
if __name__ == "__main__":
main()