markup and midi

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

markup and midi

Gianmaria Lari
Why this code does not generate any midi file?

\version "2.19.60"
\markup {
  \score { 
    {c' d'}
    \midi{}
    \layout{}
  }
}


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Guy Stalnaker-2

On Wed, Jun 14, 2017 at 10:47 AM, Gianmaria Lari <[hidden email]> wrote:
\version "2.19.60"
\markup {
  \score { 
    {c' d'}
    \midi{}
    \layout{}
  }
}

​This does - note no \markup required:

<code>
\version "2.19.60"
  \score {
    <<
    {c' d'}
    >>
    \midi{}
    \layout{}
  }
</code>​


Guy Stalnaker
[hidden email]

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Gianmaria Lari
yes, but that was just a "distilled" (concise) example :) 

Ok, something more real:

\version "2.19.60"
\markup \fill-line {
  \score {
    {c' d'}
    \midi{}
    \layout{}
  }
  \score {
    {c' d'}
    \midi{}
    \layout{}
  }
}

On 14 June 2017 at 18:01, Guy Stalnaker <[hidden email]> wrote:

On Wed, Jun 14, 2017 at 10:47 AM, Gianmaria Lari <[hidden email]> wrote:
\version "2.19.60"
\markup {
  \score { 
    {c' d'}
    \midi{}
    \layout{}
  }
}

​This does - note no \markup required:

<code>
\version "2.19.60"
  \score {
    <<
    {c' d'}
    >>
    \midi{}
    \layout{}
  }
</code>​


Guy Stalnaker
[hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Guy Stalnaker-2
I see what you're trying to do, but I don't think (others on this list can correct me if I'm wrong) that \markup is intended for this kind of use:

<quote>
\markup block is used to typeset text with an extensible syntax called “markup mode”
</quote>



I could be wrong, of course.


Guy Stalnaker
[hidden email]

On Wed, Jun 14, 2017 at 11:10 AM, Gianmaria Lari <[hidden email]> wrote:
yes, but that was just a "distilled" (concise) example :) 

Ok, something more real:

\version "2.19.60"
\markup \fill-line {
  \score {
    {c' d'}
    \midi{}
    \layout{}
  }
  \score {
    {c' d'}
    \midi{}
    \layout{}
  }
}

On 14 June 2017 at 18:01, Guy Stalnaker <[hidden email]> wrote:

On Wed, Jun 14, 2017 at 10:47 AM, Gianmaria Lari <[hidden email]> wrote:
\version "2.19.60"
\markup {
  \score { 
    {c' d'}
    \midi{}
    \layout{}
  }
}

​This does - note no \markup required:

<code>
\version "2.19.60"
  \score {
    <<
    {c' d'}
    >>
    \midi{}
    \layout{}
  }
</code>​


Guy Stalnaker
[hidden email]



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Kieren MacMillan
Hi Gianmaria,

> Ok, something more real:
>
> \version "2.19.60"
> \markup \fill-line {
>   \score {
>     {c' d'}
>     \midi{}
>     \layout{}
>   }
>   \score {
>     {c' d'}
>     \midi{}
>     \layout{}
>   }
> }

Hmm… maybe something like this (WARNING: didn't try it myself!)?

\version "2.19.60"

%%  visual output
\markup \fill-line {
  \score {
    {c' d'}
  }
  \score {
    {c' d'}
  }
}

%%  MIDI output
\score {
  {c' d'}
  \midi{}
}
\score {
  {c' d'}
  \midi{}
}

Hope this helps,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Gianmaria Lari
I wanted to try to avoid to split the midi in a different "block" but I will go in this way.

Thank you Kieren and Guy!
g.


On 14 June 2017 at 19:02, Kieren MacMillan <[hidden email]> wrote:
Hi Gianmaria,

> Ok, something more real:
>
> \version "2.19.60"
> \markup \fill-line {
>   \score {
>     {c' d'}
>     \midi{}
>     \layout{}
>   }
>   \score {
>     {c' d'}
>     \midi{}
>     \layout{}
>   }
> }

Hmm… maybe something like this (WARNING: didn't try it myself!)?

\version "2.19.60"

%%  visual output
\markup \fill-line {
  \score {
    {c' d'}
  }
  \score {
    {c' d'}
  }
}

%%  MIDI output
\score {
  {c' d'}
  \midi{}
}
\score {
  {c' d'}
  \midi{}
}

Hope this helps,
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]



_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Thomas Morley-2
In reply to this post by Gianmaria Lari
2017-06-14 17:47 GMT+02:00 Gianmaria Lari <[hidden email]>:

> Why this code does not generate any midi file?
>
> \version "2.19.60"
> \markup {
>   \score {
>     {c' d'}
>     \midi{}
>     \layout{}
>   }
> }



As others already said, markup can't create midi, but I looked for a
method to extract the scores from markup and to reprocess them as
midi.

Probably:

\version "2.19.61"

%% the markup-definition
mrkp =
\markup \box \line {
    \score { { c' d' } \layout {} }
    \score { { cis' dis' } \layout {} }
    \score { { d' e' } \layout {} }
}

%% call the markup
\mrkp

getMidiFromScoreMarkup =
#(define-void-function (mrkp)(markup?)
"Takes a markup, filters for scores, puts them out each in a new bookpart as
midi"
  (let* ((scores
           (filter
             (lambda (arg) (ly:score? arg))
             ;; brute-force ...
             (flatten-list mrkp)))
        (midi-scores
           (map
             ;; TODO
             ;; is it possible to insert \midi into a ready score, other than
             ;; recreating the score?
             (lambda (e) #{ \score { #(ly:score-music e) \midi {} } #})
             (reverse scores))))
    ;; TODO
    ;; better/shorter method?
    (ly:book-process
      (ly:make-book-part midi-scores)
      $defaultpaper
      $defaultmidi
      (ly:parser-output-name))))

%% put out the midis
\getMidiFromScoreMarkup \mrkp


Cheers,
  Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Kieren MacMillan
Harm,

> markup can't create midi, but I looked for a method to extract
> the scores from markup and to reprocess them as midi.

You're my spirit animal.  =)

Best (and thanks),
Kieren.
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Gianmaria Lari
In reply to this post by Thomas Morley-2
Ciao Thomas,

thank you for your code, I made some test and it works perfectly! But it also scares me :)
g.


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Thomas Morley-2
2017-06-15 8:41 GMT+02:00 Gianmaria Lari <[hidden email]>:
> Ciao Thomas,
>
> thank you for your code, I made some test and it works perfectly! But it
> also scares me :)

