Commit 190fa0bf authored by jhammen's avatar jhammen
Browse files

update to use connection operator

parent ebf12364
......@@ -50,8 +50,7 @@ To actually play the notes from the tune, we'll first create a plugin synthesize
and connect it to the system outputs:
*/
local synth = Lv2.Plugin("http://calf.sourceforge.net/plugins/Monosynth", "Square Worm")
local output = Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
output.connect(synth)
=> Audio.StereoOutput("main", true)
/**
We can retrieve the notes from the tune as via the _track_ method which returns the given
......
......@@ -12,8 +12,7 @@ create an LV2 sampler, set its volume, and connect its stereo outputs to the sys
local sampler = Lv2.Plugin("http://www.openavproductions.com/fabla", "fabla808")
sampler.control("volume", 0.6)
local mainOutput = Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
mainOutput.connect(sampler)
sampler => Audio.StereoOutput("main", true)
/**
Also as seen in the [scheduling notes example](../schedulenotes/) we will create our notes:
......
......@@ -16,8 +16,7 @@ First we create a drum machine sampler and connect it to the system outputs:
local sampler = Lv2.Plugin("http://www.openavproductions.com/fabla", "fabla808")
sampler.control("volume", 0.5)
local mainOutput = Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
mainOutput.connect(sampler)
sampler => Audio.StereoOutput("main", true)
/**
## Drum Patterns
......
......@@ -50,17 +50,13 @@ local piano = CompPiano()
Create an audio mixer and connect the players to the mixer inputs, note the mixer input
channel count is twice the number of players as they are all stereo:
*/
local mixer = Audio.Mixer(6, 2)
mixer.connect(bass.output())
mixer.connect(drums.output())
mixer.connect(piano.output())
local mixer = Audio.Mixer(6, 2);
[bass.output(), drums.output(), piano.output()] => mixer
/**
Connect the mixer to a system stereo output and connect the output to the soundcard:
Connect the mixer to a system stereo output connected to the soundcard:
*/
local sysout = "system:playback"
local mainOutput = Audio.StereoOutput("main", sysout + "_1", sysout + "_2")
mainOutput.connect(mixer)
mixer => Audio.StereoOutput("main", true)
/**
## MIDI Control Surface
......@@ -96,7 +92,7 @@ the sensitive side (use values above 1.0 to make less sensitive):
*/
local detector = Audio.OnsetDetector()
detector.threshold = 0.9
detector.connect(input)
input => detector
/**
Now define a variable and an event handler to be called on each onset, increment the variable
on each onset but do not allow the total sum to go above 100:
......
......@@ -35,8 +35,7 @@ We'll create a sampler, load it with 808-style samples and connect to the system
*/
local sampler = Lv2.Plugin("http://www.openavproductions.com/fabla", "fabla808")
local output = Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
output.connect(sampler)
sampler => Audio.StereoOutput("main", true)
/**
Also we create a MIDI input for our control surface:
......
......@@ -21,8 +21,7 @@ sampler.control("volume", 0.7)
Now we connect the sampler to the system outputs:
*/
local output = Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
output.connect(sampler)
sampler => Audio.StereoOutput("main", true)
/**
Now we have a sampler, samples loaded, connected directly to the system playback channels. This
......
......@@ -23,8 +23,8 @@ Any scheduled events, of any type, will use this clock by default:
// instantiate drum plugin and connect to output
sampler <- Lv2.Plugin("http://www.openavproductions.com/fabla", "fabla808")
output <- Audio.StereoOutput("main", "system:playback_1", "system:playback_2")
output.connect(sampler)
sampler => Audio.StereoOutput("main", true)
// loop over four measures
for(local m = 1; m <= 4; m++) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment