oscillator safari compatibility
This commit is contained in:
parent
11a906f725
commit
8322a8ab79
@ -3,7 +3,7 @@ var modfactor = 750.0;
|
||||
var modfactor_gain = 10750.0;
|
||||
|
||||
function create_none_synth() {
|
||||
var s = new FMSynth('triangle', 100, 'saw', 2, 300);
|
||||
var s = new FMSynth('triangle', 100, 'sawtooth', 2, 300);
|
||||
s.add_filter(new LowPassFilter());
|
||||
s.update = function(val) {
|
||||
this.modulator_freq(val / modfactor);
|
||||
|
||||
@ -40,8 +40,8 @@ function FMSynth(waveform_c, freq_c, waveform_m, freq_m, gain_m) {
|
||||
|
||||
this.start = function() {
|
||||
if(!this.started) {
|
||||
this.carrier.osc.start();
|
||||
this.modulator.osc.start();
|
||||
this.carrier.osc.start(0);
|
||||
this.modulator.osc.start(0);
|
||||
this.started = true;
|
||||
} else {
|
||||
this.carrier.gain.gain.value = 1.0;
|
||||
@ -78,7 +78,7 @@ function SimpleOscillator(waveform, freq) {
|
||||
|
||||
this.start = function() {
|
||||
if(!this.started) {
|
||||
this.oscillator.osc.start();
|
||||
this.oscillator.osc.start(0);
|
||||
this.started = true;
|
||||
} else {
|
||||
this.oscillator.gain.gain.value = 1.0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user