denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] MIDI entry filters


From: Richard Shann
Subject: Re: [Denemo-devel] MIDI entry filters
Date: Fri, 28 Nov 2008 17:06:53 +0000

On Fri, 2008-11-28 at 10:53 -0600, Jeremiah Benham wrote:
> On Tue, 2008-11-25 at 11:26 +0000, Richard Shann wrote:
> > I've added some MIDI entry filters to the Entry Menu/MIDI. One is for
> > edit mode where when you enter a note from the MIDI keyboard the cursor
> > advances to the next note. The other is for entering figured basses from
> > the MIDI keyboard. This last needs only a little work to enable you to
> > enter the chords themselves (a much simpler task).
> > Notice that they avoid creating global variables. Being filters they
> > need to create one global, so that if re-entered they know that they are
> > already active. This one global is prefixed with
> > <nameOfCommand>::
> > so that it will not conflict with any other command script.
> 
> I edited the transposition script so that it only uses functions within
> itself defined by let. I modeled it after your Midifilter scripts. Can
> this global prefix be passed an argument with this standard? 
This is just a denemo naming convention: if the names are defined in a
let they don't need a prefix. It is only when you need a global (i.e.
one that the script remembers next time it is called, or, possibly one
that another script might need) that the prefix is mandated by this
convention to avoid hard-to-trace name collisions.
There is a module system in guile, but I think it would be overkill to
be thinking about it now.
> Like
> Transpose::Interval("c d"). If all the other functions are member
> functions is it necessary to prefix these member functions with
> Transpose::?
>  
This whole subject of scripts calling scripts is one that I have avoided
thinking about yet. (Ditto for scripts taking parameters). There is just
too much to do! Mostly I would like to consolidate what we have, doing
useful things with the tools we have already (including filling in the
dots where needed).
But I'll give it some thought.
Richard

> I am assuming the stuff that has it go through the entire staff and
> reiteration should be removed from this script. So the users would have
> to pass this as a command to what to apply to entire staff or what to
> apply to range. So in the ApplyToSelection script:
> 
> replace:
> (define command (d-GetCommand))
> with
> (define command "(Transpose::Interval("c d"))")
> 
> Does this all sound right?
> 
> Would each script be prefixed with something like:
> 
> (if (not (defined? Transpose::Active))
>  (define Transpose::Active #f))
> 
> (if Transpose::Active
>  (begin
>    (set! Transpose::Active #f)
> 
> Or would having it start with something like:
> 
> (define Transpose::Interval
>   (lambda (interval)
>     (begin 
>       etc ....
> 
> Then if interval is not defined it could have the popup asking the
> interval. Is that possible in guile to call a function that like this
> with optional arguments? Sorry so many questions.
> 
> 
> Thanks,
> Jeremiah
> 
> 
> 
> 
> 
> > All other variables are local, which is done using let and let*
> > constructs.
> > We should insist on these standards for scripts that we distribute.
> > Richard
> > 
> > 
> > 
> > 
> > _______________________________________________
> > 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]