[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] Augmentation / Diminuation Prototype
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] Augmentation / Diminuation Prototype |
Date: |
Sun, 19 Jul 2009 16:33:17 +0100 |
On Sun, 2009-07-19 at 14:53 +0200, Nils Gey wrote:
> This is my prototype script to augment or diminuate a note.
>
> (define newLyDuration (* (string->number (d-GetNoteDuration)) 2))
> (case newLyDuration
> ((1) (d-Change0))
> ((2) (d-Change1))
> ((4) (d-Change2))
> ((8) (d-Change3))
> ((16) (d-Change4))
> ((32) (d-Change5))
> ((64) (d-Change6))
> ((1.0 ) (begin (d-Change0) (d-AddDot)))
> ((2.0) (begin (d-Change1) (d-AddDot)))
> ((4.0) (begin (d-Change2) (d-AddDot)))
> ((8.0) (begin (d-Change3) (d-AddDot)))
> ((16.0) (begin (d-Change4) (d-AddDot)))
> ((32.0) (begin (d-Change5) (d-AddDot)))
> ((64.0) (begin (d-Change6) (d-AddDot)))
>
> (else (display "Target duration not support"))
> )
>
> This scripts diminishes notes, but simply exchange "*" with "/" and you have
> augmentation.
>
> The use is very limited to common tasks currently. The problems:
>
> 1) It does not work for rests. This is easy, just change GetNoteDuration to
> return values for rests instead of #f.
> The change commands work for rests.
>
> 2) This does only work for single notes. Of course the real benefit only
> comes applying this to a selection. But I am still not sure if its job of the
> script to see if its a selection or not. ...to be honest, I AM quite sure
> that this is not a script-job. Like I said any single-note script should be
> applied for whole selections. Its maybe a problem because selections are
> usually a mixed array of notes, rests and other commands, so scripts HAVE to
> check if the current object can be used or not. Its not wise to trust in the
> user only apply to scripts where its possible for single objects. For
> multiple objects its not possible for the user.
The apply to selection command seems to be broken - it does some things but I
am not sure what. This really needs fixing.
> 3) It only works for a certain range. If you try to augment a whole note it
> just stays the same. Similar if you try to diminish(?) a 64 to a 128.
the augmenting the whole note could be worked around - insert a tied
whole note or do the \breve as a LilyPond and graphic override. (I still
didn't get to seeing if LilyPond has a way of handling these internally,
but I seem to recall that they have something for storing the duration
of a 5/4 measure...).
> Both is possible in music, but not in Denemo. But the table can easily
> adjusted if the Denemo range is extended.
>
> 3b) I am not sure if this is a bug or feature: Because of 2) its possible to
> rhythmically "flatten" things. Especially if you think about selections: You
> can bring the whole selection down to whole notes by using the script again
> and again.
>
> This is interesting, but maybe not desired or just another script. The script
> could check if the current note/rest is an unusable one. Easy for single
> notes, in fact this is already done, but in a selection you have to check all
> notes before the first one gets transformed. Don't know how to do that.
we must get ApplyToSelection working...
>
> 4) Dotted notes. I think I have not done it correctly. You can see that I
> test if a note is dotted through GetNoteDurations return value, which gives
> 4. for a dotted quarter, which is transformed to 4.0 by string->number. Quite
> a hack?
> However, this is of limited use because it justs work for single dotted notes
> and not for more than one dot.
>
> I think I have to convert the GetNoteDuration return value to a String-list
> first and then check the number of dots.
yes, the other is just a fluke.
>
>
>
> 5) To make both augmentation and diminuation avaible I could just do two
> redundant scripts with only * and / changed.
> Any suggestions how I can use one scripts for two different keypresses in
> this case?
I think you can just pass * or / as an argument to the procedure.
> The point is that no user-interaction should be necessary.
> I'm not sure if I was already told this, but how can a script access the name
> it was invoked with?
It is stored in a global (? CurrentScript??? is it documented??)
Richard
> The command name I give when I add this to a menu.
> Or is there another way?
>
> Maybe just do two scripts/commands but make the case-table avaible
> denemo-wide.
>
> Nils
>
>
> _______________________________________________
> Denemo-devel mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/denemo-devel