Questions tagged [tonejs]

32 questions
0
votes
0 answers

Error: Refused to create a worker due to Content Security Policy violation - 'worker-src' fallback used. Electron React App

I want to play and control audio file in electron-react app. Currently I am using Tone Js to do so. In my FilePlayer.ts I create the player by getting the bufferData of the file from the main process. useEffect(() => { // Create and load the…
Silenx
  • 37
  • 6
0
votes
0 answers

Having trouble with unmute.js and tone.js, not able to get audio playback on mobile

Pretty new to programming, although had ChatGPT help me write a p5js script that acts as a music player where users can change stems and create unique mixes of a track. Here's the code repo I created: https://github.com/Weinbagz/Playerz-Stemz I was…
0
votes
1 answer

Using Tone.js, can I get the raw PCM data that represents the audio played through my speakers?

I need to take an array of bytes that represents an audio file (a wav files data) and make a new array of bytes that represents that same wav file, but with an increased pitch. It sounds simple but apparently is anything but. I tried doing this on…
0
votes
0 answers

Tone JS Buffer/ToneAudioBuffer not loading

I am currently trying to use Tone JS to load several local audio samples, however, when I try to use Tone.Buffers or Tone.ToneAudioBuffers the onload is never triggered. When I use an online url for an audio source, it works.. const drumSamples =…
frgoe003
  • 1
  • 1
0
votes
0 answers

How to initialize player.fadeIn with a variable using Tone.JS?

My project is playing a piece of audio using tone js and i want to use player.fadeIn to fade the audio in from the beginning. my goal is to just have a variable to control the fade duration of the player. any help on this is greatly appreciated…
0
votes
1 answer

How to select a property of an Object containing a class

Is it possible to select a property from an object containing a class like this below? //Object const voices = { fmsynth: Tone.FMSynth, amsynth: Tone.AMSynth, synth: Tone.Synth } //my function to select the above synths switch_synth(synth_id)…
KonVas
  • 267
  • 2
  • 12
0
votes
0 answers

Sync tonejs with abcjs

I'm trying to sync abcjs with ToneJS. abcjs plays a melody (via notation) and ToneJS plays a loop. I would like to sync these two audio sources. As I understand I need to create a shared AudioContext in which they both can play, but I'm not sure how…
olefrank
  • 6,452
  • 14
  • 65
  • 90
0
votes
0 answers

How to add space / rests to a Pattern with ToneJS?

I'm trying to find a way to add spaces/rests to a sequence of notes with ToneJS. I've created an example on Stackblitz. I'm currently trying to use a Tone.Pattern to loop over the notes and use triggerAttackRelease to play the note, but there seems…
thathurtabit
  • 558
  • 2
  • 11
  • 22
0
votes
0 answers

Tonejs. Create connectable object

I want to have an object that can be connected to, for example: class MyThing{ whatILookFor(time, value){ // That would be called from the connected node } } let myThing = new MyThing(); let lfo = new Tone.LFO(1, 10,…
tru7
  • 6,348
  • 5
  • 35
  • 59
0
votes
1 answer

ToneJS observe Player current time

I've been trying to figure out how to observe the player's current time but without luck. I tried the immediate(), now(), and some other time-related API from the documentation. https://tonejs.github.io/docs/14.7.77/Player.html And also I tried…
Seto
  • 1,234
  • 1
  • 17
  • 33
0
votes
1 answer

Cannot stop player if use useState React Tonejs

I'm trying to implement a start/stop button in my React project with tonejs library, but after I use a setState to change my Icon, my player.stop() functionality doesn't work. If I press the button 2 more times, a second player sounds. Here is my…
0
votes
1 answer

why external audio link doesn't work with tone.js

I am trying to play audio samples from my host with tone.js but no sound. I try this code from tone.js and it work : const player2 = new Tone.Player("https://tonejs.github.io/audio/berklee/gong_1.mp3").toDestination(); when I change the link…
0
votes
1 answer

Vue3: Object instantiation in created hook vs data field

I'm migrating a project from Vue2 to 3, and trying to understand an error that I get when creating a field on component data. Using ToneJS, I can create a new Synth() either in the body of a method, or in the created hook, and call it in my playNote…
drenl
  • 1,321
  • 4
  • 18
  • 32
0
votes
0 answers

Why I get serveral 404 File not found errors for my tone.js samples?

Why I get these 404 File not found errors for my tone.js samples when loading the page? GET http://127.0.0.1 :8000/audios/F 404 (File not found) GET http://127.0.0.1:8000/audi0s/G 404 (File not found) GET http://127.0.0.1:8000/audios/C 404 (File…
iMath
  • 2,326
  • 2
  • 43
  • 75
0
votes
1 answer

Getting references error when importing tone.js

I have a basic express.js server setup on my Mac. To this I'm trying to import Tone.js, https://tonejs.github.io, by following the instructions. npm install tone To import Tone.js: import * as Tone from 'tone' But I'm getting this error Uncaught…
arpo
  • 1,831
  • 2
  • 27
  • 48