back to list

Changing the pitch bend range

🔗Robert Walker <robertwalker@ntlworld.com>

3/14/2002 2:21:52 PM

Hi there,

I've noticed a couple of posts asking how to set the pitch bend
range.

Maybe this should be a faq thing?

Pitch bend range is set using fine and coarse rpns
and coarse and fine data entry - requires four midi messages
or six if one nulls the active parameter
for both the rpns when one is finished with them,
as is considered good practice.

Web site to read about it:
http://www.borg.com/~jglatt/tech/midispec/rpn.htm

Here is what it looks like in a midi file.

:00 b0 65 00 ;channel 1 controller - coarse rpn 0 (pitch bend sensitivity)
:00 b0 64 00 ;channel 1 controller - fine rpn 0 (pitch bend sensitivity)
:00 b0 06 02 ;channel 1 controller Data Entry - coarse pitch bend range 2 semitones
:00 b0 26 00 ;channel 1 controller Data Entry - fine pitch bend range 0 cents
:00 b0 65 7f ;channel 1 controller - coarse rpn 127 (Null the active parameter numbre)
:00 b0 64 7f ;channel 1 controller - fine rpn 127 (Null the active parameter numbre)

It is hex value b for controller, the 0 is channel 1,
the 65, 64, 06, and 26 are the controller values in hex
(i.e. hexadecimal, which means, to number base 16)
here, coarse and fine rpn, then coarse and fine data entry.
The 00 at the beginning of each line is the delta time - the time
step from the previous midi event.

If one can only use 128 values for the
pitch bend (0 to 127), the best one can manage is to set the
pitch bend range to +- half a semitone,
which gives you +-64 values for the pitch bends,
for 50 cents, so you could manage a precision of
a little under a cent.

You set it to 50 cents using the second parameter
- same as above, with

:00 b0 06 00 ;channel 1 controller Data Entry - coarse pitch bend range 0 semitones
:00 b0 26 32 ;channel 1 controller Data Entry - fine pitch bend range 50 cents

A note on nulling the active parameter:

This is mainly a concern for midi programmers.

Nulling the active parameter means that any
stray data entry values after that in the file will
be ignored, should they happen to be sent for some reason

Example of what can happen if you don't null the active
parameter - perhaps user is noodling sending midi messages
from the keyboard and sends a stray data entry message.
This will change the pitch bend range.

If a midi device gets disconnected and reconnected, that
also may cause stray data entry events and change the pitch bend range.

So one should always do it when one sets the pitch bend range
for midi relaying or retuning a midi keyboard - FTS
always does. It is rare indeed to save the null active parameter
events to a midi file - in practice hardly any programs do
- but why not; it is only two extra midi events, ok, they
add eight bytes per channel to the length of the midi file
(total of 128 bytes), but no-one is going to mind about
that nowadays :-).

Robert