denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] importMidi timesigs


From: Richard Shann
Subject: Re: [Denemo-devel] importMidi timesigs
Date: Tue, 07 Jul 2009 12:24:04 +0100

On Wed, 2009-07-01 at 14:16 -0500, Jeremiah Benham wrote:
> At this time importMidi does not insert timesig changes. It only sets the 
> initial timesig. I would like to change this. My confusion lies in the api or 
> lack of api. In importMidi I have been setting the timesig with this code 
> here:
> 
>  DenemoStaff *curstaffstruct = (DenemoStaff *) 
> mididata->gui->si->currentstaff->data;
> 
>   curstaffstruct->timesig.time1 = numerator;
>   curstaffstruct->timesig.time2 = denominator;
> 
>   mididata->barlength = mididata->smf->ppqn * 4 * numerator / denominator;
> 
> 
> I have looked around in timedialog.c and I see several functions related. 
> They are:
> dnm_setinitialtimesig
> timesig_change_insert
> timesig_change_initial
> timesig_change
> 
> This is ignoring the ones that are marked static. 
> 
> My question is which function do I use to set the timesig and how can I tell 
> if the initial timesig has been set
there is always an initial timesig in Denemo - rather unfortunate
really, as it makes initial timesig a special case in the code.
>  so that I can insert (instead of set initial)? I am not sure what would 
> happen if the midi is polymetric. 
> 
> I was also wondering if it would be eaiser to do this all via guile as a 
> script because of the work that has been done denemo kind of has an api in 
> scheme.
Rather than go there, look at what the command calls (i.e. go from the
label on the menu item to the function as listed in generate_source.c)
and either call that function, or if it is conspicuously a wrapper, call
the thing it calls.
Richard

>  I was wondering how to go about keeping the  smf_t *smf  and smf_track_t 
> *selected_track; in memory while I list out events. Something like this 
> smf_track_get_event_by_number(selected_track, event_number). I would also 
> have a function to go to the next track. I would need anouther to free the 
> memory smf_track_t and smf_t. So 4 functions total 1) load file 2) select 
> track 3) select event 4) free memory. In order to keep the memory open would 
> I have to place it in Denemo.gui.si someplace? 
> 
> Jeremiah  
> 
> 
> _______________________________________________
> 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]