denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Denemo-items - Midi-values; Global tables


From: Richard Shann
Subject: Re: [Denemo-devel] Denemo-items - Midi-values; Global tables
Date: Tue, 07 Jul 2009 09:15:48 +0100

On Mon, 2009-07-06 at 21:40 +0200, Nils Gey wrote:
> I want to write a set of dynamics from ppp to fff.
> 
> 1) To avoid redundancy it would be nice not to write the full set of single 
> script items in every script but to write one parent-script and just give the 
> parameters as difference between pp and f.
> It this ok with the denemo style of scripting?
Yes. What we need here is more familiarizing ourselves with the
scripting possibilities. I have already done some examples: the most
elaborate is for Jeremiah's transpose stuff (the actual transpose is not
working but the calling mechanisms are). That example has a separate set
of scripts which are called just once (so that you can apply transpose
efficiently to a whole selection without re-defining the procedures for
each note). For the dynamics case this isn't needed: one way would be to
have a command

AttachDynamic

that would take a string (e.g. pp or mf...) from the user and look it up
using a (cond ...) procedure and attach the required lilypond and midi
and display stuff to the chord.

For a flavor of what is involved here is a snippet of code which gets a
single character and performs one of two procedures:

(define response (string (d-GetChar)))
(cond
 ((equal? response "s") (set! command d-Save))
 ((equal? response "k") (set! command d-Close))
)         
(command)

 - this comes from one of the scripts I wrote some time back.

There will be many other possibilities - I have put a number of routines
at the end of actions/denemo.scm which are for (fairly)general purpose
use, and more can be added there.
But at the moment perhaps we should just create some simple things? If
we try to run before we can walk maybe we will never leave the cradle:-)

> 
> 2) Also I think its nice to have a central place where Denemo/Midi 
> standard-values can be edited instead of hardcoding the dynamic/midi values 
> to the script itself. 
> 
> This could be a small database as textfile, like an .ini file, or an xml 
> file, all easy to edit and copy.
> 
> Besides dynamics this is the place for tempo (Allegro 120) and other things, 
> too. 
Yes, but avoid more preferences files: put these values in the standard
Denemo preferences and they can be made available to script writers at
startup (there is code in view.c which does this, e.g. telling scheme
what value DENEMO_OVERRIDE_LILYPOND is). I wonder if the current prefs
file/parser would allow extra preferences to be shipped verbatim to
Scheme...

> 
> Denemo then comes with decent standard-values but its possible to use an 
> entire different file, too.
> 
> They could be included in .denemo files (easier to create templates and 
> share/send them) or standalone. Easier to edit but harder to share/maintain. 
> Or both: Normaly Standalone but you can save with "[]include midi value 
> database"
> 
> 3) This is not a problem or a request, but a thought:
> As far as I know Denemo does not get its script-effect from the parent script 
> but renders redundant actions to a specific note/chord.
>  So if you add a "ff" (script version) and change the ff script later already 
> applied attached scripts will not change.
> 
> Is that right?
Yes that is right.

Richard


> 
> Nils
> 
> 
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel





reply via email to

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