-
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 pull request #111 from ideoforms/docs/examples
Documentation: Creating Examples
- Loading branch information
Showing
40 changed files
with
352 additions
and
28 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
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() | ||
|
||
#------------------------------------------------------------------------------- | ||
# When the left mouse button is clicked, as detected by MouseDown(), an LFO is applied to the oscillator's frequency. | ||
#------------------------------------------------------------------------------- | ||
lfo = SineLFO(5, 100, 600) | ||
frequency = If(MouseDown(), lfo, 100) | ||
osc = TriangleOscillator(frequency) | ||
osc.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,13 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. | ||
#------------------------------------------------------------------------------- | ||
rate = MouseX() * 10 | ||
upper_limit = MouseY() * 1500 | ||
lfo = SineLFO(rate, 100, upper_limit) | ||
frequency = If(MouseDown(), lfo, 100) | ||
osc = TriangleOscillator(frequency) | ||
osc.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 the MouseX position to change the rate of an LFO, which is modulating an oscillator's frequency | ||
#------------------------------------------------------------------------------- | ||
lfo_rate = MouseX() * 10 | ||
frequency = SineLFO(lfo_rate, 100, 600) | ||
osc = TriangleOscillator(frequency) | ||
osc.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,13 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. | ||
#------------------------------------------------------------------------------- | ||
rate = MouseX() * 10 | ||
upper_limit = MouseY() * 1500 | ||
lfo = SineLFO(rate, 100, upper_limit) | ||
frequency = If(MouseDown(), lfo, 100) | ||
osc = TriangleOscillator(frequency) | ||
osc.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,10 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using the MouseY position to change the frequency of an oscillator. | ||
#------------------------------------------------------------------------------- | ||
frequency = MouseY() * 1000 | ||
osc = TriangleOscillator(frequency) | ||
osc.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,13 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# A simple wobbling synthesiser controlled using the mouse. When the mouse is clicked, as detected by MouseDown(), an LFO is activated and affects the oscillator's frequency. MouseX position changes the rate of the LFO. MouseY position changes the upper frequency limit, affecting pitch. | ||
#------------------------------------------------------------------------------- | ||
rate = MouseX() * 10 | ||
upper_limit = MouseY() * 1500 | ||
lfo = SineLFO(rate, 100, upper_limit) | ||
frequency = If(MouseDown(), lfo, 100) | ||
osc = TriangleOscillator(frequency) | ||
osc.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 an ASR Envelope to shape a square wave oscillator | ||
#------------------------------------------------------------------------------- | ||
osc = SquareOscillator(500) | ||
envelope = ASREnvelope(0.1, 0.0, 0.5) | ||
output = osc * envelope | ||
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,12 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using a line to control the gain of an oscillator, emulating a sidechain ducking effect. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(frequency=1.0) | ||
line = Line(0.0, 0.5, 0.5, False, clock) | ||
osc = SawOscillator(200) | ||
output = osc * line | ||
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,12 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Using an Impulse node as a clock to trigger an envelope once per second. | ||
#------------------------------------------------------------------------------- | ||
clock = Impulse(1.0) | ||
osc = TriangleOscillator(250) | ||
envelope = ASREnvelope(0.01, 0.0, 0.5, 1.0, clock) | ||
output = osc * envelope | ||
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
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,10 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Siren effect, using a sawtooth LFO to modulate a sinewave's frequency | ||
#------------------------------------------------------------------------------- | ||
lfo = SawLFO(1, 200, 1000) | ||
sine = SineOscillator(lfo) | ||
sine.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 |
---|---|---|
@@ -1,13 +1,33 @@ | ||
title: SawLFO node documentation | ||
description: SawLFO: Produces a sawtooth LFO, with output ranging from `min` to `max`. | ||
description: SawLFO: Produces a sawtooth LFO at the fiven `frequency` and `phase` offset, with output ranging from `min` to `max`. | ||
|
||
[Reference library](../../index.md) > [Oscillators](../index.md) > [SawLFO](index.md) | ||
[Reference library](../index.md) > [Oscillators](index.md) > [SawLFO](sawlfo.md) | ||
|
||
# SawLFO | ||
|
||
```python | ||
SawLFO(frequency=1.0, min=0.0, max=1.0, phase=0.0) | ||
``` | ||
|
||
Produces a sawtooth LFO, with output ranging from `min` to `max`. | ||
Produces a sawtooth LFO at the given `frequency` and `phase` offset, with output ranging from `min` to `max`. | ||
|
||
### Examples | ||
|
||
```python | ||
|
||
<<<<<<< HEAD | ||
# Siren effect, using a sawtooth LFO to modulate a sine wave's frequency | ||
lfo = SawLFO(1, 200, 1000) | ||
sine = SineOscillator(lfo) | ||
sine.play() | ||
``` | ||
======= | ||
#------------------------------------------------------------------------------- | ||
# Siren effect, using a sawtooth LFO to modulate a sinewave's frequency | ||
#------------------------------------------------------------------------------- | ||
lfo = SawLFO(1, 200, 1000) | ||
sine = SineOscillator(lfo) | ||
sine.play() | ||
``` | ||
>>>>>>> docs/examples |
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() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Simple saw wave oscillator shaped by an envelope | ||
#------------------------------------------------------------------------------- | ||
saw = SawOscillator(440) | ||
envelope = ASREnvelope(0.05, 0.1, 0.5) | ||
output = saw * envelope | ||
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
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,11 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Simple sine wave oscillator shaped by an envelope | ||
#------------------------------------------------------------------------------- | ||
sine = SineOscillator(440) | ||
envelope = ASREnvelope(0.1, 0.1, 0.5) | ||
output = sine * envelope | ||
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,10 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Alarm effect, using a pulse wave LFO to modulate a sinewave's frequency | ||
#------------------------------------------------------------------------------- | ||
lfo = SquareLFO(1, 200, 400) | ||
sine = SineOscillator(lfo) | ||
sine.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,11 @@ | ||
from signalflow import * | ||
graph = AudioGraph() | ||
|
||
#------------------------------------------------------------------------------- | ||
# Simple square wave oscillator shaped by an envelope | ||
#------------------------------------------------------------------------------- | ||
square = SquareOscillator(440) | ||
envelope = ASREnvelope(0, 0.1, 0.5) | ||
output = square * envelope | ||
output.play() | ||
graph.wait() |
Oops, something went wrong.