denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] scheme_change_chord_notes


From: Richard Shann
Subject: Re: [Denemo-devel] scheme_change_chord_notes
Date: Tue, 14 Jul 2009 16:53:55 +0100

On Tue, 2009-07-14 at 09:37 -0500, Jeremiah Benham wrote:
> On Tue, Jul 14, 2009 at 01:06:25PM +0100, Richard Shann wrote:
> > On Tue, 2009-07-14 at 13:02 +0100, Richard Shann wrote:
> > > (We really *should* have a goto-note-position command for the cursor
> > > if
> > > we don't already).
> > In fact it is madness not to, that is what happens when you click with
> > the mouse, more or less (there is also the enshift). So the
> > functionality must be there, we just need to wire a scheme_xxx function
> > to it.
> 
> Ok. I will write that and remove my latest function from view.c. Would 
> enshift receive an int argument? +1 adds sharp and -2 double flat?
Sorry I was getting it muddled, there is no enshift, only an octave spec
needed. The cursor is in the same place regardless of whether the note
is sharp or flat etc.
What I have in mind is

(d-CursorToNote "f,,")

would move the cursor to the note position on the staff that is f,,
and so on for other possible cursor y positions. I guess we should allow
(but ignore) accidentals, so that

(d-CursorToNote "ees'")

does exactly the same thing as

(d-CursorToNote "e'")

I have looked thru the code now and I am fairly sure this function has
not already been written. It looks like the following function (from
pitchentry.c) is the nearest thing to the desired functionality

static void enter_note_in_score (DenemoGUI *gui, notepitch * found, gint
octave) {
  gui->si->cursor_y = gui->si->staffletter_y = found->spec.step;
  gui->si->cursor_y += 7*octave;
  shiftcursor(gui, found->spec.step);
  setenshift(gui->si, found->spec.alteration);
  displayhelper (gui);
}

from this I would guess that you need

gui->si->cursor_y = gui->si->staffletter_y =  the step of the scale
gui->si->cursor_y += 7*octave;
gui->mode=CLASSIC_MODE
 shiftcursor(gui, the step of the scale);
gui->mode=the mode on entry


roughly speaking that is. The point being that shiftcursor, despite its
name is mode sensitive, in the original demo, pre-modes, it did just
shift the cursor, but only relative to its current position, and so you
have to set the octave first. It is crying out for a tidy up of
course...

I've just done some checking on the (d-PutNoteName ...) and I find there
is a problem. If you track it through it ends up at modify_note() in
chordops.c which states that you cannot use it on multi-note chords.
I think you could do

(d-CursorToNote notename)
(d-RemoveNoteFromChord)
(d-CursorToNote newnotename)
(d-AddNoteToChord)

for each notename in (d-GetNotes), with newnotename stepping thru the
replacement notes.

This would lose fingerings etc attached to notes. It would be possible
to write the remove-then-add part of this as a single C-function, then
you could detach the directives attached to the note before deleting it,
and re-attach them to the new note after creating it, viz

GList *g = note->directives;
note->directives = NULL;
delete_note_from_chord(note);
add_note_to_chord(newnote);
newnote->directives = g;

where I have just invented names for the add/removing of notes from a
chord but I hope the meaning is obvious.

Richard

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