making time optional

This commit is contained in:
Yotam Mann 2019-10-16 14:59:03 -04:00
parent bc0d83d4cf
commit 4c5e05d7ca

View file

@ -79,7 +79,7 @@ export class NoiseSynth extends Instrument<NoiseSynthOptions> {
* @example
* noiseSynth.triggerAttack();
*/
triggerAttack(time: Time, velocity: NormalRange = 1): this {
triggerAttack(time?: Time, velocity: NormalRange = 1): this {
time = this.toSeconds(time);
// the envelopes
this.envelope.triggerAttack(time, velocity);
@ -94,7 +94,7 @@ export class NoiseSynth extends Instrument<NoiseSynthOptions> {
/**
* Start the release portion of the envelopes.
*/
triggerRelease(time: Time): this {
triggerRelease(time?: Time): this {
time = this.toSeconds(time);
this.envelope.triggerRelease(time);
this.noise.stop(time + this.toSeconds(this.envelope.release));