-
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.
Adding examples for ChannelArray, OneTapDelay, Resample, StereoWidth. Updating documentation for Line.
- Loading branch information
Showing
6 changed files
with
77 additions
and
1 deletion.
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,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
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,12 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using StereoWidth to continuously alter the width of a stereo signal. | ||
#------------------------------------------------------------------------------- | ||
low = TriangleOscillator(220) | ||
high = TriangleOscillator(660) | ||
panned = ChannelArray([low, high]) | ||
width = StereoWidth(panned, TriangleLFO(0.5, 0, 1)) * 0.3 | ||
width.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