denemo-devel
[Top][All Lists]
Advanced

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

[Denemo-devel] First actual Scheme scripted menu item checked in.


From: Richard Shann
Subject: [Denemo-devel] First actual Scheme scripted menu item checked in.
Date: Fri, 05 Sep 2008 21:27:08 +0100

I've just checked in the first scheme script to git. It is under
actions/menus/ObjectMenu/InsertModeNote/Transpose/DiatonicShift/Third.
It shifts all the notes from the point where the cursor is to the end of
the staff up by a third.
I had intended to make the first script something of wider interest, but
by curious chance, I found myself needing this particular script.
It happened thus:
        I typed in a Sonata by Boismortier for two flutes - all movements - and
when we tried it out, it sound very strange. Only then did I realize
what I had taken to be a Treble clef was in fact the French clef, that
is treble clef encircling G on the bottom line. So all my notes were a
third out (that is two steps, regardless of accidentals). Hence the
script.

It raises a number of issues:
        Obviously, it could first call a dialog to get the interval instead of
having the interval built in to the script
        It is located in one of the Note menus, of which unfortunately there
are three (for Insert Mode, Edit Mode and Classic Mode), only one of
which is visible at any one time. It would be useful if it could be
found under Actions->Transposing->... as well as in the other Note
menus. This could be done (crudely) by simply copying it and editing it
appropriately, but it would be more elegant to allow multiple menu paths
in a give command entry in the file (it would still need to appear at
multiple places in the git-repository, so that people could navigate to
it thru the load a command file selector).
        It could use some general (scheme written) script to allow the
application of a scheme function (in this case d-DiatonicShift) to all
the notes from the current note/all the notes in the selection/etc. As
it is I have written the function that iterates thru the notes as a
preliminary in the script itself.
        The scheme2C glue code is all at the top of view.c, some surgery is
needed to move it to a file of its own, without filling the symbol table
with all the currently static functions, and without spreading the
scheme header files around too much.

However, the code should give a head start to anyone wanting to start
scripting. The scheme script itself is in the command file between
<scheme></scheme>m and the functions it is referring to are (as I
mentioned) defined and installed into scheme at the start of view.c

I haven't tried building & installing to see if the command does end up
in
/usr/local/share/denemo/actions/menus/ObjectMenu/InsertModeNote/Transposition/DiatonicShift/Third
but that is the intention!

Richard






reply via email to

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