Tone.js is a framework for creating interactive music in the browser. It provides advanced scheduling capabilities, synths and effects, and intuitive musical abstractions built on top of the Web Audio API.
Questions tagged [tone.js]
121 questions
7
votes
2 answers
Tone.js Error: 'Start time must be strictly greater than previous start time'
I am having a hard time understanding why I am getting thrown this error:
Debug.ts:8 Uncaught Error: Start time must be strictly greater than
previous start time
The weird part is that it only throws me this error about 4/5 times I refresh the…

charlieyin
- 371
- 6
- 16
6
votes
2 answers
How to use CDN in local javascript file
I am trying to use Tone.js to make music with javascript. I get the error message "tonetutorial.html:26 Uncaught TypeError: Tone.Player is not a constructor" whenever I try to make it work.
I have at the top of my HTML file. I am currently using…

CharlieBakes
- 83
- 1
- 1
- 7
5
votes
0 answers
Why does my Tone.Loop stop looping seemingly randomly?
My loop seems to stop randomly. What could be the issue?
I tried using a looped Tone.Event, and the same thing happens. Perhaps, its my understanding of the way time is interpreted in the Tone.Loop and the inner Transport.scheduleOnce. The loop…

Jungle Nomad
- 51
- 3
4
votes
1 answer
What do the values from Tone.Waveform().getValues() represent?
I am trying to draw the waveform of my audio using tone.js
// setup
const wave = new Tone.Waveform()
Tone.Master.connect(wave)
// later
wave.getValue() // returns an array (length 1024) of numbers between -1 and 1
This works fine, except that I'm…

Hoff
- 38,776
- 17
- 74
- 99
4
votes
1 answer
4
votes
1 answer
ReferenceError: AudioBuffer is not defined
I'm trying to use tone.js in a next.js react project.
When I run or build i get this error "ReferenceError: AudioBuffer is not defined"
I have isolated the tone.js code in codesandbox and it's working…

Shano
- 346
- 4
- 15
4
votes
4 answers
Tone.js completely stop all playing sounds
In short on a button press I'd like to play a few notes using a PolySynth and a Sequence. If the user repeatedly presses the button I'd like whatever is playing to be stopped, and started again.
The issue: No matter what I try I cannot completely…

Balázs Édes
- 13,452
- 6
- 54
- 89
4
votes
1 answer
How to change pitch AND playback rate with JavaScript / Tone.js?
I would like to accomplish two things at the same time:
1) change playback rate of a sound file to 1/2 speed
2) lower pitch by a fifth
Lastly, Instead of using a separate button to play the result I would like to hook this up to an audio tag and use…

mandmeier
- 355
- 5
- 16
4
votes
2 answers
Using Tone.js with Three.js - how to get positional audio?
I can easily get Tone.js to generate a tone within a Three.js world, simply by calling, e.g., oscillator = new Tone.Oscillator(440, "sine").toMaster();, but I can't work out how to connect that tone to an AudioListener in the Three.js world to make…

B-30
- 323
- 1
- 13
3
votes
3 answers
How can I use Tone.JS to play a MIDI file?
While looking through the Tone.JS documentation, I found that MIDI files were supported.
MIDI
To use MIDI files, you’ll first need to convert them into a JSON format which Tone.js can understand using Midi.
Although there are many resources online…

py660
- 138
- 11
3
votes
0 answers
Get frequency of Microphone audio in Tone.js Library
I am not sure how to accomplish this. I want to take the incoming microphone audio and display the current frequency detected every second. I am using Tone.js, but the frequency always displays as 0. Here is my javascript so far:
const log =…

Cory Eheart
- 33
- 3
3
votes
1 answer
How do I avoid audio from disappearing when using `Tone.PolySynth()` with `Sequence` method?
Context
I've been trying to build a step sequencer similar to the official example in Tone.js documentation. Instead of using playing MP3 files with Players method, however, I wanted to implement PolySynth to explore a variety of sounds like Jon…

Bumhan Yu
- 2,078
- 1
- 10
- 20
3
votes
1 answer
tone.js: How to know when triggerRelease has finished
I want to update my UI when a note has finished playing with tone.js
const now = Tone.now()
synth.triggerAttack("G3", now);
synth.triggerRelease("G3", now + 60 / this.tempo)
How can I get a callback or add a listener to the triggerRelease so I can…

etayluz
- 15,920
- 23
- 106
- 151
3
votes
0 answers
Failing to execute `connect` on `AudioNode`
I have this script in the header of an HTML file. It works fine with the exception of the line delay.connect(Tone.context.destination); midway down that theoretically adds layering of the sounds in the DuoSynth by starting one of them on a delay. …

LevelChart8
- 207
- 1
- 8
3
votes
1 answer
Tone.js Tone.BufferSource: buffer is either not set or not loaded
Tone.BufferSource: buffer is either not set or not loaded. This error occurs in try/catch block. It only occurs, when I trigger update function constantly or sometimes randomly.
When this error occurs my audio just turns off for a brief moment.
The…

Tautvydas Būda
- 188
- 1
- 4
- 17