tonejs.github.io | style comments in the source code

 by   Tonejs HTML Version: Current License: No License

kandi X-RAY | tonejs.github.io Summary

kandi X-RAY | tonejs.github.io Summary

tonejs.github.io is a HTML library. tonejs.github.io has no bugs, it has no vulnerabilities and it has low support. You can download it from GitHub.

Docs are autogenerated from jsdoc-style comments in the source code, examples are copied from the main repository. To fix any typos or errors, please submit a pull request to the Tone.js repo. PRs for demos are also accepted. Add a 300x300px thumbnail to assets/images and add a reference to your image as well as the title and link to your project to the demos.yaml file.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              tonejs.github.io has a low active ecosystem.
              It has 62 star(s) with 27 fork(s). There are 3 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 3 open issues and 13 have been closed. On average issues are closed in 100 days. There are 10 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of tonejs.github.io is current.

            kandi-Quality Quality

              tonejs.github.io has no bugs reported.

            kandi-Security Security

              tonejs.github.io has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.

            kandi-License License

              tonejs.github.io does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              tonejs.github.io releases are not available. You will need to build from source code and install.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of tonejs.github.io
            Get all kandi verified functions for this library.

            tonejs.github.io Key Features

            No Key Features are available at this moment for tonejs.github.io.

            tonejs.github.io Examples and Code Snippets

            No Code Snippets are available at this moment for tonejs.github.io.

            Community Discussions

            QUESTION

            Tone.PitchShift and Howler.js issues
            Asked 2022-Feb-17 at 12:31

            I enjoy using Howler.js for my (Meteor) application. However, the playback rate function is causing a pitch shift that I don't want (I just want the time stretch, and to preserve the pitch). My solution was to therefore implement a pitch shift to it to 'correct' the pitch. Seemed simple enough, which is why I chose to use https://tonejs.github.io/

            Only problem is, I cannot for the life of me get it to work correctly. After hours of reading up on Web Audio API, and Tone.js documentation, and online discussion/troubleshoot forums, the closest to a potential solution I got was something like so (called during render of my application, just in case the issue had to do with loading prematurely):

            ...

            ANSWER

            Answered 2021-Oct-18 at 19:59

            I think you don't need the 3rd line in your snippet. Since your first line is telling Tone.js to use the AudioContext created by howler.js already. Therefore pShift.context should be equal to Howler.ctx. But it might make sense to double check.

            Source https://stackoverflow.com/questions/69621611

            QUESTION

            Tone.js release/stop sampler
            Asked 2022-Feb-08 at 21:56

            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 include:

            • sampler.releaseAll(Tone.now())
            • sampler.releaseAll()
            • sampler.triggerRelease(["A1"], Tone.now())

            The relevant part of the Tone.js docs is here.

            What won't work is sampler.dispose(), because it essentially disconnects the sampler instrument from the output. But I need to continue using the sampler to retrigger the same note shortly after turning it off.

            I'm trying to use a button press to stop the playing of a 'Sampler' note while it's currently playing. I thought that triggering the release phase would do this (as in my code below) but this doesn't seem to have any effect. I've tried lots of methods. This question doesn't answer mine, partly because it's for the 'Polysynth' not the 'Sampler'. Thanks in advance!

            ...

            ANSWER

            Answered 2022-Feb-08 at 21:56

            Replacing triggerAttackRelease with just triggerAttack does work:

            Source https://stackoverflow.com/questions/71007688

            QUESTION

            Cordova and Tone.js "Error: buffer is either not set or not loaded" when i try to load an mp3 file
            Asked 2022-Jan-15 at 18:49

            maybe you can give me a hand, I've been looking for all information, in order to solve this problem of mine, but nothing, I can't use the player with cordova ...

            in practice I can't load mp3 files, whether they are both locally and remotely, I always get this error: "Error: buffer is either not set or not loaded", the files in the path are there.

            I tried using Tone's oscilloscope to see if I was having trouble loading Tone, but this works fine.

            Could it depend on some authorization, particular that I might be missing ?.

            For example using cordova media plugin I can reproduce the audio, but I need to use Tonejs.

            Do you have any ideas, what this might depend on. or what could I try to do? ...

            even this simple example, after the device ready does not go:

            ...

            ANSWER

            Answered 2022-Jan-15 at 18:49

            I posted an answer, here, which also solves this problem.

            I don't know if the solution is the only possible way, or the best, in order to access the folders locally, I made these changes to the call. Using an XMLHttpRequest object which can be used, to request data from a web server, I got a Blob object, which I then passed to the Tone player.

            Source https://stackoverflow.com/questions/70647004

            QUESTION

            Getting references error when importing tone.js
            Asked 2021-Aug-29 at 12:11

            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.

            ...

            ANSWER

            Answered 2021-Aug-29 at 12:11

            As @lars-flieger pointed out, it's not possible to run it one a node.js server. I ended up downloading Tones.js from here and includes it as a regular script tag.

            https://github.com/Tonejs/Tone.js/wiki/Installation

            Source https://stackoverflow.com/questions/68951739

            QUESTION

            Updating state without rendering the whole React component (useState)
            Asked 2021-May-18 at 16:55

            I have a component that instantiates a few classes from the Tone.js library (e.g audio players and filters) and defines a few functions acting on these objects, which are used as callbacks in a set of UI-rendered buttons (see relevant code below).

            Two of these buttons are supposed to toggle the boolean state is3D using the useState hook (in the updateSpatial function) in order to enable/disable one of these buttons. However, this update obviously causes the component to re-render entirely, thus re-instantiating my classes, which prevent the defined functions to work afterwards.

            In contrast, I also tried the useRef hook, which allows for is3D update without re-rendering, but the button's disabled state is not updated as the component does not re-render.

            Is there a pattern that fits with this situation? My next attempts include using HOC, Context, or Redux, but I'm not sure this is the most straighforward. Thanks!

            ...

            ANSWER

            Answered 2021-May-05 at 13:50

            I see two things wrong with your code. First, everything within the "normal" body of the function will be executed on on every render. Hence, the need for states and hooks. States allow you to keep data between renders, and hooks allow you to do a particular action upon a state change.

            Second, useEffect(()=>console.log(hi)) does not have any dependencies, hence it will run on every render. useEffect(()=>console.log(hi),[]) will execute only on the first render. useEffect(()=>console.log(hi),[player1]) will execute when player1 changes. useEffect(()=>console.log(hi),[player1, player2]) will execute when player1 OR player2 change.

            Be careful with hooks with dependencies. If you set the state of one of the dependencies within the hook itself, it will create an infinite loop

            Here is something closer to what you want:

            Source https://stackoverflow.com/questions/67402488

            QUESTION

            Scheduling ToneJS events while transport is playing
            Asked 2020-Nov-10 at 16:47

            I have 4 notes playing in my Tone JS app and would like to change the 3rd note to be something else whilst the transport is currently playing. Here is my code:

            JS:

            ...

            ANSWER

            Answered 2020-Nov-10 at 16:47

            This is pretty awkward to fix the way it is structured now. The trouble is that every note you add is on its own loop, which begins whenever you call scheduleRepeat ... you would have to correct for the offset between the original loop and the new one, which seems kind of tricky.

            I'd suggest that you have call scheduleRepeat only once, and have the callback read the list of notes you have stored. That way you can just replace or alter one of those notes and the next time around it'll be changed, and you won't have any timing problems. I think that would mean including the pitch in your note schema.

            Source https://stackoverflow.com/questions/64772505

            QUESTION

            Tone JS - Transport.stop(); does not work with scheduled events
            Asked 2020-Sep-22 at 19:25

            I am using Tone JS for a project and I am using Transport.scheduleOnce to schedule events with the Sampler. Here is what I have so far, also here is a fiddle of it (you may need to click run a couple times to hear the audio come through when fiddle initially loads)

            My code:

            ...

            ANSWER

            Answered 2020-Sep-22 at 19:25

            Tone.Transport is triggering your sample.
            What you want to do is either use the Tone.Player if you only want to play sounds like a "jukebox".

            If you really need a sampler, then should to look into Envelopes because the Sampler uses one.

            In short: The Tone.Transport like the maestro in a concert. Transport is only setting the time (only the BPM not the playback speed). Tone.Transport.start() will trigger all registered instruments (in your case the Sampler) to start doing whatever you programmed them to do. If you want to stop the Sampler from playing in this mode. You can do samplerBuffer.releaseAll()

            Source https://stackoverflow.com/questions/64015741

            QUESTION

            tone.js - why are there 192 ticks (ppq) in 1 second at 60 bpm?
            Asked 2020-Sep-21 at 14:22

            "Tone.js is a Web Audio framework for creating interactive music in the browser. "

            In tone's transport object, the default number of ticks (subdivisions, or ppq) is 192 when the bpm value is at 60. It is proportional to bpm, so at 120 bpm, number of ticks (subdivisions, ppq) is 384.

            Why was this number (192, or 384) chosen, instead of something like 200 (and 400 for 120 bpm)? Does it have any particular properties, that make it more suitable to be the default number of ticks for the default bpm?

            ...

            ANSWER

            Answered 2020-Sep-21 at 14:22

            PPQ (Pulses Per Quarter-node) is often in values which are divisible by both 2 and 3 which allows it to accurately represent both triplet rhythms (divisions of 3) and duplet rhythms (divisions of 2) which are pretty common rhythmic subdivisions.

            For example, with a PPQ of 6, the quarter note could be divided in three ways: by 2, 3 and 6. Those divisions would yield an 8th note (dividing the quarter in 2), a triplet 8th note (dividing by 3) and a triplet 16th note (dividing in 6 equal parts).

            The higher the PPQ number, the more divisors (and therefore the more rhythms that it can represent with whole number ticks). A PPQ of 200 or 400 would be good at representing quintuplets (divisions of 5) and duplets since it's divisible by 5 and 2 many times, but wouldn't be able to be evenly divided by 3.

            Source https://stackoverflow.com/questions/63968772

            QUESTION

            How to play a tone using an audiobuffer with Tone.Player?
            Asked 2020-Jun-05 at 16:44

            Using Tone.js I'm able to play a sound using the following code

            ...

            ANSWER

            Answered 2020-Jun-05 at 16:44

            According to the documentation

            Source https://stackoverflow.com/questions/62165718

            QUESTION

            How to change pitch AND playback rate with JavaScript / Tone.js?
            Asked 2020-May-04 at 22:41

            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 the play button there.

            Below is the closest I got so far using Tone.js. I am really struggling with the documentation but I understand that Tone.Transport.bpm.value = 60; changes the bpm from 120 to 60 and Tone.PitchShift transposes the song. I just don't see how to combine the two to 'stack' the effects.

            Here are some links I followed:

            How to change the pitch with JavaScript?

            https://tonejs.github.io/docs/r12/PitchShift

            https://tonejs.github.io/docs/13.8.25/Transport

            Thanks in advance for the help!

            ...

            ANSWER

            Answered 2020-May-04 at 22:40

            UPDATE: WORKING SOLUTION

            I found a way that works: Set the playback rate first. Then, when setting the pitch you need to calculate how much pitch shift to add/subtract to compensate for the playback rate. In my example I had to compensate +12 pitch shift for 0.5 playback rate.

            Source https://stackoverflow.com/questions/59606613

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install tonejs.github.io

            You can download it from GitHub.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/Tonejs/tonejs.github.io.git

          • CLI

            gh repo clone Tonejs/tonejs.github.io

          • sshUrl

            git@github.com:Tonejs/tonejs.github.io.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link