Tonejs / Midi

Convert MIDI into Tone.js-friendly JSON
http://tonejs.github.io/Midi/
MIT License
870 stars 116 forks source link

Microtones #180

Open Guseyn opened 1 year ago

Guseyn commented 1 year ago

As far as I know MIDI does not support microtones by default, but are there any examples on how I can achieve microtones by using PitchBend let's say?

sytzez commented 1 year ago

Hi Guseyn, I've achieved microtonality with this library using the following formula:

const MAXIMUM_BEND_VALUE = 8192
const MAXIMUM_BEND_IN_CENTS = 200

const deltaCents = /* The amount of cents you want the track to be offset */

const pitchBend = (deltaCents * MAXIMUM_BEND_VALUE) / MAXIMUM_BEND_IN_CENTS