• Willkommen im Forum „Archiviertes Lilypond Forum (2017)“.
 

Dies ist das Archiv des alten Forums (bis März 2017). Das aktuelle Forum ist unter lilypondforum.de zu finden.
This is the archive of the old forum (until March 2017). You can find the current forum at lilypondforum.de.

Hauptmenü

Bedingungen

Begonnen von ToPDF, Donnerstag, 27. März 2014, 20:25

Vorheriges Thema - Nächstes Thema

ToPDF

Wer weiß, wie es richtig geht?


\book {
  \header {
    title = "4 or 8 notes in LilyPond"
    condition=1
  }
  \relative {
    c d e f
    if condition=1
    {
      c d e f
    }
  }
}

fugenkomponist

Wenn es nur um eine Stelle geht, würde ich einen Blockkommentar schreiben:\book {
  \header {
    title = "4 or 8 notes in LilyPond"
  }
  \relative {
    c d e f
    %%{
      c d e f
    %}
  }
}
Du brauchst dann nur das erste % wegzunehmen, um den Teil rauszunehmen ;) Wenn du aber damit gleichzeitig mehrere Stellen rein- und rausnehmen willst, empfiehlt sich was in Richtung tags (Stichwort: "keepWithTag" in der Notationsreferenz)

harm6

Hi,

warum soll 'condition' im header definiert werden?

Als toplevel Definition funktionierts simpelst:


\version "2.18.0"

condition = ##f

\relative {
  c d e f
  #(if condition
    #{ c d e f #}
    #{ #})
}


Gruß,
  Harm

fugenkomponist

Oh, so einfach hab ich gar nicht gedacht. Hab irgendwie gedacht, man könnte noch was mit #(define condition ...) machen, aber ein condition = ##t reicht ja ;)

harm6

Zitat von: fugenkomponistaber ein condition = ##t reicht ja

Tatsächliches reicht jede Angabe, die nicht #f ist. Siehe:

\version "2.18.0"

condition = "what-ever"

\relative {
  c d e f
  #(if condition
    #{ c d e f #}
    #{ #})
}


Gruß,
  Harm