bugDenemo - Bugs: bug #28352, Voice Commands, basic script

 
 

bug #28352: Voice Commands, basic script

Submitter:  None
Submitted:  Sun 20 Dec 2009 02:56:07 AM UTC
   
 
Category:  Feature request Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Originator Name:  Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 30 Dec 2009 02:30:22 PM UTC, comment #4: 

I looked at turning stem direction into a Chord property, and have shied off (attached is a diff for how far I got). Anything involving manipulating the Denemo display I find very tricky.
I haven't looked at changing the drawing of slurs etc from up to down either, though that would not be quite so tricky I guess.
For now I'll include the script. We could make a script to surround the stem directive objects with lilypond comment markers, to prevent the LilyPond output having effect, but I think it is just ignored anyway.


(file #19394)

Richard Shann <rshann>
Group administrator
Tue 29 Dec 2009 05:40:46 PM UTC, comment #3: 

Unfortunately the effect of the denemo stem commands is to insert an object (like a clef-change does). So the straight forward way would be to allow the directives to be attached to this object.
The downside would be a lot of extra code (only cut and paste stuff, but a lot).
Better I think would be to make the stem direction change a property of the chord object (like slur start is). But this would require a small but delicate intervention in the drawing code.
Needs some thought.

Richard Shann <rshann>
Group administrator
Tue 29 Dec 2009 04:22:49 PM UTC, comment #2: 

When I wrote the script I called it VoiceCommands.  This script is used when entering several voices per staff--it enters a lilypond command to set all of the various gadgets to the proper directions to avoid clashes and make it all look nice.  So the lilypond effect would be duplicated if we issued a denemo stemUp command-there would be redundancy in the lilypond.  Also the denemo display would get crowded due to the \stemUp text being there. 
What would be best is if this script could tell Denemo to show the stems up or down, but not have the stemUp tag displayed.  Is this possible?  Why not make the hard-coded version of the stemUp or Down in Denemo just change stem direction--then any scripts that want to say StemUp can just include that as a directive tag or something.

Also, is it possible to tell Denemo to put the slurs and ties up or down?  This pertains to the slurUp scripts I sent in a while back as well as to this one.

So basically it would make this script a lot nicer to have scheme commands to only modify the denemo view's direction of the slurs and stems, without changing any lilypond.
-Dan W.

Anonymous
Tue 22 Dec 2009 08:12:40 PM UTC, comment #1: 

Thanks for this. There are some voice commands already - how does this script fit in? (Notes/Rests->Stem Direction)
It looks like your script would need to have d-StemUp etc added to make the display correspond.
If you can then give a label, tooltip, command name, menupath :-) In fact you can upload these all at once by right clicking on your command and choosing "Upload script to denemo.org" (if on linux that is).
This gives us all the information to install the command without having to know much about it...

Richard Shann <rshann>
Group administrator
Sun 20 Dec 2009 02:56:07 AM UTC, original submission:  

For polyphonic music the commands \voiceOne, \voiceTwo, \oneVoice, etc. are handy.  I'm including a script that lets you choose these commands.  It would be good if the denemo view reflected these commands: they affect stem direction (up for Voice 1 and 3, down for 2 and 4, I believe), as well as slur/tie direction  (up for 1&3, down for 2&4).  OneVoice is basically return to neutral.

What would be really fancy is for denemo to do a good job of selecting these commands as appropriate, automatically, when you have more than one voice on a staff.  So, when a multi-voice staff has only one active voice, with the others on non-printing rests, the \oneVoice command would be issued.  When several voices were active, they would each have their own appropriate \voiceOne , \voiceTwo, etc. 

Here's the script:


(let ((choice #f)(label #f))
(set! choice (d-GetOption (string-append "OneVoice" stop "VoiceOne" stop "VoiceTwo" stop "VoiceThree" stop "VoiceFour" stop) ) )
(cond
   ( (equal? choice  "VoiceOne" ) (begin (set! choice "voiceOne") (set! label "Voice1") ))
   ( (equal? choice  "VoiceTwo" ) (begin (set! choice "voiceTwo") (set! label "Voice2") ))
   ( (equal? choice  "VoiceThree" ) (begin (set! choice "voiceThree") (set! label "Voice3") ))
   ( (equal? choice  "VoiceFour" ) (begin (set! choice "voiceFour") (set! label "Voice4") ))
   ( (equal? choice  "OneVoice" ) (begin (set! choice "oneVoice") (set! label "1Voice") ) )

)
(d-DirectivePut-standalone "Voice" )
(d-DirectivePut-standalone-display "Voice" label )
(d-DirectivePut-standalone-ty "Voice" 60 )
(d-DirectivePut-standalone-postfix "Voice" (string-append "\\" choice ) )
(d-DirectivePut-standalone-minpixels "Voice" 10 )
)

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #19394:  StemDirection.diff added by rshann (10KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by steele (Updated the item)
  • -email is unavailable- added by rshann (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-04 steele Open/ClosedOpen Closed
    2009-12-30 rshann Attached File- Added StemDirection.diff, #19394
        StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code