Skip to content

Commit 384f9f1

Browse files
committed
fix(synth-playground): rename SynthTime in examples
1 parent 3e420a3 commit 384f9f1

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { OscillatorSynthNode, ADSREnvelopeSynthNode, SynthTime, Seconds, Hertz, Notes, Normal, Pitch } from 'synth'
1+
import { OscillatorSynthNode, ADSREnvelopeSynthNode, Time, Seconds, Hertz, Notes, Normal, Pitch } from 'synth'
22
import { context } from 'synth/playground'
33

44
const oscillator = new OscillatorSynthNode(context)
@@ -9,17 +9,17 @@ envelope.connect(context.output)
99

1010
oscillator.frequency.initialValue = Pitch.frequency('A4')
1111
oscillator.waveShape.value = 'sawtooth'
12-
envelope.attack.initialValue = SynthTime.note.toNotes()
13-
envelope.decay.initialValue = SynthTime.note.toNotes()
12+
envelope.attack.initialValue = Time.note.toNotes()
13+
envelope.decay.initialValue = Time.note.toNotes()
1414
envelope.sustain.initialValue = Normal(0.5)
15-
envelope.release.initialValue = SynthTime.note.toNotes()
15+
envelope.release.initialValue = Time.note.toNotes()
1616

17-
let time = SynthTime.start
17+
let time = Time.start
1818
for (let i = 0; i < 5; i++) {
1919
envelope.attackAt(time)
20-
time = time.add(SynthTime.note)
20+
time = time.add(Time.note)
2121
envelope.releaseAt(time)
22-
time = time.add(SynthTime.note)
22+
time = time.add(Time.note)
2323
oscillator.frequency.curve.rampValueUntil(time, Hertz(440 + 40 * i))
2424
context.secondsPerNote.rampValueUntil(time, Seconds(1 / (i + 1)))
2525
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { OscillatorSynthNode, SynthTime, Pitch } from 'synth'
1+
import { OscillatorSynthNode, Time, Pitch } from 'synth'
22
import { context } from 'synth/playground'
33

44
const oscillator = new OscillatorSynthNode(context)
55

66
oscillator.connect(context.output)
77

88
oscillator.frequency.initialValue = Pitch.frequency('A4')
9-
oscillator.frequency.curve.holdValueAt(SynthTime.half)
10-
oscillator.frequency.curve.rampValueUntil(SynthTime.note, Pitch.frequency('A5'))
9+
oscillator.frequency.curve.holdValueAt(Time.half)
10+
oscillator.frequency.curve.rampValueUntil(Time.note, Pitch.frequency('A5'))

apps/synth-playground/public/examples/still-alive.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { GeneratorSynthNode, GainSynthNode, SynthTime as T, Factor, Pitch, PitchNotation } from 'synth'
1+
import { GeneratorSynthNode, GainSynthNode, Time as T, Factor, Pitch, PitchNotation } from 'synth'
22
import { context } from 'synth/playground'
33

44
const generator = new GeneratorSynthNode(context, { maxPolyphony: 16 })

0 commit comments

Comments
 (0)