2014-08-24 17:06:45 +00:00
|
|
|
define(["Tone/core/Tone", "Tone/instrument/MonoSynth"], function(Tone){
|
|
|
|
|
|
|
|
/**
|
|
|
|
* named presets for the MonoSynth
|
|
|
|
* @const
|
|
|
|
* @static
|
|
|
|
* @type {Object}
|
|
|
|
*/
|
|
|
|
Tone.MonoSynth.preset = {
|
2014-09-02 04:26:34 +00:00
|
|
|
"Pianoetta" : {
|
|
|
|
"portamento" : 0.0,
|
2014-08-24 17:06:45 +00:00
|
|
|
"oscType" : "square",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 6,
|
2014-09-02 04:26:34 +00:00
|
|
|
"type" : "lowpass",
|
|
|
|
"rolloff" : -24
|
2014-08-24 17:06:45 +00:00
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.005,
|
2014-09-02 04:26:34 +00:00
|
|
|
"decay" : 3,
|
|
|
|
"sustain" : 0,
|
|
|
|
"release" : 0.45
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.001,
|
|
|
|
"decay" : 0.32,
|
2014-08-24 17:06:45 +00:00
|
|
|
"sustain" : 0.9,
|
2014-09-02 04:26:34 +00:00
|
|
|
"release" : 3,
|
|
|
|
"min" : 700,
|
|
|
|
"max" : 3500
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Barky" : {
|
|
|
|
"portamento" : 0.01,
|
|
|
|
"oscType" : "triangle",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 3,
|
|
|
|
"type" : "highpass",
|
|
|
|
"rolloff" : -12
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.05,
|
|
|
|
"decay" : 0.15,
|
|
|
|
"sustain" : 0.6,
|
2014-08-24 17:06:45 +00:00
|
|
|
"release" : 1
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
2014-09-02 04:26:34 +00:00
|
|
|
"attack" : 0.02,
|
2014-08-24 17:06:45 +00:00
|
|
|
"decay" : 0.2,
|
2014-09-02 04:26:34 +00:00
|
|
|
"sustain" : 0.8,
|
|
|
|
"release" : 1.5,
|
|
|
|
"min" : 3000,
|
|
|
|
"max" : 250
|
2014-08-24 17:06:45 +00:00
|
|
|
}
|
|
|
|
},
|
2014-09-02 04:26:34 +00:00
|
|
|
"Bassy" : {
|
|
|
|
"portamento" : 0.08,
|
|
|
|
"oscType" : "square",
|
2014-08-24 17:06:45 +00:00
|
|
|
"filter" : {
|
2014-09-02 04:26:34 +00:00
|
|
|
"Q" : 4,
|
|
|
|
"type" : "lowpass",
|
|
|
|
"rolloff" : -24
|
2014-08-24 17:06:45 +00:00
|
|
|
},
|
|
|
|
"envelope" : {
|
2014-09-02 04:26:34 +00:00
|
|
|
"attack" : 0.04,
|
|
|
|
"decay" : 0.06,
|
|
|
|
"sustain" : 0.4,
|
|
|
|
"release" : 1
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.01,
|
2014-08-24 17:06:45 +00:00
|
|
|
"decay" : 0.1,
|
2014-09-02 04:26:34 +00:00
|
|
|
"sustain" : 0.6,
|
|
|
|
"release" : 1.5,
|
|
|
|
"min" : 50,
|
|
|
|
"max" : 350
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"BrassCircuit" : {
|
|
|
|
"portamento" : 0.01,
|
|
|
|
"oscType" : "sawtooth",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 2,
|
|
|
|
"type" : "lowpass",
|
|
|
|
"rolloff" : -12
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.1,
|
|
|
|
"decay" : 0.1,
|
|
|
|
"sustain" : 0.6,
|
|
|
|
"release" : 0.5
|
2014-08-24 17:06:45 +00:00
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
2014-09-02 04:26:34 +00:00
|
|
|
"attack" : 0.05,
|
|
|
|
"decay" : 0.8,
|
|
|
|
"sustain" : 0.4,
|
|
|
|
"release" : 1.5,
|
|
|
|
"min" : 2000,
|
|
|
|
"max" : 5000
|
2014-08-24 17:06:45 +00:00
|
|
|
}
|
2014-09-02 16:11:25 +00:00
|
|
|
},
|
|
|
|
"Pizz" : {
|
|
|
|
"portamento" : 0.00,
|
|
|
|
"oscType" : "square",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 2,
|
|
|
|
"type" : "highpass",
|
|
|
|
"rolloff" : -24
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.2,
|
|
|
|
"sustain" : 0.0,
|
|
|
|
"release" : 0.2
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.1,
|
|
|
|
"sustain" : 0.0,
|
|
|
|
"release" : 0.1,
|
|
|
|
"min" : 900,
|
|
|
|
"max" : 500
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Kick" : {
|
|
|
|
"portamento" : 0.00,
|
|
|
|
"oscType" : "square",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 2,
|
|
|
|
"type" : "bandpass",
|
|
|
|
"rolloff" : -12
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.2,
|
|
|
|
"sustain" : 0.0,
|
|
|
|
"release" : 0.2
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.2,
|
|
|
|
"sustain" : 1,
|
|
|
|
"release" : 0.4,
|
|
|
|
"min" : 3000,
|
|
|
|
"max" : 30
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"LaserSteps" : {
|
|
|
|
"portamento" : 0.00,
|
|
|
|
"oscType" : "sawtooth",
|
|
|
|
"filter" : {
|
|
|
|
"Q" : 2,
|
|
|
|
"type" : "bandpass",
|
|
|
|
"rolloff" : -24
|
|
|
|
},
|
|
|
|
"envelope" : {
|
|
|
|
"attack" : 0.01,
|
|
|
|
"decay" : 0.1,
|
|
|
|
"sustain" : 0.2,
|
|
|
|
"release" : 0.6
|
|
|
|
},
|
|
|
|
"filterEnvelope" : {
|
|
|
|
"attack" : 0.02,
|
|
|
|
"decay" : 0.4,
|
|
|
|
"sustain" : 1,
|
|
|
|
"release" : 0.2,
|
|
|
|
"min" : 0,
|
|
|
|
"max" : 7500
|
|
|
|
}
|
2014-08-24 17:06:45 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2014-09-02 04:26:34 +00:00
|
|
|
/**
|
|
|
|
* augment the prototype to include setPreset
|
|
|
|
*/
|
|
|
|
Tone.MonoSynth.prototype.setPreset = function(presetName){
|
|
|
|
presetName = this.defaultArg(presetName, "CasioPiano");
|
|
|
|
//look up if it exists
|
|
|
|
//TODO
|
|
|
|
//set it
|
|
|
|
this.set(Tone.MonoSynth.preset[presetName]);
|
|
|
|
};
|
|
|
|
|
2014-08-24 17:06:45 +00:00
|
|
|
return Tone.MonoSynth.preset;
|
|
|
|
});
|