[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Denemo-devel] Augmentation / Diminuation Prototype
From: |
Nils Gey |
Subject: |
[Denemo-devel] Augmentation / Diminuation Prototype |
Date: |
Sun, 19 Jul 2009 14:53:59 +0200 |
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.
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. 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.
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.
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?
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? 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] Augmentation / Diminuation Prototype,
Nils Gey <=