-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of github.com:ideoforms/signalflow
- Loading branch information
Showing
29 changed files
with
363 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using ASREnvelope to shape the sound of an oscillator over time. | ||
# The Line node generates a continuously-changing value which we use as the | ||
# release time. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(8.0) | ||
CMaj7 = [ 60, 64, 67, 71, 74, 76 ] * 8 | ||
FMaj9 = [ 65, 69, 72, 76, 77, 81 ] * 8 | ||
arpeggios = CMaj7 + FMaj9 | ||
sequence = Sequence(arpeggios, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = TriangleOscillator(frequency) | ||
release = Line(0.1, 0.5, 6, True) | ||
envelope = ASREnvelope(attack=0.0, | ||
sustain=0.0, | ||
release=release, | ||
curve=1.0, | ||
clock=clock) | ||
voice = oscillator * envelope | ||
|
||
pan = SineLFO(0.1667, -1.0, 1.0) | ||
output = StereoPanner(voice, pan) | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using Line to repeatedly alter the release value of an envelope applied to the | ||
# main synth voice, in time with the music. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(8.0) | ||
CMaj7 = [ 60, 64, 67, 71, 74, 76 ] * 8 | ||
FMaj9 = [ 65, 69, 72, 76, 77, 81 ] * 8 | ||
arpeggios = CMaj7 + FMaj9 | ||
sequence = Sequence(arpeggios, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = TriangleOscillator(frequency) | ||
release = Line(0.1, 0.5, 6, True) | ||
envelope = ASREnvelope(0.0, 0.0, release, 1.0, clock) | ||
voice = oscillator * envelope | ||
|
||
pan = SineLFO(0.1667, -1.0, 1.0) | ||
output = StereoPanner(voice, pan) | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using ChannelArray to pan a low tone to the left and a high tone to the right. | ||
#------------------------------------------------------------------------------- | ||
low = TriangleOscillator(220) | ||
high = TriangleOscillator(660) | ||
panned = ChannelArray([low, high]) * 0.3 | ||
panned.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using AllpassDelay to add a delay effect to a simple melodic sequence. | ||
# The original oscillator can be heard in the left channel. | ||
# The delay effect can be heard in the right channel. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(1.0) | ||
sequence = Sequence([ 60, 62, 64, 65, 67, 69, 71, 72 ], clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = TriangleOscillator(frequency) | ||
envelope = ASREnvelope(0, 0.2, 0.3, 1.0, clock) | ||
voice = oscillator * envelope | ||
delayed = AllpassDelay(input=voice, | ||
delay_time=0.4, | ||
feedback=0.8) | ||
|
||
output = ChannelArray([ voice, delayed ]) * 0.75 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using AllpassDelay to add a dreamy atmosphere to synth arpeggios | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(3.5) | ||
Am7 = [ 67, 64, 60, 57 ] * 4 | ||
D7 = [ 62, 66, 69, 72] * 4 | ||
arpeggios = Am7 + D7 | ||
sequence = Sequence(arpeggios, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = SquareOscillator(frequency) | ||
envelope = ASREnvelope(0.1, 0, 0.2, 1.0, clock) | ||
voice = oscillator * envelope | ||
filtered = SVFilter(voice, "low_pass", 4000, 0.3) | ||
delayed = AllpassDelay(input=filtered, | ||
delay_time=0.15, | ||
feedback=0.8) | ||
|
||
pan = TriangleLFO(0.1, -1.0, 1.0) | ||
output = StereoPanner(delayed, pan) * 0.5 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using CombDelay to change the character of a saw wave oscillator. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(4) | ||
arpeggio = [60, 62, 64, 66, 68, 70, | ||
72, 70, 68, 66, 64, 62] | ||
sequence = Sequence(arpeggio, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = SawOscillator(frequency) | ||
envelope = ASREnvelope(0.1, 0, 0.2, 1.0, clock) | ||
voice = oscillator * envelope | ||
comb = CombDelay(input=voice, | ||
delay_time=0.09, | ||
feedback=0.6, | ||
max_delay_time=0.9) | ||
|
||
output = StereoPanner(comb) * 0.5 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using OneTapDelay to create a delay effect with no feedback. | ||
# The original sound is heard in the left channel, and the delayed sound in the | ||
# right channel. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(1) | ||
oscillator = TriangleOscillator(440) | ||
envelope = ASREnvelope(0.001, 0, 0.3, 1.0, clock) | ||
voice = oscillator * envelope | ||
delayed = OneTapDelay(voice, 0.25) * 0.5 | ||
output = ChannelArray([voice, delayed]) * 0.5 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using OneTapDelay to bring controlled rhythmic interest to a melodic sequence | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(3.5) | ||
Dm = [ 62, 65, 69 ] * 2 | ||
Bdim = [ 59, 62, 65 ] * 2 | ||
Gm = [55, 58, 62 ] * 2 | ||
Bb = [77, 74, 70 ] | ||
A = [ 76, 73, 69 ] | ||
|
||
arpeggios = Dm + Bdim + Gm + Bb + A | ||
sequence = Sequence(arpeggios, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = SquareOscillator(frequency) | ||
envelope = ASREnvelope(0.1, 0, 0.2, 1.0, clock) | ||
voice = oscillator * envelope | ||
filtered = SVFilter(voice, "low_pass", 4000, 0.3) | ||
delayed = filtered + OneTapDelay(filtered, 0.4) * 0.5 | ||
|
||
output = StereoPanner(delayed) * 0.3 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using Resample to distort a sine wave. | ||
#------------------------------------------------------------------------------- | ||
sine = SineOscillator(440) | ||
crushed = Resample(sine, 11025, 4) | ||
output = StereoPanner(crushed) * 0.3 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using EQ to shape white noise. The low band (below 500Hz) is reduced. The mid | ||
# band is boosted. The high band (above 2000Hz) is reduced drastically. | ||
#------------------------------------------------------------------------------- | ||
noise = WhiteNoise() | ||
eq = EQ(input=noise, | ||
low_gain=0.0, | ||
mid_gain=1.5, | ||
high_gain=0.2, | ||
low_freq=1000, | ||
high_freq=2000) | ||
output = StereoPanner(eq) * 0.5 | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using SVFilter as a low-pass filter on white noise. | ||
#------------------------------------------------------------------------------- | ||
noise = WhiteNoise() | ||
filtered = SVFilter(input=noise, | ||
filter_type="low_pass", | ||
cutoff=1000, | ||
resonance=0.6) | ||
output = StereoPanner(filtered) | ||
output.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using SVFilter as a low-pass filter to reduce the harshness of a square wave | ||
# oscillator. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(3.5) | ||
Am7 = [ 67, 64, 60, 57 ] * 4 | ||
D7 = [ 62, 66, 69, 72] * 4 | ||
arpeggios = Am7 + D7 | ||
sequence = Sequence(arpeggios, clock) | ||
frequency = MidiNoteToFrequency(sequence) | ||
|
||
oscillator = SquareOscillator(frequency) | ||
envelope = ASREnvelope(0.1, 0, 0.2, 1.0, clock) | ||
voice = oscillator * envelope | ||
filtered = SVFilter(input=voice, | ||
filter_type= "low_pass", | ||
cutoff=4000, | ||
resonance=0.3) | ||
delayed = AllpassDelay(filtered, 0.15, 0.8, 0.5) | ||
|
||
pan = TriangleLFO(0.1, -1.0, 1.0) | ||
output = StereoPanner(delayed, pan) * 0.3 | ||
output.play() | ||
graph.wait() |
17 changes: 17 additions & 0 deletions
17
docs/library/processors/panning/stereobalance/example-0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Demonstrating the effects of StereoBalance. First a low tone is assigned to | ||
# the left channel and a high tone is assigned to the right channel. | ||
# Setting StereoBalance's balance value to 0.0 will mean both tones are heard | ||
# equally. A value of -1.0 will result in only the left channel being heard. | ||
# A value of 1.0 will result in only the right channel being heard. | ||
# In this example, an LFO is modulating the balance value between -1.0 and 1.0. | ||
#------------------------------------------------------------------------------- | ||
low = TriangleOscillator(220) | ||
high = TriangleOscillator(660) | ||
panned = ChannelArray([low, high]) | ||
balanced = StereoBalance(panned, TriangleLFO(0.2, -1, 1)) * 0.5 | ||
balanced.play() | ||
graph.wait() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using StereoPanner to pan a low pitch to the left and a high pitch to the | ||
# right. | ||
#------------------------------------------------------------------------------- | ||
low = TriangleOscillator(220) | ||
high = TriangleOscillator(660) | ||
|
||
left = StereoPanner(low, -0.8) | ||
right = StereoPanner(high, 0.8) | ||
|
||
output = (left + right) * 0.5 | ||
output.play() | ||
graph.wait() |
Oops, something went wrong.