T("OscGen")
AR Oscillator x Envelope
Description
1
2
3
4
5
6
7
8
9
var osc = T("pulse");
var env = T("perc", {a:50, r:2500});
var oscenv = T("OscGen", {osc:osc, env:env, mul:0.15}).play();
T("interval", {interval:500}, function(count) {
var noteNum = 69 + [0, 2, 4, 5, 7, 9, 11, 12][count % 8];
var velocity = 64 + (count % 64);
oscenv.noteOn(noteNum, velocity);
}).start();
Properties
osc
env
poly
Methods
noteOn(noteNum, velocity, opts)
noteOnWithFreq(freq, velocity, opts)
noteOff(noteNum)
noteOffWithFreq(freq)
allNoteOff()
allSoundOff()
See Also
T("SynthDef")
- Synth Definition
T("osc")
- Oscillator
T("env")
- Envelope
Source
https://github.com/mohayonao/timbre.js/blob/master/src/objects/synthdef.js