lilypond-user
[Top][All Lists]
Advanced

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

help with scheme and midi output


From: Bainos
Subject: help with scheme and midi output
Date: Mon, 7 Jul 2008 15:12:54 -0700 (PDT)

Hi all!

I'm writing a little collection of drum grooves. For each groove I would
like
to have a midi file. Since now I used the following method:

[code]
I = \drummode {
        \override Beam #'positions = #'(5 . 5)
        \repeat volta 2 {
        tomfh16 hh hh sn hh sn sn hh 
        bd8 hh16 bd sn hh bd bd
        }
}

\score{
<<
    \new DrumStaff
        <<
            \new DrumVoice { \voiceOne  \I }
        >>
    >>
    \layout{}
    \midi{
        \context {
            \Score
            tempoWholesPerMinute = #(ly:make-moment 65 4)
        }
    }
}
\version "2.11.40"
[\code]

This way I have to repeat the score block for each groove ,
so I'm trying to "translate" this lilypond snippet to a scheme function.
I wrote a function that works, but I cannot understand how to obtain midi 
output.

[code]
createscoreIX = #(define-music-function (parser location notes) (ly:music?)
(let* (
         (score     (scorify-music 
                 #{
                         
        \new DrumStaff <<
        \new DrumVoice { \voiceOne
                        \override Beam #'positions = #'(5 . 5)
                        \repeat volta 2 {
                                 $notes
                        }
        }>>
        
                #}
                 parser))
        )
        ;(ly:set-option 'help)
        ;(ly:set-option 'midi-debug #t)
        ;(ly:get-all-translators)
        (ly:make-moment 120 4)
        (collect-scores-for-book parser score)
  )
  ; This is a void function, the score has been schedulled for typesetting
already
  (make-music 'Music 'void #t)
)
\createscoreIX \drummode{\repeat unfold 2 {bd4 sn bd sn}}
\version "2.11.40"
[\code]

I searched google, the forum and the manual, but I didn't find any hint...

the question is: can I add midi output to this function? if yes.. how?

Thanks in andvance for any help!

regards

bainos
-- 
View this message in context: 
http://www.nabble.com/help-with-scheme-and-midi-output-tp18327838p18327838.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.





reply via email to

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