denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Scripting mode changes


From: Jeremiah Benham
Subject: Re: [Denemo-devel] Scripting mode changes
Date: Fri, 22 Aug 2008 14:12:43 -0500

On Fri, 2008-08-22 at 17:28 +0100, Richard Shann wrote:
> On Fri, 2008-08-22 at 10:48 -0500, Jeremiah Benham wrote:
> > On Fri, 2008-08-22 at 12:54 +0100, Richard Shann wrote:
> > > I've added the possibility of invoking change of mode from scheme. Note,
> > > we don't want to add toggling visibility of windows etc., since these
> > > don't affect the denemo data.
> > 
> > Thanks, I will need that for transposition since there is no function to
> > to do anything like change_note_n_half_steps().
> I think that reading/writing note values should be a high priority - I
> don't have the meaning of cursor_y etc at my fingertips, I have an awful
> feeling it may be that the pitch of the note depends on some prevailing
> value (ie something stored elsewhere in si, like si->currentaccs
> clef...). 

importmidi enters note values and does not use cursor_y. It sets
cursor_x = 0 when a new staff is created. This is to ensure that the
notes are placed at the beginning of the staff. Importmidi adds notes to
the staff using the function dnm_addtone(). It does use 
 mididata->gui->si->cursorclef as an argument. This function also
requires that  

DenemoObject *mudela_obj_new = new_dnm_object
(length,mididata->leftover);

because dnm_addtone requires that a DenemoObject be created and defined
and added as an argument.

If there is no function already I propose we write a function that wraps
up the following:

enternote_function(gint *pitch, duration)
{
/* check to see if duration goes over the measure */
gboolean leftover = (duration > current_space_left_in_measure) ? 1:0;  

/* creates a DenemoObject */
DenemoObject *mudela_obj_new = new_dnm_object (duration,leftover);

/* get notes middle_c_offset and its 
 * enharmonic shift (accidental) based on key 
 * This function is defined in importmidi.c /

struct harmonic enote = enharmonic (pitch, key);

/* add tones to current object */
dnm_addtone (mudela_obj_new, enote.pitch, enote.enshift,
mididata->gui->si->cursorclef);

/* adds object to score */
object_insert (mididata->gui, mudela_obj_new);

}

After the script has run then the display will need updating. importmidi
calculates position internally by adding up duration values. So what you
are asking is a way to calculate current_space_left_in_measure? 

> But for a while I will be busy getting the scripts installable
> as menu items etc. so I would be really glad if someone (!) could get to
> grips with what values cursor_y and freinds have for a given note, in a
> given clef, keysig ... Even just putting some printfs in printing out
> the values when a note is entered so that it would be easy to study and
> maybe find what the pattern is.

Does the above answer your question? If you are wanting to insert notes
in another way I can research that later tonight.  

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]