[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] staff midi fields
Re: [Denemo-devel] staff midi fields
Wed, 09 Dec 2009 16:46:20 +0000
On Wed, 2009-12-09 at 07:49 -0600, Jeremiah Benham wrote:
> Sent from my iPhone
> On Dec 9, 2009, at 3:48 AM, Richard Shann <address@hidden>
> > I was going to upgrade the Drum Clef selection to set channel 9/10 on
> > the staff and realized that I have to sort out the built-in staff
> > prefs
> > for this.
> > My proposal is that
> > the staff->midi_instrument selection will create a staff directive
> > changing the program to 9/10 and (as a caching mechanism set the
> > staff->midi_prognum field). The staff->midi_instrument field itself
> > will
> > go as well as the staff->midi_override field.
> > A script setting the program select will also write the
> > staff->midi_prognum so that playback immediately can just look this up
> > (as it does at present) rather than having to search for a staff
> > directive,
> > The special code setting the prognum, get_midi_prognum() will go, as
> > will the get_midi_channel() - this last tries to find "drums" but as
> > that is not in the list of instruments, it never actually sets channel
> > 9/10 (AFAIK)
Well, actually you can type anything in, so you can type in drums (if
you know that this is a good thing to do) and you will get th channel
9/10 from the get_midi_channel function.
> > The instrument name is being sent as meta data. We could use the
> > prognum
> > and the array (in midi.c) to get this string and send it. But it might
> > be better to leave this to the user (i.e. a scripted decision).
> > Question: how does this tie-in with the JACK stuff???
> Jackmidi is not doing anything with program number. During midi
> playback It is getting the channel number from smf. On scripted
> playback it gets this info via the get_midi_channel function. I don't
> have the code in front of me at the moment so this may be intention
> rather than what is actually written. I am at the point that I want to
> start wiring device_number and port_number to jackmidi output. I was
> thinking of adding some integers to the smf event structure
well, we don't need to touch the libsmf code, as the developer kindly
added the user_pointer fields for us to use. I think the info you are
referring to is per-track info, and I think we have fixed on a
one-to-one relation of track==DenemoStaff
and so all we need it to set smf_track_t track->user_pointer = staff to
be able to look up the data ( I assume it is stored in
that is, I guess, we have an smf_event and we lookup ((DenemoStaff*)
> represent device_number (Jack client number) and port number. I would
> also need to modify export midi to set this data in smf event
> structure. Do you think this is the correct approach.
well, not if the above is right. You don't want anything on the
smf_event level, just the track level.
> On immediate and
> scripted playback this data can be attained from the denemo staff
> properies structure.
so I am saying that it can be obtained from the smf_track, provided the
user_pointer is set to point to the staff structure
All this is slightly to one side of what I am wanting to sort out, which
is the instrument name/channel setting thing - it is obviously a waste
of time emitting the instrument name to the internal fluidsynth as meta
data, since it will presumably use the channel/program number settings
that are emitted. Is the midi_instrument_name useful for JACK, though?
Well, perhaps I can side step the issue as follows:
Setting midi_instrument_name as "drums" will cause staff->midi_channel
to be set to 9/10 (with prognum 0) setting anything else will set the
channel number = to staff number (avoiding 9/10 as at present) and
prognum = position in the GM list that drops down. The override field
can go in that case - channel and prognum will reflect any choice made
in the instrument list - I may have to include an UNSET value in the
> > Richard
> > _______________________________________________
> > Denemo-devel mailing list
> > address@hidden
> > http://lists.gnu.org/mailman/listinfo/denemo-devel