Jazz-Soft.net

We make it sound!

Home » Documentation » JZZ.js » Modules » JZZ.synth.Timbre

JZZ.synth.Timbre

A a wrapper for Timbre.js library.

See the demo...

Usage

JZZ.input.Timbre(obj);
// or
JZZ.input.Timbre(name, obj);
// or
JZZ.input.Timbre.register(name, obj);
JZZ().openMidiOut(name);

where obj - is a Timbre.js synth. See more details in the Timbre.js documentation...

Example

<script src='JZZ.js'></script>
<script src='timbre.js'></script>
<script src='JZZ.synth.Timbre.js'></script>
...
<script><!--
var timbre = T("SynthDef").play();
timbre.def = function(opts) {
  var osc1, osc2, env;
  osc1 = T("sin", {freq:opts.freq, mul:0.25});
  osc2 = T("sin", {freq:opts.freq + 8, mul:0.25});
  env  = T("linen", {s:450, r:2500, lv:0.5}, osc1, osc2);
  return env.on("ended", opts.doneAction).bang();
};
JZZ.synth.Timbre(timbre).noteOn(0, 'C5', 127).wait(500).noteOff(0, 'C5');
--></script>

See also