denemo-devel
[Top][All Lists]
Advanced

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

Re: Emailing: NewTemplateNov8.scm


From: Richard Shann
Subject: Re: Emailing: NewTemplateNov8.scm
Date: Thu, 07 Nov 2019 10:03:28 +0000

On Wed, 2019-11-06 at 20:17 +0000, Joe Wilkinson wrote:
> Hi Richard,
> 
> let me know if I am becoming a nuisance
On the contrary, your questions illuminate how to present the program
so it is useful.
> 
> The attached script does most of what I want except...
> 
> 1 (d-InitialKey) is not necessarily carried out first,
> so it is possible 
> to add the staffs and then change the initial key, which misses the
> point.
> 
> 2 your code, commented out, doesn't actually work, though is actioned
> first.

Well, of course, it does work, I checked it before posting it. I'm
guessing your (d-InitialKey)  wiped out its effect - even though the
line comes earlier in the script - it is hopeless to invoke interactive
routines like (d-InitialKey) in a script, instead pass in the key
desired.

Incidentally, you could replace (d-InitialKey) with (d-New) and it will
wipe out the Scheme script for the new score you are creating, without
otherwise affecting the execution of the script. But this highlights
the fact that you don't really want to be using a template, just use a
script to create the "template" you need rather than loading something
from disk.

> 
> 3 (d-InitialTimeSig) does seem to work second

again, you must pass in the time signature you want, e.g. 
(d-InitialTimeSig "6/8")
> 
> 4 I am sure there are many unnecessary lines in the remainder of the
> code!
> 
> 5 If I execute the code from the scheme window and then try to save
> it 
> does give me the option of Normal or Advanced save. How can I trip
> this 
> more reliably?

You get that whenever you are saving a score that is not one that was
loaded as a score-with-scheme-script. It's just to prevent people
accidentally creating such a thing.

> 
> testAddStaffs.denemo is a score with the 3 staffs set up ready to be 
> mirrored.

So, instead of writing these into a score and saving it, create the 3
staffs at the start of your script, and go on to do all the mirroring.

Now for the important bit:
Your script ran in to trouble using d-AddMirrorVoice as it needs to
know which staff to mirror.
Until today d-AddMirrorVoice was only available as an interactive
procedure, so I've upgraded it so that you can pass the staff number
you want to mirror.

One wrinkle: (d-AddMirrorStaff) still does *not* take a parameter -
work around this by using d-AddMirrorVoice and d-SetCurrentVoiceAsStaff 
to create a mirrored staff non-interactively.

So, in summary: modify you Scheme script to create the initial staffs
that you have in your template and to add the mirror staffs/voices,
getting any variable things like key and timesig from the user with d-
GetUserInput and then put this script somewhere handy for use whenever
you would otherwise load your template file.
There may be more wrinkles on the way, but your script looks like you
have most of your ducks in a row.

Richard




reply via email to

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