[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] scheme_change_chord_notes
From: |
Jeremiah Benham |
Subject: |
Re: [Denemo-devel] scheme_change_chord_notes |
Date: |
Wed, 15 Jul 2009 04:37:49 -0500 |
On Jul 14, 2009, at 10:53 AM, Richard Shann <address@hidden>
wrote:
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 wrote a function that does this. I pushed it to git. It is currently
giving the wrong octave because of a bug in name2mid_c_offset. My
guess is that on line 1309 gint octave should be -1 not -2.
scheme_change_chord_notes calls the same function and has the same
problem. I have not tested my hypothesis yet though.
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
I am not using or setting mode. I am assigning a value to cursor_y
using name2mid_c_offset.
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.
That is why I want to avoid using something like shiftcursor.
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
Why don't we remove this code and create a macro for it that does
something like:
(d-CursorToNote lilyname)
(d-Insert2)
This would not be for appendind notes to a chord though.
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.
A user could sting append (d-GetNotes) with a desired new note. This
output could be given as argument to (d-ChangeChordNotes).
I have modified (d-ChangeChordNotes) to accept string input. I will
next save directives.
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;
Sounds good. I will implement this next.
Jeremiah
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
_______________________________________________
Denemo-devel mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/denemo-devel
- [Denemo-devel] scheme_change_chord_notes, Jeremiah Benham, 2009/07/13
- Re: [Denemo-devel] scheme_change_chord_notes, Richard Shann, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes, Richard Shann, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes, Richard Shann, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes, Richard Shann, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes, Jeremiah Benham, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes, Richard Shann, 2009/07/14
- Re: [Denemo-devel] scheme_change_chord_notes,
Jeremiah Benham <=
- Re: [Denemo-devel] scheme_change_chord_notes, Jeremiah Benham, 2009/07/15
- Re: [Denemo-devel] scheme_change_chord_notes, Jeremiah Benham, 2009/07/15