diff --git a/apps/synth-playground/public/examples/bpm-ramp.txt b/apps/synth-playground/public/examples/bpm-ramp.txt index 67b34a18..be689a07 100644 --- a/apps/synth-playground/public/examples/bpm-ramp.txt +++ b/apps/synth-playground/public/examples/bpm-ramp.txt @@ -1,4 +1,4 @@ -import { OscillatorSynthNode, ADSREnvelopeSynthNode, SynthTime, Seconds, Hertz, Notes, Normal, Pitch } from 'synth' +import { OscillatorSynthNode, ADSREnvelopeSynthNode, Time, Seconds, Hertz, Notes, Normal, Pitch } from 'synth' import { context } from 'synth/playground' const oscillator = new OscillatorSynthNode(context) @@ -9,17 +9,17 @@ envelope.connect(context.output) oscillator.frequency.initialValue = Pitch.frequency('A4') oscillator.waveShape.value = 'sawtooth' -envelope.attack.initialValue = SynthTime.note.toNotes() -envelope.decay.initialValue = SynthTime.note.toNotes() +envelope.attack.initialValue = Time.note.toNotes() +envelope.decay.initialValue = Time.note.toNotes() envelope.sustain.initialValue = Normal(0.5) -envelope.release.initialValue = SynthTime.note.toNotes() +envelope.release.initialValue = Time.note.toNotes() -let time = SynthTime.start +let time = Time.start for (let i = 0; i < 5; i++) { envelope.attackAt(time) - time = time.add(SynthTime.note) + time = time.add(Time.note) envelope.releaseAt(time) - time = time.add(SynthTime.note) + time = time.add(Time.note) oscillator.frequency.curve.rampValueUntil(time, Hertz(440 + 40 * i)) context.secondsPerNote.rampValueUntil(time, Seconds(1 / (i + 1))) } diff --git a/apps/synth-playground/public/examples/default.txt b/apps/synth-playground/public/examples/default.txt index 35922580..9f114c9e 100644 --- a/apps/synth-playground/public/examples/default.txt +++ b/apps/synth-playground/public/examples/default.txt @@ -1,4 +1,4 @@ -import { OscillatorSynthNode, SynthTime, Pitch } from 'synth' +import { OscillatorSynthNode, Time, Pitch } from 'synth' import { context } from 'synth/playground' const oscillator = new OscillatorSynthNode(context) @@ -6,5 +6,5 @@ const oscillator = new OscillatorSynthNode(context) oscillator.connect(context.output) oscillator.frequency.initialValue = Pitch.frequency('A4') -oscillator.frequency.curve.holdValueAt(SynthTime.half) -oscillator.frequency.curve.rampValueUntil(SynthTime.note, Pitch.frequency('A5')) +oscillator.frequency.curve.holdValueAt(Time.half) +oscillator.frequency.curve.rampValueUntil(Time.note, Pitch.frequency('A5')) diff --git a/apps/synth-playground/public/examples/still-alive.txt b/apps/synth-playground/public/examples/still-alive.txt index 210a0a7a..5bd10c4a 100644 --- a/apps/synth-playground/public/examples/still-alive.txt +++ b/apps/synth-playground/public/examples/still-alive.txt @@ -1,4 +1,4 @@ -import { GeneratorSynthNode, GainSynthNode, SynthTime as T, Factor, Pitch, PitchNotation } from 'synth' +import { GeneratorSynthNode, GainSynthNode, Time as T, Factor, Pitch, PitchNotation } from 'synth' import { context } from 'synth/playground' const generator = new GeneratorSynthNode(context, { maxPolyphony: 16 })