bugDenemo - Bugs: bug #28347, Tempo Chooser

 
 

bug #28347: Tempo Chooser

Submitter:  None
Submitted:  Sat 19 Dec 2009 09:06:46 PM 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
   

Jump to the original submission

Mon 18 Jan 2010 09:55:31 AM UTC, comment #10: 

I have changed replace to (not replace) in the current Tempo command, rather than use the attached, because the current Tempo command detects the LilyPond version. I have not looked for any other mods you may have made - please merge if any.

Richard Shann <rshann>
Group administrator
Tue 12 Jan 2010 08:27:13 PM UTC, comment #9: 

This I believe fixes it.  THe problem was the line

(if replace (d-DirectivePut-standalone "TempoMark" ) )

This should be changed to

(if (not replace) (d-DirectivePut-standalone "TempoMark" ) )

--the reason being that the variable replace is set to #t only if you're modifying an existing directive; so, when replace is #f, you've go to insert the mark to start off.
I guess the command box is there for checking the lily version.  How about put it in a global variable or something so it only runs once?
-Dan W.

Anonymous
Tue 12 Jan 2010 08:14:58 PM UTC, comment #8: 

I just tried this command in 0.8.12 on windows.  It produced a half dozen or so separate directives each with only a single property set (instead of one with all the properties right).  It was working on 0.8.10.  Has DirectivePut been modified so that it cursors to the right, possibly?  This would explain why it doesn't modify the existing directives each time.
   Also I don't know why a command line box appears momentarily when you run this command.
-Dan W.

Anonymous
Thu 31 Dec 2009 10:49:51 AM UTC, comment #7: 

I have added a d-GetLilyVersion command, and incorporated it into this script. Also I changed the (if (equal? #t x) to (if x in a few places.
There remain some things to improve. The InQuotes should not be needed as { } will act in the same way - the important thing is to place \bold etc outside the {}
and I am fairly sure you do not need to special-case the situation where a Tempo directive is already present at the cursor. You can just do d-DirectivePut-xxx commands, and the directive is created or edited as appropriate. The only trick is to make sure the cursor is on any newly created directive. The old way of doing this was a CursorLeft, but there is a command in denemo.scm that takes care of all that viz (d-Directive-standalone "Tempo").
I have checked in the current version, as it is a great improvement over what we had. Thank you.

Richard Shann <rshann>
Group administrator
Tue 29 Dec 2009 08:14:07 PM UTC, comment #6: 

I hope this command isn't too unwieldy, but it allows insertion of tempo marks and/or metronome marks-with reasonable defaults for the metronome marks based on the tempo selected.  The metronome mark can be MIDI only(in which case it's in []), or printed as well.  And it has a simple boolean variable, OldLily, that can be manually set to #t to use old syntax.  But in that case the MM appears above the tempo which isn't the best in my view.  There was a problem with the older tempo commands using the new syntax: they didn't work for multi-word tempos like Allegro assai, so now this is corrected.
This is a response to the request for the tempo commands to affect the MIDI.
Script is included as an attachment.
-Dan W.

(file #19391)

Anonymous
Tue 29 Dec 2009 09:55:35 AM UTC, comment #5: 

I have put this in git, moving the \bold before the  { } so that it applies to all words in the tempo indication.
We need to expose the installed LilyPond version to scheme, so that we can script around version problems - I'll leave this open for that bug.

Richard Shann <rshann>
Group administrator
Tue 29 Dec 2009 12:40:15 AM UTC, comment #4: 

The problem was my own mistake.
Replace this line

(d-DirectivePut-standalone-postfix "Tempo" (string-append "s8*0 ^\\markup { \\bold" choice "]" ))

with this

(d-DirectivePut-standalone-postfix "Tempo" (string-append    "s8*0 ^\\markup { \\bold " choice "}" ))

the correction being adding a space after bold and changing the ] to a }.
It works now on my 0.8.10 windows.
Sorry.

Anonymous
Tue 29 Dec 2009 12:30:21 AM UTC, comment #3: 

