bugDenemo - Bugs: bug #28095, Improved metronome mark command...

 
 

bug #28095: Improved metronome mark command script

Submitter:  None
Submitted:  Thu 26 Nov 2009 05:56:16 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
   

Sun 29 Nov 2009 08:39:02 AM UTC, comment #1: 

Thank you! In git now.

Richard Shann <rshann>
Group administrator
Thu 26 Nov 2009 05:56:16 AM UTC, original submission:  

I thought this script might be useful.  It allows you to set metronome marks with base other than quarter, and it calculates, I hope, the right midi bpm and gives correct lilypond. An expansion of the existing script.-Dan W.

(let ((input "") (len 1) (dotted #f)(duration "4")(bpm 60)(midiBpm 60)(valid #f) )
(set! input (d-GetUserInput "Metronome Marking" "Give unit beat duration \n(e.g., 4. for dotted-quarter):" "4" ))
(set! len (string-length input) )
(set! dotted (equal? "." (substring input (- len 1) len ))  ) ;see if a dot at end
 (if (equal? dotted #t)
 (set! duration (substring input 0 (- len 1)))  ;if there's a dot, cut it off from input to get base duration.
   (set! duration input)  )  
   (set! bpm (d-GetUserInput "Metronome Marking"
      "Give number of these beats per minute:" "60" ) )
      (set! valid   (not (equal? (and (string->number duration) (string->number bpm) ) #f)))  ;don't go unless both are numbers.
      ;don't go unless base duration is valid lilypond: (could go higher if wanted):
      (if (and (equal? valid #t) (or   (equal? duration "1")(equal? duration "2")(equal? duration "4")(equal? duration "8")(equal? duration "16"))   )
(begin
;want * 3/2 for dotted,*4 since midi uses quarters and divide by duration,
(if (equal? dotted #t) (set! midiBpm (number->string (floor (* (/ (string->number bpm) (string->number duration)) 6 ) ) ) )
    (set! midiBpm (number->string (floor (* (/ (string->number bpm) (string->number duration) ) 4))  ) )
)
  (d-DirectivePut-chord-prefix "MM"  (string-append "\\override Score.MetronomeMark #'padding = #3
  \\tempo " input " = " bpm))
  (d-DirectivePut-chord-override "MM" (logior DENEMO_OVERRIDE_TEMPO DENEMO_OVERRIDE_STEP))
  (d-DirectivePut-chord-midibytes "MM" midiBpm)
  (d-DirectivePut-chord-display "MM" (string-append input "=" bpm))
)
(d-WarningDialog "Incorrect syntax.")
))

Anonymous

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-12-04 steele Open/ClosedOpen Closed
    2009-11-29 rshann StatusNone Fixed

    Back to the top

    Powered by Savane 3.12.
    Corresponding source code