MusidDeviceStartNote
MusidDeviceStartNote
- Subject: MusidDeviceStartNote
- From: Bill Stewart <email@hidden>
- Date: Thu, 17 Jul 2003 12:54:09 -0700
On Thursday, July 17, 2003, at 04:11 AM, Angus F. Hewlett wrote:
>
At 11:06 PM 7/16/2003 +0100, Richard Dobson wrote:
>
> One interesting use of a multi-timbral synth is as a guitar
>
> synthesizer.
>
In many
>
> such systems, each string is synthesized on a different MIDI Channel,
>
> in
>
order
>
> that string-bending can be made independent for each string (many
>
> controls
>
in
>
> MIDI are channel-wide, most significantly pitchbend).
>
>
That strikes me as something of a hack... I know it's how it is
>
commonly
>
done today, but the best way of accomplishing what you want there is
>
for
>
the API to support note-level parameters rather than sending the notes
>
on
>
different MIDI channels.
This is already supported with the MD API (but not specified) -
MusicDeviceStartNote can take an arbitrary list of arguments to apply
for that note... We haven't implemented this ourselves yet, but I think
it has great potential: You'd start the note like this:
instID :)
Then your extended note params are:
noteNum -> this is a float32
Velocity -> this is a float32
controllerID (or paramID) -> UInt32
value -> float32
I'd actually like to standardise our usage of the ArgParams to
StartNote to use this scheme... So currently the struct is defined as:
struct MusicDeviceNoteParams
{
UInt32 argCount;
Float32 args[kVariableLengthArray];
};
Where we always expects currently that the argCount is 2. (with the
first being (a potentially fractional) "midi note number", the second
being "velocity")...
So - if the arg count > 2, then we'd expect the args to be paired -
which I can express with a struct:
struct MusicEventControlValue {
UInt32 mID;
Float32 mValue;
};
#endif
struct ExtendedNoteParams {
UInt32 argCount; //this is the total number of 4byte values
contained in this list
Float32 mNoteNum;
Float32 mVelocity;
MusicEventControlValue mControls[kVariableLengthArray]; //arbitrary
lengh
};
I would leave the mID as an UInt32, as this could either be a MIDI
controller number or a paramterID...
The affect of this call is to start a given note with the custom values
for the specified parameterIDs... As with any call to a group/channel
based control, the note would then change to the value of the control
...
For eg> Lets say you started this note on Group/MIDI Channel == 0, but
specified a pitch bend of -4096 (a semitone down in normal pitch bend
range)... There are other notes playing on this group==0, and they are
playing with the current pitch bend of the channel...
Then you go and set the pitch bend of the channel to +8191 (2 semitones
up) - this then goes and sets ALL of the notes on that group (including
the one you started differently) with this new pitch bend value... So,
this semantic provides a way to set the initial conditions of a note,
independently of the current state of the note's group (or MIDI
Channel)...
I don't know of any host that could do this yet (but potentially a good
custom UI could allow the user to specify this), but this I think is
both within the API semantic of these calls, and I also believe makes
an otherwise arbitrary (and almost unusable) structure usable...
Using the mNoteNum/velocity semantic, you can always provide a more
natural interpretation of the values of these fields - we currently
interpret these as 0<128 ranged (as per MIDI), and I think that is
useful to continue to support... You could of course provide alternate
parameters (lets say you wanted so specify notes in "absolute cents",
then if that arg is presented, that could overide the mNoteNum
specification... (I think that is better than reinterpretting what the
mNoteNum field means... Then, its also easy to do (as MIDI does today)
to describe a standard matching of pitch to midi note num
Bill
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________
__
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________
__
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.