I'm pretty certain that this feature (the \tempo "Allegro" command) was not in Lilypond 2.10.  This script should work on 2.10 and have identical behavior to the one I submitted with the \tempo command, but it has that annoying problem of Denemo trying to be helpful and adding a } at the end.  So the lilypond is screwed up on my version, 0.8.10.  But if you've fixed the extra-brace problem in the current version, this should work fine.
Unfortunately at the moment I only have a windows machine available and I'm not at liberty to install linux on it.  Otherwise I'd definitely upload the scripts that way.  Maybe I'll find a way around that. 
I'm considering putting together a script that includes metronome mark with tempo command.  It won't be as polished as would be ideal, because it'll be successive dialog boxes.  Any way to add more things to the popups in (d-GetOption) type commands?
-Dan W.

 (let ((choice #f) (replace #f))
(if (equal? (d-GetType) "LILYDIRECTIVE" )
(if (equal? (d-DirectiveGetTag-standalone) "Tempo" )
(set! replace #t )
)
)
(set! choice (d-GetOption (string-append "Presto" stop "Vivace" stop "Allegro" stop "Andante" stop "Adagio" stop "Largo" stop "Other" stop )))

(if (equal? choice "Other") (set! choice (d-GetUserInput "Tempo setting" "Enter tempo text:" "Allegro assai" ) )  )
( if (not (boolean? choice) )
    (begin
    ( if (equal? replace #f ) (d-DirectivePut-standalone "Tempo" ) )
(d-DirectivePut-standalone-postfix "Tempo" (string-append    "s8*0 ^\\markup { \\bold" choice "]" ))
(d-DirectivePut-standalone-display  "Tempo" choice)
(d-DirectivePut-standalone-minpixels "Tempo" 10 )
(d-DirectivePut-standalone-ty "Tempo" 90 )
(d-RefreshDisplay)
(d-CursorRight)
    )
 ))

Anonymous
Sun 27 Dec 2009 09:34:58 PM UTC, comment #2: 

I have just tried this script (choosing vivace) and got:

denemoprint.ly:20:24: error: syntax error, unexpected STRING, expecting DIGIT or UNSIGNED or DURATION_IDENTIFIER
          a'4 a' \tempo
                        Vivace a'4 a'%|

Is this a LilyPond version problem I wonder  - I use 2.10.33 as in the current Debian stable release.

Richard Shann <rshann>
Group administrator
Tue 22 Dec 2009 08:19:53 PM UTC, comment #1: 

I wonder if anyone can add the MIDI tempo change (I think I may have written an example already)

Richard Shann <rshann>
Group administrator
Sat 19 Dec 2009 09:06:46 PM UTC, original submission:  

The current denemo tempo commands are limited and don't use the best lilypond syntax.
Here's a script that allows you to pick from several common tempos, or write your own.  Also, it uses the current lilypond method of displaying the tempo, the \tempo command.  The output is therefore better IMO than that of the existing denemo commands.  The script also, when executed on top of an existing tempo directive, allows you to modify it.  It uses standalone directives. ty is set to be a bit lower than the metronome mark offset so they don't overlap.  This might be something that should get a global variable-each type of lilydirective could get a different denemo ty-offset so that they don't overlap one another and space is conserved. -Dan W.

 (let ((choice #f) (replace #f))
(if (equal? (d-GetType) "LILYDIRECTIVE" )
(if (equal? (d-DirectiveGetTag-standalone) "Tempo" )
(set! replace #t )
)
)
(set! choice (d-GetOption (string-append "Presto" stop "Vivace" stop "Allegro" stop "Andante" stop "Adagio" stop "Largo" stop "Other" stop )))

(if (equal? choice "Other") (set! choice (d-GetUserInput "Tempo setting" "Enter tempo text:" "Allegro assai" ) )  )
( if (not (boolean? choice) )
    (begin
    ( if (equal? replace #f ) (d-DirectivePut-standalone "Tempo" ) )
(d-DirectivePut-standalone-postfix "Tempo" (string-append  "\\tempo "  choice  ))
(d-DirectivePut-standalone-display  "Tempo" choice)
(d-DirectivePut-standalone-minpixels "Tempo" 10 )
(d-DirectivePut-standalone-ty "Tempo" 90 )
(d-RefreshDisplay)
(d-CursorRight)
    )
 ))

Anonymous

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #19391:  TempoOmnibusOldLily added by None (5KiB - application/octet-stream)

 

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
    2010-01-18 rshann StatusNone Fixed
    2009-12-29 None Attached File- Added TempoOmnibusOldLily, #19391

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code