lilypond-user
[Top][All Lists]
Advanced

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

Re: Off-topic: Automatically create rehearsal files from SATB midi file


From: Noeck
Subject: Re: Off-topic: Automatically create rehearsal files from SATB midi file
Date: Mon, 20 Jan 2014 10:25:56 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Hi,

I used this (which might be adapted from Frescobaldi or the LSR). It
requires the music to be written into \soprano \alto \tenor and \bass
(but this can for sure be adapted).

The Score uses the default instrument and has a reduced volume compared
to the Staff given by the name variable. This Staff can also have a
different instrument.

Usage: \rehearsalMidi "soprano" "oboe" \text

Here is the function definition:

rehearsalMidi = #(define-music-function
 (parser location name midiInstrument lyrics) (string? string? ly:music?)
 #{
   \unfoldRepeats <<
     \new Staff = "soprano" \new Voice = "soprano" { <>\f \soprano }
     \new Staff = "alto" \new Voice = "alto" { <>\f \alto }
     \new Staff = "tenor" \new Voice = "tenor" { <>\f \tenor }
     \new Staff = "bass" \new Voice = "bass" { <>\f \bass }
     \context Staff = $name {
       \set Score.midiMinimumVolume = #0.5
       \set Score.midiMaximumVolume = #0.5
       \set Score.tempoWholesPerMinute = #(ly:make-moment 80 4)
       \set Staff.midiMinimumVolume = #0.8
       \set Staff.midiMaximumVolume = #1.0
       \set Staff.midiInstrument = $midiInstrument
     }
     \new Lyrics \with {
       alignBelowContext = $name
     } \lyricsto $name $lyrics
   >>
 #})

Cheers,
Joram




PS: I always wanted to have it surrounded by this book and score blocks,
but that never worked out:

midifor = #
(define-scheme-function
 (parser location name midiInstrument lyrics) (string? string? ly:music?)
 #{
\book {
  \bookOutputSuffix $name
  \score {
    \rehearsalMidi $name $midiInstrument $lyrics
    \midi { }
  }
}
 #})



reply via email to

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