denemo-devel
[Top][All Lists]
Advanced

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

[Denemo-devel] importMidi timesigs


From: Jeremiah Benham
Subject: [Denemo-devel] importMidi timesigs
Date: Wed, 1 Jul 2009 14:16:48 -0500
User-agent: Mutt/1.5.18 (2008-05-17)

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




reply via email to

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