Hans,

that's pretty cool :-), it first got me confused because I did not see it
in frescobaldi, the midi player doesn't show the midifiles, but I checked
the directory where the .ly file is 'et voila' :-) there it was.

Great, this possibility is a good thing to know. I've read on this list
that lilypond is not optimal for use on a webserver, but just imagine the
possibilities of these kinds of things. For example automatically generated
exercises for ear training having audio and notation, with an input box
where the user can enter notes and then check the results.. :-D ..

but that is out of the scope of this email, I get excited about these
endless opportunities for lilypond :-).

thanks again,

Bart



http://www.bartart3d.be/
On Twitter <https://twitter.com/Bart_Issimo>
On Identi.ca <http://identi.ca/bartart3d>
On Google+ <https://plus.google.com/u/0/b/116379400376517483499/>

2016-12-07 12:53 GMT+01:00 Hans Aikema <hans.aik...@aikebah.net>:

>
> > On 7 Dec 2016, at 08:31, bart deruyter <bart.deruy...@gmail.com> wrote:
> >
> > Hi all,
> >
> > I'm sorry for this late reply, it has been quite busy here.
> >
> > here is a minimal example:
> >
> > <..>
> >
> > As expected, I get two midi files, but they both contain the music of
> the entire score. The midi blocks don't follow the \keepWithTag rules.
> >
> > What I'd like to see is one score, two different midi files, each
> containing only the music enclosed in the tags.
> >
> > is something similar possible? Maybe I forgot some essential extra
> code...
> >
> > Using different score blocks for each part seems a bit much to get one
> pdf for the full score and chopped midi files.
> >
> Bart,
>
> With pure lilypond you will need the additional Score blocks. Both \layout
> and \midi render whatever is the current score (they do not consume a music
> expression to render, but rather take the current score to render.
> Another option would require scheme code to dynamically build your midi
> score blocks. I recently discoverd the rehearsalMidi function hidden in the
> treasures of openlilylib which now is a great asset in my toolbox for
> creating rehearsal midi (and mp3 with a timidity++/lame toolchain) files
> for my choir. As I suspected (after some trial and error.. my first steps
> into scheme coding) it can be easily adapted for your needs of outputting
> separate midis for tagged music. See the attached file for the function. It
> needs to be included in your actual files. Your minimal snippet would be
> converted into:
>
> \include "tagmidi.ly"
>
> altoVoice = \relative c' {
>
> \tag #'A {c'2  g |} \tag #'B {e'4 d  c2 }|
>   \bar "|."
> }
>
> \score {
>   \new Staff \with {
>     midiInstrument = "piano"
>   } { \altoVoice }
>
>   \layout { }
> }
>
> \tagMidi \altoVoice #'A
> \tagMidi \altoVoice #’B
>
> Which I think is more consise and less error-prone once you start getting
> more samples into a single file and gives you suffixes to the midi-files
> that match the tags.
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to