oscillator safari compatibility

This commit is contained in:
gauthiier 2015-08-17 10:26:17 +02:00
parent 11a906f725
commit 8322a8ab79
2 changed files with 4 additions and 4 deletions

View File

@ -3,7 +3,7 @@ var modfactor = 750.0;
var modfactor_gain = 10750.0; var modfactor_gain = 10750.0;
function create_none_synth() { 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.add_filter(new LowPassFilter());
s.update = function(val) { s.update = function(val) {
this.modulator_freq(val / modfactor); this.modulator_freq(val / modfactor);

View File

@ -40,8 +40,8 @@ function FMSynth(waveform_c, freq_c, waveform_m, freq_m, gain_m) {
this.start = function() { this.start = function() {
if(!this.started) { if(!this.started) {
this.carrier.osc.start(); this.carrier.osc.start(0);
this.modulator.osc.start(); this.modulator.osc.start(0);
this.started = true; this.started = true;
} else { } else {
this.carrier.gain.gain.value = 1.0; this.carrier.gain.gain.value = 1.0;
@ -78,7 +78,7 @@ function SimpleOscillator(waveform, freq) {
this.start = function() { this.start = function() {
if(!this.started) { if(!this.started) {
this.oscillator.osc.start(); this.oscillator.osc.start(0);
this.started = true; this.started = true;
} else { } else {
this.oscillator.gain.gain.value = 1.0; this.oscillator.gain.gain.value = 1.0;