github Tonejs/Tone.js r4
ES5-ing

latest releases: 14.7.39, 13.8.25, 13.8.24...
9 years ago
  • toFrequency accepts notes by name (i.e. "C4")
  • Envelope no longer accepts exponential scaling, only Tone.ScaledEnvelope
  • Buffer progress and load events which tracks the progress of all downloads
  • Buffer only accepts a single url
  • Sampler accepts multiple samples as an object.
  • setPitch in sampler -> setNote
  • Deprecated MultiSampler - use Sampler with PolySynth instead
  • Added cdn - please don't use for production code
  • Renamed DryWet to CrossFade
  • Functions return this to allow for chaining. i.e. player.toMaster().start(2).
  • Added units to Signal class which allows signals to be set in terms of Tone.Time, Tone.Frequency, Numbers, or Decibels.
  • Replaced set/get method with ES5 dot notation. i.e. player.setVolume(-10) is now player.volume.value = -10.
    To ramp the volume use either player.volume.linearRampToValueNow(-10, "4n"), or the new rampTo method which automaically selects the ramp (linear|exponential) based on the type of data.
  • set/get methods for all components
  • syncSignal and unsyncSignal moved from Signal to Transport
  • Add/Multiply/Subtract/Min/Max/GreaterThan/LessThan all extend Tone.Signal which allows them to be scheduled and automated just like Tone.Signal.
  • Deprecated Tone.Divide and Tone.Inverse. They were more complicated than they were useful.

BREAKING CHANGES:

The API has been changed consistently to use .attribute for getting and setting instead of getAttribute and setAttribute methods. The reasoning for this is twofold: firstly, Tone.Signal attributes were previously limited in their scheduling capabilities when set through a setter function. For exactly, it was not possible to do a setValueAtTime on the bpm of the Transport. Secondly, the new EcmaScript 5 getter/setter approach resembles the Web Audio API much more closely, which will make intermixing the two APIs even easier.

If you're using Sublime Text, one way to transition from the old API to the new one is with a regex find/replace:
find Tone.Transport.setBpm\((\d+)\) and replace it with Tone.Transport.bpm.value = $1.

Or if setBpm was being invoked with a rampTime:
find Tone.Transport.setBpm\((\d+)\, (\d+)\) and replace it with Tone.Transport.bpm.rampTo($1, $2).

Don't miss a new Tone.js release

NewReleases is sending notifications on new releases.