back to list

Re: Bassoon piano pitch bends

🔗Robert Walker <robert_walker@rcwalker.freeserve.co.uk>

2/12/2001 11:36:01 PM

Just to say, I've found the reason for the occasional stray "partial"

If you have several notes played simultaneously, and
pitch bends applied before each one, Quicktime re-orders
the messages so that all the pitch bends come first,
and then all the notes are played.

Now suppose one of the notes is played in a channel
that has a previously applied pitch bend in it, is immediately
switched off with an all sound off, then another note is played in
the same channel with a new pitch bend, all at the same moment of time.

Then Quicktime will apply the new pitch bend to the channel,
then play both notes. It ignores the all sound offs in this
case (don't know if it always does).

Result is, both notes are given a p.b. that should be applied
to only one of them.

For instance, one of the partials was played at +43 cents instead
of -9 cents.

Situation wouldn't normally occur, but is happening because
the algorithm for finding the pitch bends needs a bit more work
for the case of the custom voices.

I should do explicit note offs before the all sound off
here, and also add a check to make sure that a note
isn't switched off at the same instant that it is switched on.

There is a bug here too, as there are only ten bassoons
playing for each note, so FTS should have been able to find enough
free channels for them all to play in, and shouldn't have
needed to use an all sound off.

I'm not sure why Quicktime is re-ordering the messages,
but may be connected with the fact that it also uses
a pitch bend range of 24 semitones, and overrides
the default pitch bend range of 2 semitones, even if
you specify it explicitly in the midi file. At the
same time, it divides all your pitch bends by 12.

The end result of this is that the pitch bends are the same, though
one loses a tiny amount of precision as you then
have a resolution of 0.3 cents instead of 0.02 cents
for the midi file pitch bend data.

All I can find about this on the web is:

http://devworld.apple.com/techpubs/quicktime/qtdevdocs/REF/tp_qtma_qtmaref.a.htm
"
Pitch bend is specified in fractional semitones, which eliminates the restrictions of a
pitch bend range. You can bend as far as you want, any time you want.
"
I can't quite figure out why they have settled on a pitch bend range of +-24 semitones -
why that particular figure.

Anyway, I'll fix it in the FTS beta.

Robert

🔗Graham Breed <graham@microtonal.co.uk>

2/13/2001 3:30:18 PM

On Tue, 13 Feb 2001, Robert Walker wrote:

> I'm not sure why Quicktime is re-ordering the messages,
> but may be connected with the fact that it also uses
> a pitch bend range of 24 semitones, and overrides
> the default pitch bend range of 2 semitones, even if
> you specify it explicitly in the midi file. At the
> same time, it divides all your pitch bends by 12.

The instructions for setting pitch bend range do depend on the order the
messages get sent. So that could be implicated.

But what does this mean? Are pitch bends 24 semitones or 2?

> The end result of this is that the pitch bends are the same, though
> one loses a tiny amount of precision as you then
> have a resolution of 0.3 cents instead of 0.02 cents
> for the midi file pitch bend data.

I thought the files I heard played through QuickTime were okay.

Graham

"I toss therefore I am" -- Sartre

🔗Robert Walker <robert_walker@rcwalker.freeserve.co.uk>

2/13/2001 6:44:52 PM

Hi Graham,

Quicktime plays the pitch bends fine for a normal MIDI clip.

What it does is to reset the pitch bend range to +-24 semitones.

This in fact stays in effect after Quicktime exits, (it doesn't reset
it to 2 semitones when finished) and you will hear
the pitch bends are far too large, if you then play a normal
midi clip on, say, media player, without resetting the pitch
bend range.

Of course, this won't be a problem if you use the default
Quicktime synth.

If you add pitch bend _range_ data to the midi clip, Quicktime
passes that on unchanged (and with the messages in the correct
sequence).

However, it then resets the pitch bend range to +-24 semitones
later, before it plays any notes. So there is no way to get
round that that I can see.

These messages
:00 b0 65 00 ;channel 1 controller - fine rpn 0 (pitch bend sensitivity)
:00 b0 64 00 ;channel 1 controller - coarse registered parameter number 0
: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 - fine rpn 127 (Null the active parameter numbre)
:00 b0 64 7f ;channel 1 controller - coarse registered parameter number 127
from my MIDI file,

are followed by
:00 b0 06 18 ;channel 1 controller Data Entry - coarse pitch bend range 24 semitones
:00 b0 65 00 ;channel 1 controller - fine rpn 0 (pitch bend sensitivity)
:00 b0 06 18 ;channel 1 controller Data Entry - coarse pitch bend range 24 semitones
:00 b0 26 00 ;channel 1 controller Data Entry - fine pitch bend range 0 cents
:00 b0 64 7f ;channel 1 controller - coarse registered parameter number 127
:00 b0 65 7f ;channel 1 controller - fine rpn 127 (Null the active parameter numbre)

which are inserted by Quicktime - none of this is in the MIDI file.

To compensate, Quicktime _rewrites_ all your pitch bend
messages.

Each pitch bend you specify in the MIDI file is divided by
12 in its effect before it is sent out. So for example, something like

:00 e0 32 35 ;ch. 1 pitch bend 6834 (-33.1543 cents)
will be sent on as
:00 e0 0f 3f ;ch. 1 pitch bend 8079 (-33.1055 cents)

Here 6834 =8192-1358 (8192 is the pitch bend zero pos.)
Dividing by 12: 1358/12 = 113.16666..

So the new pitch bend is 8192-113 = 8079.

Pitch bend range is now +-24 semitones, so
8079 = 8192-113 is a pitch bend of -113*24/8192 semitones,
i.e.-33.1055 cents.

Here one has lost only 0.05 cents of precision, but sometimes you
lose more, up to 0.3 cents.

:00 ed 39 36 ;ch. 14 pitch bend 6969 (-29.8584 cents)
->
:00 ed 1b 3f ;ch. 14 pitch bend 8091 (-29.5898 cents)

End result : actual pitch bend is about the same, with slight
loss of precision (only 0.3 cents, not enough to worry about!).

As well as doing this, it re-orders the pitch bends,
placing them before all the note ons.

But on further reflection, that isn't the real reason for the
stray partials, though it caused some puzzlement in debugging
it.

The real reason is just that it leaves out the all sound off messages
in the MIDI file altogether, and lets the preceding note continue to sound.

(if I had also had a note off at that point, it would have
switched it off, I'm sure)..

By removing the all sound off, I was able to duplicate the
effect in FTS.

Have also now fixed it.

This clip should now play fine in Quicktime:

Here is a bassoon piano:
http://homepage.ntlworld.com/robertwalker/fts/bassoon_piano.mid

At some later stage (probably FTS 1.10) I will add decaying partials,
following the decay of partials data from the bell analysis program.
It should then sound more like a real piano.

Robert