Re: Can I output PNG and midi from the same file?
On Mon 13 May 2024 at 03:21:35 (+), Peter Baughman wrote: > I have a few .ly files that work great and produce lovely pictures when I > build then with a command like: > > lilypond --png my_song.ly > > I started to play around with midi output and was a little suprised to find > that I needed to add a \midi code block to my file (instead of some other > command-line flag when building) but this was not a big deal - After 20 or 30 > minutes I figured out how to do it and got some lovely sound output. > > I was surprised, though to discover that when I built my songs they were no > longer producing png output. > > Is there a way to get both PNG and midi output from the same .ly file, or do > I need to invent some preprocessor step that adds a \midi block to a file or > perhaps removes one from a file to get png output? In the absence of both \layout { } and \midi { }, LP produces a score. If you add a \midi { } and you still want a score, you must add a \layout { } too. Cheers, David.
Re: Can I output PNG and midi from the same file?
Dear Peter, Assuming you wrote something like % - \version "2.25.7" \score { c'4 \midi {} } % - and then ran lilypond --PNG midi.ly, then there would be no PNG output. This is because if you only include the \midi block, then lilypond produces no visual output at all. But if you don't include either \layout or \midi then lilypond defaults to visual output only. If you add \layout {} next to \midi {} then it should produce both visual and midi output. Thanks, -William On 5/12/24 23:21, Peter Baughman wrote: Greetings, I have a few .ly files that work great and produce lovely pictures when I build then with a command like: |lilypond --png my_song.ly| I started to play around with midi output and was a little suprised to find that I needed to add a \midi code block to my file (instead of some other command-line flag when building) but this was not a big deal - After 20 or 30 minutes I figured out how to do it and got some lovely sound output. I was surprised, though to discover that when I built my songs they were no longer producing png output. Is there a way to get both PNG and midi output from the same .ly file, or do I need to invent some preprocessor step that adds a |\midi| block to a file or perhaps removes one from a file to get png output? Thank you, Pete Baughman -- William Rehwinkel - Oberlin College and Conservatory '24 will...@williamrehwinkel.net PGP key: https://ftp.williamrehwinkel.net/pubkey.txt OpenPGP_signature.asc Description: OpenPGP digital signature
Can I output PNG and midi from the same file?
Greetings, I have a few .ly files that work great and produce lovely pictures when I build then with a command like: lilypond --png my_song.ly I started to play around with midi output and was a little suprised to find that I needed to add a \midi code block to my file (instead of some other command-line flag when building) but this was not a big deal - After 20 or 30 minutes I figured out how to do it and got some lovely sound output. I was surprised, though to discover that when I built my songs they were no longer producing png output. Is there a way to get both PNG and midi output from the same .ly file, or do I need to invent some preprocessor step that adds a \midi block to a file or perhaps removes one from a file to get png output? Thank you, Pete Baughman
Re: layout problem
Thank you, Timothy, for responding so quickly and explaining the solution in such a clear manner. Although I've used labelling in other situations before, I still hadn't understood how to apply it here --- and now I do. Thanks again. Archer On 12/05/2024 16:37, Timothy Lanfear wrote: On 12/05/2024 12:41, Archer Endrich wrote: Hello, I've been given a short item to realise in Lilypond and it includes a layout problem that I haven't been able to solve. Basically, it is a piano piece in which, after a bit, a part for chimes is added: i.e., another staff above the piano's treble part a few bars in as in my MWE. I have tried to do this as an ossia staff in testlayoutB.ly but it produces the result testlayoutB.pdf which starts the chimes part at the beginning of the example, not where I want it to start. Label your staves and use alignAboveContext (or alignBelowContext) to position the new staff relative to an existing staff. \version "2.24.0" \header { title = "Test Layout" } chimes = { \once \omit Staff.TimeSignature \once \omit Staff.Clef \stopStaff s1^\markup \italic "Some text here" \startStaff \clef "treble" \time 3/4 bes'2\mp 4 } \new PianoStaff << \new Staff="RH" { \time 4/4 \clef "treble" \repeat unfold 2 {d'2 f'2 | g'2 bes'2 | } << { R1 \stopStaff s2.^\markup \wordwrap { \italic \small "A lot more more text placed in here" } } \new Staff \with { alignAboveContext="RH" } { \chimes } >> } \new Staff="LH" { \time 4/4 \clef "bass" \repeat unfold 20 {g,8[ g,]} \time 3/4 \repeat unfold 12 {g,8[ g,]} } >> -- Timothy Lanfear, Bristol, UK.
hairpins inside brackets
I have had help before with adding brackets to dynamics and I see the snippet to parenthesize snippets. Is there a way to enclose a hairpin in brackets? TIA, Paul
Re: layout problem
On 12/05/2024 12:41, Archer Endrich wrote: Hello, I've been given a short item to realise in Lilypond and it includes a layout problem that I haven't been able to solve. Basically, it is a piano piece in which, after a bit, a part for chimes is added: i.e., another staff above the piano's treble part a few bars in as in my MWE. I have tried to do this as an ossia staff in testlayoutB.ly but it produces the result testlayoutB.pdf which starts the chimes part at the beginning of the example, not where I want it to start. Label your staves and use alignAboveContext (or alignBelowContext) to position the new staff relative to an existing staff. \version "2.24.0" \header { title = "Test Layout" } chimes = { \once \omit Staff.TimeSignature \once \omit Staff.Clef \stopStaff s1^\markup \italic "Some text here" \startStaff \clef "treble" i\time 3/4 bes'2\mp 4 } \new PianoStaff << \new Staff="RH" { \time 4/4 \clef "treble" \repeat unfold 2 {d'2 f'2 | g'2 bes'2 | } << { R1 \stopStaff s2.^\markup \wordwrap { \italic \small "A lot more more text placed in here" } } \new Staff \with { alignAboveContext="RH" } { \chimes } >> } \new Staff="LH" { \time 4/4 \clef "bass" \repeat unfold 20 {g,8[ g,]} \time 3/4 \repeat unfold 12 {g,8[ g,]} } >> -- Timothy Lanfear, Bristol, UK.
LilyPond 2.25.16
We are happy to announce the release of LilyPond 2.25.16. This is termed a development release, but these are usually reliable for testing new features and recent bug fixes. However, if you require stability, we recommend using version 2.24.3, the current stable release. Please refer to the Installing section in the Learning Manual for instructions how to set up the provided binaries: https://lilypond.org/doc/v2.25/Documentation/learning/installing signature.asc Description: This is a digitally signed message part
Re: strange chord
> I mean… technically, it’s correct… Thanks. > but yuck. :-) > If I were customizing the name, I would probably have it say > Em(addb4). At the very least it should say Emsusb4. As chord names noob I have no opinion to that. I just wanted to ensure that MR !2335 produces correct results, even if they are sometimes bizarre, apparently. Werner
layout problem
Hello, I've been given a short item to realise in Lilypond and it includes a layout problem that I haven't been able to solve. Basically, it is a piano piece in which, after a bit, a part for chimes is added: i.e., another staff above the piano's treble part a few bars in as in my MWE. I have tried to do this as an ossia staff in testlayoutB.ly but it produces the result testlayoutB.pdf which starts the chimes part at the beginning of the example, not where I want it to start. Comments in my .ly refer to a semicolon being commented out and reinstated just above the piano Bass clef part. This causes the chimes and piano treble second line line to begin where I want it to, but it is placed below the bass, with a spurious clef above the bass. What I would really like to do is to use StaffGroup as in testlayoutA.ly but this fails with a fatal error: "\new StaffGroup %Fatal error: 'spurious expression in \score'", so Lilypond rejects this kind of construction. I have a voice & piano piece of my own which changes the number of staves in the piano part, so I'm very keen to learn how to deal with changing numbers of staves in a score. Thanks! Archer %testLayoutB.ly \version "2.24.3" \header { title = "Test Layout" } transparentrest = \once \override Rest.transparent = ##t transparentMMrest = \once \override MultiMeasureRest.transparent = ##t \score { \new PianoStaff << % TREBLE CLEF 1st system \new Staff = "pluschimes" { \time 4/4 \clef treble \repeat unfold 2 {d'2 f'2 | g'2 bes'2 | } \break % TREBLE CLEF 2nd system R1 | \stopStaff s4 \once \override TextScript.extra-offset = #'(0.5 . -5.0) s2.^\markup { \override #'(line-width . 50 ) \wordwrap {\italic{\small{A lot more more text placed in here | s1| s1 | s1 | \startStaff \time 3/4 \tempo 4 = 60 r2. \bar "!" } % If this } is commented out and put just above the Bass Clef (see % %} there, a spurious staff and ossia staff above it appears % BELOW the second system ... % OSSIA STAFF ABOVE PianoStaff FOR CHIMES (meant to start at 2nd system) \new Staff = "chimes" \with { \remove "Time_Signature_Engraver" alignAboveContext = "pluschimes" \context Staff \magnifyStaff #2/3 fontSize = #-2 } { s4^\markup{\small {\column{\line{[Orchestral Chimes if} \line{ available (B\flat - C only)] \stopStaff s2. | \transparentMMrest R1 | \transparentMMrest R1 | \transparentMMrest R1 | \once \override TextScript.extra-offset = #'(-1.0 . -7.0) \transparentMMrest R1^\markup { \override #'(line-width . 20 ) \wordwrap {\italic{\small{Some text here | \revert Score.TimeSignature.stencil \startStaff \time 3/4 bes'2\mp bes'4 | } %} % semicolon reinstated here % BASS CLEF 1st system \new Staff { \time 4/4 \clef bass \repeat unfold 16 {g,8[ g,]} \break % BASS CLEF 2nd system \repeat unfold 16 {g,8[ g,]} } >> }%testLayoutA.ly \version "2.24.3" \header { title = "Test Layout" } transparentrest = \once \override Rest.transparent = ##t transparentMMrest = \once \override MultiMeasureRest.transparent = ##t \score { \new PianoStaff << % TREBLE CLEF \new Staff { \time 4/4 \clef treble \repeat unfold 2 {d'2 f'2 | g'2 bes'2 | } \break } % BASS CLEF \new Staff { \time 4/4 \clef bass \repeat unfold 16 {g,8[ g,]} \break } >> \new StaffGroup %Fatal Error: 'Spurious expression in \score' << % EXTRA STAFF ABOVE PianoStaff FOR CHIMES \new Staff = "chimes" \with { \magnifyStaff #2/3 \remove "Time_Signature_Engraver" fontSize = #-2 } { s4^\markup{\small {\column{\line{[Orchestral Chimes if} \line{ available (B\flat - C only)] \stopStaff s2. | \transparentMMrest R1 | \transparentMMrest R1 | \transparentMMrest R1 | \once \override TextScript.extra-offset = #'(-1.0 . -7.0) \transparentMMrest R1^\markup { \override #'(line-width . 20 ) \wordwrap {\italic{\small{Some text here | \revert Score.TimeSignature.stencil \startStaff \time 3/4 bes'2\mp bes'4 | } \new PianoStaff << \new Staff { \time 4/4 \clef treble % TREBLE CLEF R1 | \stopStaff s4 \once \override TextScript.extra-offset = #'(0.5 . -5.0) s2.^\markup { \override #'(line-width . 50 ) \wordwrap {\italic{\small{A lot more more text placed in here | s1 | s1 | s1 | \startStaff \time 3/4 \tempo 4 = 60 r2. \bar "!" } % BASS CLEF \new Staff { \time 4/4 \clef bass \repeat unfold 16 {g,8[ g,]} } >> >> } testLayoutB.pdf Description: Adobe PDF document
Re: strange chord
Hi Werner, I mean… technically, it’s correct… but yuck. If I were customizing the name, I would probably have it say Em(addb4). At the very least it should say Emsusb4. — Kieren __ My work day may look different than your work day. Please do not feel obligated to read or respond to this email outside of your normal working hours.
Re: Feathered Beam Timing
On 12/05/2024 09:46, Timothy Lanfear wrote: On 11/05/2024 18:42, Steph Phillips wrote: Pretty happy with how that looks, but now I'm having trouble converting it to a function. The following is what I've put together, but I can't seem to shake the compiler error. The parameters feather-ratio, tuplet-ratio are not moments, but ratios. Also, the parser and location arguments have not been required for several releases of LilyPond. Here is a working version of your function. Looking again at the documentation, feather-ratio can be expressed as a moment -- the predicate to match this type is ly:moment? (not moment?). Tuplet-ratio must be a rational number, expressed as a pair. -- Timothy Lanfear, Bristol, UK.
Re: strange chord
> I tried the following > > ``` > \version "2.25.16" > > chord = \chordmode { c4:6-^1 } > > << > \new ChordNames \chord > \chordmode { \chord } > >> > ``` > > and got the attached result. The displayed chord name looks weird > to me, but I'm no expert for Jazz chords... Is it correct? If not, > how should it be displayed? Oops, now attached. Werner
Re: Feathered Beam Timing
On 11/05/2024 18:42, Steph Phillips wrote: Pretty happy with how that looks, but now I'm having trouble converting it to a function. The following is what I've put together, but I can't seem to shake the compiler error. The parameters feather-ratio, tuplet-ratio are not moments, but ratios. Also, the parser and location arguments have not been required for several releases of LilyPond. Here is a working version of your function. \version "2.24.2" customTuplet = #(define-music-function (displayed-note y-off beam-left tuplet-up feather-ratio tuplet-ratio notes) (number? number? boolean? boolean? rational? pair? ly:music?) #{ \once \override TupletNumber.text = \markup { \note-by-number #displayed-note #0 #UP } \once \override TupletBracket.bracket-visibility = ##t \once \override TupletBracket.visible-over-note-heads = ##t \once \override TupletBracket.Y-offset = #y-off \once \override Beam.grow-direction = #(if beam-left LEFT RIGHT) #(if tuplet-up #{ \tupletUp \tuplet #tuplet-ratio { \featherDurations #feather-ratio { $notes } } #} #{ \tupletDown \tuplet #tuplet-ratio { \featherDurations #feather-ratio { $notes } } #} ) #}) \score { \relative c'' { \time 4/4 \customTuplet #1 #-1.5 ##t ##t #2/1 #'(6 . 8) { d16[-. d-. d-. d-. d-. d]-. } \customTuplet #2 #-1.5 ##f ##f #2/1 #'(5 . 8) { e16[-. e-. e-. e-. e-. e]-. } } } -- Timothy Lanfear, Bristol, UK.
strange chord
I tried the following ``` \version "2.25.16" chord = \chordmode { c4:6-^1 } << \new ChordNames \chord \chordmode { \chord } >> ``` and got the attached result. The displayed chord name looks weird to me, but I'm no expert for Jazz chords... Is it correct? If not, how should it be displayed? Werner