denemo-devel
[Top][All Lists]
Advanced

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

[Denemo-devel] Two ideas of genius.


From: Richard Shann
Subject: [Denemo-devel] Two ideas of genius.
Date: Sat, 11 Jul 2009 18:33:37 +0100

I have had two Good Ideas overnight.
With a simple script we can create buttons along the top of the score
that perform any task we care to script.
We could for instance have an EduDenemo in the distribution which would
appear alongside Denemo on people's start menu (or invocable from the
command line etc) which would be Denemo invoked with a particular
command-set. This invocation would hide everything except these buttons
for playing the educational games and a quit button script to save
scores and quit. Furthermore, to display the score of an educational
game we need only create a button with the score displayed boldly with
encouraging message etc, jingle, as desired.

Why is this possible? Well, when I created DenemoDirectives attached to
the score as a whole and displayed them as buttons on the "Score Titles,
Controls etc" bar I accidentally gave us the possibility of attaching a
DenemoDirective there that did nothing other than display itself as a
button. Now clicking on that button lets you edit the Directive, at
least that was the original idea. But, of course, this "edit the
Directive" can be anything you like. So that changes the whole meaning
of what this scorewide DenemoDirective is for: in this case it is for
running the script that is stored in the editscripts directory. 

One of the implications is that we don't have to write code to allow the
user to place frequently used commands on a toolbar of their own
devising, it can be done with a script:

So, for example, I could write 
(d-DirectivePut-score "FiguredBassButton")
with an "editscript" that just has (d-EditFiguredBass) in it. I put this
in my personal init.scm script.
With this, I have placed the EditFiguredBass menu item onto the "Titles,
Controls etc" bar. No-one else on the planet wants that there - it would
just be my personal set-up. 

Where did this thought come from? Well, I was looking at Jeremiah's
Transpose stuff. The interval that will be used is stored internally in
Scheme - it can be set with the command 
Edit->Transpose->Set Transpose Interval
but it is not visible. What we can do is create a score directive that
displays the current transpose interval (when one is set) as a button,
and clicking can be set to offer to apply it to the selection etc.

The other Good Thing is that I think I can arrange for these buttons to
display a graphic - so the transpose interval could display the interval
as the notes c-eb for a minor third, for example. At the moment, the
name of the graphic is displayed as text, but I think that can be
contingent on there being no graphic of that name.

With markup allowed on the button text we could have large buttons with
no clutter, making for a simple child-friendly educational tool, for
example.

It is possibly not quite the case that all of this is already in place -
the buttons at the moment by-pass the edit script I think. And there is
no access to the editscripts (for writing/editing them) from within the
program. And the terminology needs to evolve. And there are no command
line arguments to invoke Denemo with a particular command set and
init.scm script. But these are pretty trifling ...

In fact the editscripts access has given me another idea: if instead of
a separate editscript we create one on the fly from the original command
- let's call it an action script - then the buttons can be given their
actions when they are created. Such buttons would not be savable with
the current technology - though it would be possible to do so (by
looking up and storing the action script at save time). It would be
problematic to extend this idea backwards to actual editscripts since
these apply to possibly hundreds of instantiations - e.g. the editscript
for a Rehearsal mark. But for the buttons that represent
DenemoDirectives attached to a score this would be quite different. 

This email has been so much delayed by my email server mis-behaving that
I have now implemented the above ideas...


Richard







reply via email to

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