On Mon, 2011-06-27 at 22:53 +0200, R. Mattes wrote: > 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. Yes, however not to interfere with manual setting (and not to get *too* fussy) I intend to set it only initially and on keysig insertion/setting and to store it with the movement. > For > my use-cases, being able to manually switch the "tonal center" would > be fine. well, we have that, of course. > > > 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 .... They seemed good to me - no mention of being just for MIDI-in, which the README seems to hint. > > > 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 had just come to that conclusion :) while doing the setting the tuning work. But if we were providing a callback for every Denemo command, would that naturally use your scheme?
Richard > 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 > [email protected] > _______________________________________________ Denemo-devel mailing list [email protected] https://lists.gnu.org/mailman/listinfo/denemo-devel
