denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] A Good Idea


From: Jeremiah Benham
Subject: Re: [Denemo-devel] A Good Idea
Date: Tue, 9 Mar 2010 14:56:46 -0600



On Mar 7, 2010, at 11:04 AM, Richard Shann <address@hidden> wrote:

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.

In it's old state this was not really possible. I in the process of rewriting a great deal of importmidi. Many functions were performing very crude hacks for things that in my opinion are not the resposibility of an importer. The issues I need fixed are these. If I call out to guile in c this procedure:
(d-Insert2)
More than 5 times it does not automatically create a new measure for the 5 quarter note. It does it fine in guile in the script window. I don't know why this does not work in c (even when it calls out to guile). So there is a nasty workaround that counts up the position in the bar in which it is so that it knows when to create a new measure. I don't think this should be the importers reponsibility. All of import midi requires this crude hack. There is another crude hack I mentioned a while back. This calculates how much time is left in the bar and then if the note is to large to fit it breaks the note up into two notes that are tied together across the bar. This is also required for importmidi to function. If it is preventing the measures from being over filled. I think this dies nit belong in importmidi but somewhere else where it can be a part if denemo functionality so that if a user enters in 4/4 3 quarters and then a half note the half mote vets split into two quarters that are tied across measures. If I can I would like to have this hacks removed from importmidi. If you think they do belong in the importer it will require alot more work to implement what you want to do.

Jeremiah


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






reply via email to

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