basic-pitch-ts icon indicating copy to clipboard operation
basic-pitch-ts copied to clipboard

Pitch range units?

Open nick-thompson opened this issue 2 years ago • 2 comments

In what units are the values given in the pitchBend array on a note event?

In my experiments, I'm seeing values like 0, -1, 1, 2, 4, and 5. I see from the other basic pitch repo an issue that seems to suggest these values are semitones, but numbers like 4 and 5 make that seem odd. Further, I'm not seeing any non-integer values, meaning that if we're in semitones, the resolution of this library doesn't consider cents, which also seems odd.

Hoping for some clarification, thank you!

nick-thompson avatar Aug 07 '23 19:08 nick-thompson

Hey @nick-thompson !

We're following the General MIDI protocol for pitch bend values. The values will be between -8192 and 8191, representing a semitone range of +/- 2 semitones (i.e. you can divide the pitch bend value by 8192 to get the equivalent shift in semitones).

rabitt avatar Aug 14 '23 20:08 rabitt

I'm not understanding this. If a semitone is 4096, then a quarter tone is 2048, right? I'm seeing numbers like "3" when it is approximately a quarter tone. For instance, this particular note in my recording bent from about a quarter tone to almost in tune and the bend array contained 3,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1. And I've seen some wildly out of tune recordings and I generally don't see a number larger than 3.

paulrosen avatar Dec 07 '23 23:12 paulrosen