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;
|
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);
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user