Why?


-Harm

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

David Kastrup
In reply to this post by Gianmaria Lari
Gianmaria Lari <[hidden email]> writes:

> Ciao Thomas,
>
> thank you for your code, I made some test and it works perfectly! But it
> also scares me :)

The German condition.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Gianmaria Lari
If I can, I avoid to use complicate things (particularly if I don't understand them). They work in that specific case but when I need to modify for more general case they are source of problem.

Of course I keep your code in the pocket just in case :)

Be kind David. Explain me what do you mean with "The German condition" :)

On 15 June 2017 at 10:11, David Kastrup <[hidden email]> wrote:
Gianmaria Lari <[hidden email]> writes:

> Ciao Thomas,
>
> thank you for your code, I made some test and it works perfectly! But it
> also scares me :)

The German condition.

--
David Kastrup


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

David Kastrup
Gianmaria Lari <[hidden email]> writes:

>> On 15 June 2017 at 10:11, David Kastrup <[hidden email]> wrote:
>>
>>> Gianmaria Lari <[hidden email]> writes:
>>>
>>> > Ciao Thomas,
>>> >
>>> > thank you for your code, I made some test and it works perfectly! But it
>>> > also scares me :)
>>>
>>> The German condition.
>
> If I can, I avoid to use complicate things (particularly if I don't
> understand them). They work in that specific case but when I need to modify
> for more general case they are source of problem.
>
> Of course I keep your code in the pocket just in case :)
>
> Be kind David. Explain me what do you mean with "The German condition"
> :)

The German condition is "working perfectly, never mind how scary the
outcome".

I mean, you know the joke that in heaven you get French cooks, German
engineers, English policemen and Italian lovers while in hell you get
French policemen, German lovers, English cooks and Italian engineers.

Have I forgotten to offend anyone yet?

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: markup and midi

Gianmaria Lari
On 15 June 2017 at 12:05, David Kastrup <[hidden email]> wrote:
[...]
The German condition is "working perfectly, never mind how scary the
outcome".
[...]

eheh :) 

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user