On Sat, 2010-03-06 at 21:16 -0600, Jeremiah Benham wrote:
On Fri, Mar 05, 2010 at 09:58:36AM +0000, Richard Shann wrote:
On Thu, 2010-03-04 at 15:05 -0600, Jeremiah Benham wrote:
On Mar 4, 2010, at 6:46 AM, Richard Shann
<address@hidden>
wrote:
J. would you like to look at importmidi.c with a view to
separating
out
the file open/new score/new staff stuff from the core function
that
takes an smf_track and puts the smf_events into a given staff?
I am a bit confused here. You want seperated functions. The first
loads the midi into smf structure in memory.
given a filename, yes.
So would it cause problems to store the smf data in gui->si->smf
upon loading it.
??? Are you talking about the current load from midi file?
I am not suggesting any changes in what that does. Just breaking up
the
implementation so that it uses a function xxx(smf_track_t *track)
that
puts the midi data in *track into the current staff.
If you are asking about how/where to store recorded MIDI, what I am
intending to do is to store it in an smf_track_t structure. The user
may
then decide they want it transformed into notation, whereupon I'll
call
the routine that your importmidi.c will hopefully be providing (the
user
having set the cursor to where they want the recording to be place
on a
staff). The user might want to make several recordings, and choose
between them etc - all that is possible, later.
Richard
Then would I add the events into the existing GList *midi_events in
the DenemoStaff structure or would I create a gpointer that will
later hold this track data. So it would be like readtrack() in
importmidi.c but it would store into the staffstructure like this:
DenemoStaff *curstaffstruct = (DenemoStaff *) gui->si->currentstaff-
>data;
gint track_number=0;
while (curstaffstruct){
curstaffstruct->track_midi_events = smf_get_track_by_number(gui-
>si->smf, track_number++);
curstaffstruct = curstaffstruct->next;
}
or do you want something like this:
DenemoStaff *curstaffstruct = (DenemoStaff *) gui->si->currentstaff-
>data;
gint track_number=0;
smf_event_t *event;
smf_track_t *selected_track;
while (curstaffstruct){
selected_track = smf_get_track_by_number(gui->si->smf,
track_number++);
while ((event = smf_track_get_next_event(mididata-
>selected_track)) != NULL)
curstaffstruct->midi_events = g_list_append(curstaffstruct-
>midi_events, event);
curstaffstruct = curstaffstruct->next;
}
Jeremiah