lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

completing a bar automatically with rests


From: Stefan Thomas
Subject: completing a bar automatically with rests
Date: Wed, 5 Sep 2012 11:38:20 +0200

Dear community,
I don't like to write lots of rests by hand into bars with only very few notes.
Using the wonderful script extractMusic of Gilles, which I found at http://gillesth.free.fr/Lilypond/extractMusic/extractMusic.ly I've defined functions that fill up automatically a 3/4 or 4/4 bar with rests.
Off course I could easily define more functions for the most common timesignatures, but I would like to define a function, with which one can chose.
I'm dreaming of something like:
\makerests 4/4 c8
Has someone an idea to implement this into Lilypond? I think it should be possible with if-then constructions, but I don't know how to do it in scheme.
Here are my short definitions:

\version "2.16.0"
\include"rhythmen.ly" % there is my definition of replaceMusic included
restthreequarters = { r64 r r32 r16 r8 r4 r4  }
resttfourquarters = { r64 r64 r32 r16 r8 r4 r2 }

someofthreequarters = #(define-music-function (parser location x) (ly:music?)
  #{
    \replaceMusic  \restthreequarters s1*0 $x
#})

someoffourquarters =  #(define-music-function (parser location x) (ly:music?)
  #{
     \replaceMusic  \resttfourquarters s1*0 $x
#})


%% shortcurts
#(define stq someofthreequarters)
#(define sfq someoffourquarters)

\new Staff \relative c' {
  \time 4/4
  \sfq c32
  \time 3/4
  \stq c16-.
}




reply via email to

[Prev in Thread] Current Thread [Next in Thread]