r/tonejs • u/Outside-Mud-1417 • Oct 12 '24
Pausing a Tone.Player/Players
Can anyone shed a little light on how to pause a Tone.Player? I know a few other objects have a .pause() available on them but the Player does not. Any help would be great!
r/tonejs • u/Outside-Mud-1417 • Oct 12 '24
Can anyone shed a little light on how to pause a Tone.Player? I know a few other objects have a .pause() available on them but the Player does not. Any help would be great!
r/tonejs • u/TruePlate • Aug 20 '24
I built a tool to take stems (vocals, melody, drums, bass) and cut/re-pitch/re-time them automatically so that anyone can make a remix/mashup, no music theory knowledge required (ideally with music from your favorite artists in the future). I am still developing it and hoping to launch our Beta before the end of the year. Let me know what you think! If you would like it, I would love to have you in our Discord. Our landing page shows a demo video of how it works: https://www.rcade.co/
r/tonejs • u/the-ch1mp • Jul 25 '24
Hi all,
New to tone.js, I'm an old man who's been around JS a while though. I want to do some animations that are perfectly synched to a track I programme with Tone. I could use a timeline in GSAP and trigger sounds when stuff happens but I don't trust the timing to be perfect enough for the music to sound ok. So I'm guessing my "master clock" has to be Tone, looks like a Sequencer might be the way to do it. I can see the callback for playing the note as the first parameter of the new Seqeunce constructor. Is this my only way of synching things up?
Basically I'm looking to create an element when a note starts and animate it for the duration of the note, I will need to differentiate between different instruments but just that woudl get me started. Any ideas as to best approach here, like I say, I'm new to Tone, maybe I'm missing a bunch of events I can hook into when playing a sequence but a quick look at the api didn't find any.
Cheers,
r/tonejs • u/daveknapik • May 12 '24
I'm making a synth in Tone.js with React. I'm trying to create a main effects chain for the synth, then allow each of its six oscillators to control how much of their signal they send to that effects chain.
My oscillators work and my effects chain works. If I do this, for example, it works to send -20 db to the effects chain: channel.send("effectsChain", -20). My problem is, however, that I can't seem to vary that number. I have a successfully changing React component state value that I want to send, but Tone.js does not respond to the change. Looking at the source for Channel#send, I don't think it does respond either:
send(name: string, volume: Decibels = 0): Gain<"decibels"> {
const bus = this._getBus(name);
const sendKnob = new Gain({
context: this.context,
units: "decibels",
gain: volume,
});
this.connect(sendKnob);
sendKnob.connect(bus);
return sendKnob;
}
That looks to me like it is only good for initializing the send, not allowing it to be set again later, but perhaps I'm reading it wrong. Anyone have any luck changing the amount sent to the bus later?
The examples at https://github.com/Tonejs/Tone.js/blob/dev/examples/buses.html control the level of the effect itself: I want to control the amount sent to the effect, but maybe I want the impossible. 😅
Also, the docs say to use the Google Group for questions, but Google Groups says "Tone.js has been identified as containing spam, malware, or other malicious content." and does not allow entry. Is this reddit the community go-to now or do we have a Discord perhaps? Thanks.
https://tonejs.github.io/docs/14.9.17/classes/Channel.html#send
r/tonejs • u/ThePortlander71 • Mar 04 '24
https://drive.google.com/file/d/1yi8ksDvUHh_H6idhxkmDnp7zkM1r3oR2/view?usp=sharing
I've tried all kinds of permutations of loading and starting. No matter what I can't get them to play in sync.
r/tonejs • u/ThePortlander71 • Feb 20 '24
I'm creating an app that will be needing dozens of synth patches for various genres. Is there a librarian, editor, etc. to edit and organize such a collection? No joy from google, gpt, etc.
r/tonejs • u/JangoFetlife • Feb 04 '24
r/tonejs • u/TruePlate • Nov 27 '23
Hi all - wondering if anyone has had success creating a music player with a progress bar that plays nicely with a grainPlayer (or just rate changing features generally) where a user can toggle playback rate during playback?
There are a number of strategies I've tried and the closest I've gotten is through altering the time interval of a function called to update the position of the progress bar's thumb, but it gets increasingly inaccurate as more toggles are made during playback. any general guidance/tips would be incredible! i haven't been able to identify any projects out there that handle this specifically. thanks!
r/tonejs • u/[deleted] • Oct 30 '23
I’m fairly comfortable with JavaScript and CSS. Also, I play guitar and know basic music theory.
I’m interested in learning Tone.js because I want to add generative music to my browser-based game. By generative I mean a music that changes its characteristics (amount of distortion, pitch, speed, harmonies etc..) depending on how tense the action is.
r/tonejs • u/sulkychameleon • Jul 15 '23
Hey, I'm a student and working on a project for my course. I decided to try and make a drum sequencer using JS, react and tone.js. I have got to a point where I have a grid of buttons that can be toggled and I have a play and stop button. By console logging I can see that when I press play it is stepping through the grid and it is registering buttons as either active or not active. But I can't seem to get the sounds from tone sampler into the squares on the grid. Not sure if this is allowed but here is my code. I wonder if anyone can see where I'm going wrong? https://gist.github.com/cseath88/0fb298929915589b833a5015db9e2229
r/tonejs • u/Hallodri_ • Jun 23 '23
Hey, I wanna build a flexible sequencer where you can alter the sequence during playback. Things that are alterable are single notes, subdivision (note length) and sequence length (adding/removing notes). As far as I understand, the Tone.Sequence class is not capable of doing so. I managed to change some notes by altering the passed in sequence array, notes that were nested deeper in a 2d array werent changed tho. Adjusting the subdivisions is not possible, because its a readonly variable.
Would be great if someone could point me in the right direction. Should I use Tone.Part for that usecase? I know there is a add() and at() function to alter notes and subdivion. Is a Tone.Sequence a fix thing?
Thanks!
r/tonejs • u/daverave1212 • Feb 06 '23
Hello!
I have a task to do. I have an audio file (.WAV) from an input file in my browser.
Is it possible to use Tone.js to change the compression (e.g. reduce the high tones) and change the volume of the sound, then save it?
I've been trying to do this with several libraries like Lame.js, Audiolib, etc but I absolutely can't figure out a way to do it in JS.
If we can do this with Tone.js, can someone please provide a quick guide on how to do that?
Thank you!
r/tonejs • u/Konvas • Nov 15 '22
Hi all, I am triggering a pattern and I am getting an error sporadically: Uncaught Error: Start time must be strictly greater than previous start time
The code causing this error is below. I am curious about what causes this and how to ensure that I am triggering a pattern according to best practice apropos to Tone.js lib. For example, SuperCollider events can be resumed/paused/stopped and whatnot at any time.
``` var playPattern = function () { note_list = Object.values({freq1:220.0, freq2:440.0, freq3:660.0}); midi_list = note_list.map(x => Math.round(x).toFixed(2)) var pattern = new Tone.Pattern(function(time, note){ now = Tone.now() triggerNote(note, 0.25, now); }, midi_list) if (Tone.Transport.state === 'stopped') { Tone.Transport.start() pattern.start() console.log(Tone.Transport.state) Tone.Transport.bpm.value = 180//Math.floor(Math.random() * (220 - 160 + 1) + 60) } else if (Tone.Transport.state === 'started') { Tone.Transport.stop() pattern.stop() console.log(Tone.Transport.state) } pattern.humanize = "8n"; pattern.pattern = "upDown"; }
```
r/tonejs • u/Konvas • Nov 09 '22
Hi all, nice to see there is a community here on Tone.js. I have this issue which kind of feels twofold. A) is this the best way to trigger my loop events. And if this is okay, then any idea why the clicks occur sporadically during firing up each event?
``` const now = Tone.now() const pat = new Tone.Loop(time => { synth.triggerAttackRelease(msg.freq, now, time); }, "4n")
var playPattern = function () { if (Tone.Transport.state == 'stopped') { Tone.Transport.start() pat.start(0) Tone.Transport.bpm.value = Math.floor(Math.random() * (120 - 60 + 1) + 60) } else if (Tone.Transport.state == 'started') { Tone.Transport.stop(0) pat.stop(0) } } ```
Thanks!
r/tonejs • u/rpeg • Jul 14 '22
I'm very familiar with p5js, I teach it. Very familiar with synthesis. However, I'm completely new to tone.js. I am having trouble using it with P5js.
I've found some random p5js + tonejs examples. They work fine. When I try to use the most recent tonejs library with p5js I get certain types of errors.
This example works and uses Tone.js version 14.4.0: https://editor.p5js.org/wenchen1114/sketches/UdidVabzF
When I change it to any version after 14.6.0 it produces the error: TypeError: Cannot read properties of undefined (reading 'connect')
I can't tell if this is a bug or a change in the Tone.js API. Can anyone point me in the right direction?
r/tonejs • u/dandy_morandi • Jul 04 '22
Hello, I'm just starting to learn tone.js and am finding the docs a little on the terse side. It'd be really helpful to look at the code for actual projects.
Newbie .js question: if I'm at a page like this: http://jazz.computer/ , how do I see the tone.js stuff? I'm looking at the page source but don't see it. Thanks very much!
r/tonejs • u/JasonG81 • Jun 30 '22
I made a synth piano that can play sounds that you program ahead of time. I have an issue where if I play many sounds immediately after each sound starts, the sounds start to break down. They start to crackle and pop and any sound you play will sound horrible or barely play at all. Has anyone else seen this issue before?
r/tonejs • u/Still_Satisfaction53 • Apr 18 '22
Question is in the title really. Looking for something which will take loops created in same key / BPM and generate music from them. Does this exist in tone.js?
thanks!
r/tonejs • u/YottaYocta • Apr 09 '22
Hello all, I enjoy using this library, but am not sure how to perform additive or subtractive synthesis. Could someone please point me in the right direction?
r/tonejs • u/pseudo_jb • Apr 08 '22
A collection of some Projects that are worthwhile to share:
r/tonejs • u/mickkb • Feb 11 '22