denemo-devel
[Top][All Lists]
Advanced

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

Re: Transposer2.zip. Issues with windows from Scheme, & Mirrored music


From: Richard Shann
Subject: Re: Transposer2.zip. Issues with windows from Scheme, & Mirrored music
Date: Wed, 06 Nov 2019 10:26:49 +0000

On Wed, 2019-11-06 at 07:03 +0000, Joe Wilkinson wrote:
> two quick questions, Richard.
> 
> 1. How do I detach the script which is attached?

I think you may mean "if I have a Denemo score that was saved with a
Scheme script (to be run each time at start up) how do I use that
script for other purposes?", put like that it is pretty obvious you
copy and paste it from the Scheme window. Or perhaps, "how do you
remove such a script from a saved score?", to which the answer is
delete the text in the Scheme window and save.


> 
> 2. I have a fair knowledge of Lisp-type languages, but Scheme in
> Denemo 
> has scripts that I struggle with; where do i find examples of code
> such as:
> 
> (let ((key "c"))
>       (set! key (d-GetUserInput "Joe's Template" "Give key" key))
>       (if key
>               (d-InitialKey key)))

I confess to having never really gone beyond the manual for Guile (the
Scheme interpreter that is built-in to Denemo)

https://www.gnu.org/software/guile/manual/html_node/index.html

but it is quite hard to get going that way. There are hundreds of
tutorial type introductions (search for "guile scheme tutorial"), it's
only that Lisp type languages are so minimal (the polar opposite of
Perl) that you can get by with a half-hour of basic concepts and some
examples. And there are hundreds of scripts in the menu system of
Denemo (right click and get script into Scheme window).

Of course, the language syntax being tiny pushes the work into the
libraries ("modules". Denemo adds procedures of its own - all the d-
xxxx procedures (which are implemented in C and so are *not* scripts)
and a few procedures starting with a capital letter (e.g. (Appending?)
which *are* scripts located in .../share/denemo/actions/denemo.scm and
.../share/denemo/actions/denemo-modules.

So if I have a bit of a script I'm trying to understand I look up the
procedure/macro name in the procedure index of the manual

https://www.gnu.org/software/guile/manual/html_node/Procedure-Index.html#Procedure-Index

or if it's a Denemo built in command like d-GetUserInput I display the
tooltip, which is stored in a variable named after the command, e.g.

Help-d-GetUserInput

(with no terminal output you have to display this executing 

(d-InfoDialog Help-d-GetUserInput)

in the Scheme window)

and that coupled with trial-and-error gets me there.

HTH

Richard


> Best wishes
> Joe
> 
> On 04/11/2019 17:36, Richard Shann wrote:
> > There is a further problem with your script, namely that the saved
> > score still has the script attached and so every time you open it
> > you
> > will again get the dialogs asking about time sig key sig and title.
> > 
> > On Thu, 2019-10-31 at 14:44 +0000, Joe Wilkinson wrote:
> > > Hi Richard,
> > > Attached is a template that I am currently using to set up music
> > > with
> > > copies for Eb Sax and Bb Clarinet.
> > > Staff2 is the music at concert pitch, Staff1 accompanying chords
> > > for Staff3 I physically make a copy of Staff2 music and move up
> > > notes
> > > below Eb. It is hidden.
> > > Staff4 & 5 mirror music from  Staff 3, transposed down 3
> > > semitones,
> > > and
> > > Staff6 & 7 mirror music from Staff 2, transposed up 2 semitones
> > > (the
> > > clarinet needing little altering other than transposition)
> > > The issues I have are these:
> > > There is a Scheme script run when the Template is launched to set
> > > the
> > > TimeSig, InitialKey, MovementTitle, and to force a SaveAs.
> > > The windows to effect the first 3 seem to appear all together,
> > > but
> > > have to be dealt with in the right order, which is confusing.
> > 
> > Instead of (d-InitialKey) you want to be executing something like
> > 
> > (d-InitialKey "d-minor")
> > 
> > so you need code like this
> > 
> > (let ((key "c"))
> >     (set! key (d-GetUserInput "Joe's Template" "Give key" key))
> >     (if key
> >             (d-InitialKey key)))
> > 
> > 
> > > If I change time or key (from 4/4 in C) Typeset leaves the
> > > mirrored
> > > staffs in A and D, and I still have to go through the last 4
> > > staves
> > > rightclicking on the "directive" to set the key correctly.
> > 
> > Yes, so don't statically create the mirrored staffs but do it in
> > your
> > script after setting the time and key on the first staff.
> > 
> > > If, before right-clicking on the 4 directives I write some music
> > > using an Uplift in stave 2, in the mirrored staves the Uplift
> > > appears
> > > before the mirrored music "directives" in staffs 4-7.
> > > BUT when I then rightclick on the Mirrored directives a duplicate
> > > Mirrored directive appears before the Uplift. It seems to have no
> > > real effect.
> > 
> > I'm not sure I follow you there - what appears in a mirrored staff
> > where the music would normally be is just ignored... I think you
> > are
> > pointing out that the Upbeat command doesn't know about mirrored
> > staffs
> > and puts an upbeat in them, which would be a minor bug in that
> > command.
> > You can delete everything in the staff and it won't affect the
> > typeset.
> > 
> > Have fun, and come back if you get stuck!
> > 
> > Richard
> > 



reply via email to

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