On Mon, 2021-02-08 at 19:08 +0000, Joe Wilkinson wrote:
> Thanks,
> [...]
> Another query
> In the scheme shift below there are terms like
> SingleAndSelectionSwitcher and ShiftProto ANS::CalculateRealOctaveUp
> Are any of these documented anywhere? The standard docs cover items
> like
> (d-CursorRight) but I can't find any documentation of what look like
> higher-level comamnds/procedures.
> Thanks
> Joe
>
> ;in reality this is not shift but transpose. But there are too many
> functions with the name transpose already...
> (SingleAndSelectionSwitcher (lambda ()
> (ShiftProto ANS::CalculateRealOctaveUp)))
There is a certain amount of documentation in with the definitions, you
can look in your extracted zip file at the files in
.../share/denemo/actions/denemo-modules/
and there you will see things like ans.scm containing things like:
-----------------------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;Abstract Note System for Denemo Version 3;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;by Nils Gey;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ANS makes it easy to calculate with notation while keeping in mind that
; there are basic note ("The White Keys") as well as sharp or flat notes
; and finally enharmonic notes (gisis) and all have to respect the key-
; signature or they are considered "alterated".
; Each note is represented by a number on which points to an
; absolute notename in Lilypond syntax This is especially desinged to
; make diatonic shifting, real transpostion and other modifications more
; easy for script-authors.
; System by Nils Gey 2010 (thanks to Till Hartmann for table generation)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;Beginning of Abstract Note System Version 3;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;by Nils Gey;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;0 - A tone humans cannot hear anymore.
;1420 - "Middle" c'
;2130 - Soprano-Singers high C
;3150 - Goes beyond the range of a modern piano
;+inf.0 - A rest
;<10 is reserved for microtones, in the future.
;+10 One accidental up jumps over to the next note after cisis
;+50 One diatonic step, preserve accidentals
;+350 One Octave
-----------------------------------------------------------------------
and, in .../share/denemo/actions/denemo-modules/selection.scm I find
-----------------------------------------------------------------------
;SingleAndSelectionSwitcher by Nils Gey Jan/2010
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Automatically applies a script to a whole selection. You can give different
commands or command blocks with (begin) for single items or whole selections.
You can enter a complete scheme script with (), arguments and everything you
would want to run standalone. Don't forget to escape chars like \" . You can
even use a complete (begin ) block.
;But attention! SingleAndSelectionSwitcher will still try to apply the given
script to each of the single items alone. If you need a script which differs
completly in beaviour for single/selection you have to write your own. You have
to take out the (let loop () section for this and write your own selection part
there.
;The applied script itself has to take care if the command can be applied to
each potential item. If you want only notes/chords/rests you have to make sure
the script does not abort on other objects. Its the same as giving proper
return values for a single item, just return #f if a command is not possible
for an item. While a single item just returns an error if you don't do it
correctly, but does no harm otherwise, a script applied to a selection will
stop on that item and leaves you on half on the way.
;Return values are the return values the script itself gives.
;The third, optional, parameter can prevent an object from be processed. By
default this parameter is #t so the command will be will be applied to any
object in the selection and let the command itself decide what to do (or just
do nothing). By giving the third optional argument you can specify additional
conditions, for example with GetType. In general: Insert test conditions here,
if #t the current object will be processed, otherwise it will be skipped.
;Example: (SingleAndSelectionSwitcher d-AddDot d-ToggleStaccato) ; this is
nonsense, but valid. It will add a dot for single notes or toggle staccato for
the whole selection.
-----------------------------------------------------------------------
HTH
Richard