denemo-devel
[Top][All Lists]
Advanced

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

Re: [Denemo-devel] Denemo Hooks


From: R. Mattes
Subject: Re: [Denemo-devel] Denemo Hooks
Date: Mon, 27 Jun 2011 22:53:11 +0200

On Mon, 27 Jun 2011 12:09:35 +0100, Richard Shann wrote
> I hit the Eb/D# problem again while entering notes from my MIDI
> controller, and that has galvanized me into action.
> I propose to add a hook to the Key Signature settings (perhaps to *all*
> denemo built-in commands?) and use it to adjust the range of enharmonics
> when the keysignature is set or a new one inserted. (More is needed but
> this email is about the hook technology).

Hmm, I'm not totally convinced that looking at the key signature would
be a good overall strategy to decide enhamonic selection. I.e. in the
key of A minor, how would you select between C# (often in cadences on
the final with major third - so called 'picardian third') and Db (as
the minor six above the forth degree in the bass - neapolitan sixt)? I
could come quite a lot of similar probematic cases. I _do_ agree that
it would be nice to have some way of controlling enharmonic selection,
and selection by key signature would be a good default candidate.  For
my use-cases, being able to manually switch the "tonal center" would
be fine.

> So I have built the captain-hook branch and run the test from the
> README. It is all working straight out of the box. Great Work!

Good to hear. Just one warning: I'm not shure the function names are
written in stone yet. I'm open for suggestions ....

> Now I have to get my head round it:)
> I think I have to write a call to denemo-run-hook (using a scm_applyxxx
> I think it is) at the point where the set keysignature command is about
> to be run (and perhaps another call to denemo-run-hook after doing 
> the keysig change, and/or perhaps not run the keysig change command 
> if the hook returns a #f?). The parameters to denemo-run-hook would 
> be some hook list and the value of keysig being set. So, what is a 
> good design here for the hook list? One per built-in command? Is the 
> overhead here tiny if the hook list is not set?

Again, I'm not sure a hook would be a good solution for this
problem. What would a hook provide that a simple function wouldn't?  I
think Common Lisps generic functions would be ideal for such tasks:
one could define :around, :before or :after methods. Or Emacs-like
advice functions. Maybe GOOPS supports CLOS-style methods. It has been
quite a while since I last looked at GOOPS. Back then the C interface
was just non-existant.

 Cheers, RalfD

> Richard


--
R. Mattes -
Hochschule fuer Musik Freiburg
address@hidden




reply via email to

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