| Mike Berry wrote:
>
> Does anyone have documentation on the "hidden" MIDI functions?
> After poking around in the MIDI parser I found that there are some
> functions to set global values, like pitch bend range, using a combination
> of controller 101 and controller 6. But there is very little in the way
> of comments as to how this is meant to be used.
These are General Midi command sequences to set these parameters...
unfortunately I don't have a documentation, but on some MIDI files
they are present ...
> I want to update the MIDI interpreters to include some optional
> scaling and preset values, for, among other things, setting the pitch bend
> range in the ***midib functions.
> For the sake of cleanliness and speed, I
> was going to remove these hidden functions and update the documentation on
> MIDI. This shouldn't break anyone's orchestras since this aren't instr
> functions anyway. But if there is anyone who does use these hidden
> functions, please let me know.
I hope I'm still in time... Mike, please leave that code there!! I'm using
that ... very often :)
I would also suggest some improvements to the MIDI controllers code...
In MIDIRECV.C:
if (n == 121) {
register short *sp = chn->ctl_byt;
register float *fp = chn->ctl_val;
register short nn = 120;
do {
*sp++ = 0; /* reset all controllers to 0 */
*fp++ = 0.;
} while (--nn); /* exceptions: */
chn->ctl_byt[8] = 64; /* BALANCE */
chn->ctl_val[8] = 64.;
chn->ctl_byt[10] = 64; /* PAN */
chn->ctl_val[10] = 64.;
Add the following lines too:
chn->ctl_byt[7] = 100; /* VOLUME */
chn->ctl_val[7] = 100;
chn->ctl_byt[11] = 100; /* EXPRESSION */
chn->ctl_val[11] = 100;
Otherwise, the volume and expression controllers are not initialized to
the correct values (as in GM specifications) and this would bring to strange
results (VOLUME initialized to zero means... you won't hear anything until
you send an explicit controller 7 [volume])
and on the line which reads...
chn->pbensens = 1.0;
(just after the label "alcon")
I would suggest:
chn->pbensens = 2.0;
... since (if I remember correctly) the range of the GM pitch bend is
usually initialized to 2 semitones.
Warning: I based these changes on version 3.42 (15 aug 1996), I don't know
if in the meantime something changed...
I would also suggest to automatically assign a predefined instrument number
to the channel 10 (the DRUM channel). Example: if Csound always assigns instr
128 to chn 10, we will be always sure that we can make a drum instrument with
number 128... without need of modifying the MIDI file to do an explicit program
change to our drum instrument on channel 10...
These are only humble ideas :) Please don't flame me if they are stupid :)
Bye :)
|