Questions tagged [tonejs]

32 questions
3
votes
1 answer

Tone.js with ESM modules

I am trying to use tone.js on ESM modules. (I could use it without problems in “commonjs” with a bundler) In the html I have and tests.js: import * as Tone from "./Tone.js" gives -> Tone.Gain is not…
tru7
  • 6,348
  • 5
  • 35
  • 59
2
votes
0 answers

Start loop on different position the first time with ToneJS

For a sequencer I'm using ToneJS. I create a new Tone.Sequence and it works great. I can get it to loop by adding a .loop = true at the end. However, is there a way to make the loop start on a different position in the sequence ONLY for the first…
user68177
  • 21
  • 1
2
votes
1 answer

What is the proper way to set BPM in Tone.js

I have tried simply setting Tone.Transport.bpm but it is ignored. My content just plays at the default 120 BPM. I then looked at some of the docs and it implies you can pass parameters to a constructor to make a Transport with custom parameters.…
Roger Heathcote
  • 3,091
  • 1
  • 33
  • 39
2
votes
0 answers

How to replace sounds in tone js sampler?

I'm using the following code from this documentation: const sampler = new Tone.Sampler({ urls: { A1: "one.mp3", A2: "two.mp3", }, baseUrl: "https://example.com/", onload: () => { …
mark mark
  • 306
  • 2
  • 13
1
vote
0 answers

Tone js giving errors while trying to play a file on pc in main process of electron-react app

I want to play audio files (mp3/wav) in my electron app, Right now I am using react as ui and sending ipcEvents back and forth between main process and renderer to try to play the audio file. I am using Tone js for doing so, below is the code where…
Silenx
  • 37
  • 6
1
vote
0 answers

how to modify effect options in Tone JS

Hello im currently trying to create a digital guitar amp through browser using tone js v14.7.77 that has reverb (freeverb), delay(pingPongDelay), and distortion and i have hard time to set the effect options such as delaytime, distortion, etc…
muntun
  • 41
  • 1
  • 5
1
vote
1 answer

Tone.js : Getting unexpected results when tweaking synth parameters live (ex. detune, modulation index, attack etc.)

I've been working on a Tone.js synthesizer project for some time now. For the record I will include the links: Repo Deployment (it is still under development as I am stuck with this issue) I have encountered a serious issue that I couldn't manage to…
1
vote
0 answers

Tone.js: Tone.start is not a function

I'm struggling to simply get Tone.js to work at all. At first I realized I needed to activate the web audio context on a button click. However, now I'm running into this issue: Tone.start is not a function. My code is the simplest, shortest possible…
Vee
  • 729
  • 10
  • 27
1
vote
1 answer

Tone.js release/stop sampler

EDIT: Update on other attempts. The key bit of the question below is the line sampler.triggerRelease(["A1"], 'now') which is not working. Other things I've tried…
Ant
  • 221
  • 1
  • 3
  • 8
1
vote
0 answers

Implement ToneJS Player with Reverb Effect

Surely a silly question but I don't know how to implement my player with the reverb effect. I've already try this : playTone(){ const player = new Tone.Player(this.songUrl); var decay = this.reverb / 100; const reverb = new…
PalmThreeStudio
  • 489
  • 8
  • 21
1
vote
0 answers

How to play an audio file into Tone.Offline buffer output

Question How do I play a local audio file inside Tone.Offline so that when it finishes and return it's promised buffer it will contain the played audio? Code Tone.Offline(({ transport }) => { const p = new Tone.Player(src, () => { …
ueeieiie
  • 1,412
  • 2
  • 15
  • 42
1
vote
1 answer

Webaudio timing performance

The file below uses ToneJS to play a steam of steady 8th notes. According to the log of the timing, those 8th notes are precisely 0.25 seconds apart. However, they don't sound even. The time intervals between the notes are distinctly irregular. Why…
drenl
  • 1,321
  • 4
  • 18
  • 32
1
vote
1 answer

How do you activate fadeOut effect using Tone.JS?

I am able to successfully play oscillating tone of type square-wave with 100hz frequency. However, the tone does not "gracefully" stop. Moreover, your speakers will make a "thud" sound when the tone stops, and the "thud" is worse when your speaker…
lucidgold
  • 4,432
  • 5
  • 31
  • 51
0
votes
0 answers

how to duplicate an audio stream in JavaScript

I have toneJS playing various audio on a website and I want to record it. If I connect the stream to a MediaRecorder it stops going to the speakers. I'm looking for a way to duplicate a stream so it can keep playing and record in the background. Any…
0
votes
0 answers

Tone.js triggerAttack for Player or Players

I am trying to play specific audio files multiple times together, and I found that the sampler has the triggerAttack() method which plays perfectly The problem with the Player class is that the start() method stopps whatever the player was already…
Ar25k
  • 11
  • 1
1
2 3