denemo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Denemo-devel] staff midi fields


From: Jeremiah Benham
Subject: Re: [Denemo-devel] staff midi fields
Date: Wed, 9 Dec 2009 12:18:24 -0600



Sent from my iPhone

On Dec 9, 2009, at 10:46 AM, Richard Shann <address@hidden> wrote:

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>
wrote:

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.

I don't know if this is bad or not. I can't see any problem with it.



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
staff->device_port)
that is, I guess, we have an smf_event and we lookup ((DenemoStaff*)
smf_event->track->user_pointer)->device_port, roughly.

to
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?

No. It is not used. I can see a use for program number not I strument name. I thin instrument name is really onely useful to the user who does not know what program number x refers to. It is also useful in export midi. This way when it is imported into another program it has labels for the instrument. Timidity will display instrument names (I think) as playback occurs.

Jeremiah


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
list...

Richard



Jeremiah


Richard




_______________________________________________
Denemo-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]