diff --git a/lilypond-common-includes b/lilypond-common-includes index a0f60bc..b23ba5c 160000 --- a/lilypond-common-includes +++ b/lilypond-common-includes @@ -1 +1 @@ -Subproject commit a0f60bc1c7a399eacf72725e559af2890fe0aa75 +Subproject commit b23ba5c0dc7116a08a177559fb2d3af1549cf2fc diff --git a/snippets_20240110_DE.xml b/snippets_20240110_DE.xml new file mode 100644 index 0000000..f5fb3ca --- /dev/null +++ b/snippets_20240110_DE.xml @@ -0,0 +1,988 @@ + + + + + +Abstand + +%\vspace(#2) + + + +Abstand Seitenrand/oberstes Notensystem + +HEADER = \bookpart { + \paper { + top-system-spacing.padding = 6 %Abstand zwischen Seitenrand und obersten Notensystem (wenn was anderes da steht wie z.B. Titel/ Text, greift das nicht) gut um z.B. noten auf der zweiten Seite runter zu machen + } + + + +Abstand Titel/Noten + +% nach HEADER = \bookpart { + \paper { + markup-system-spacing.padding = 2 + } + + + +Abstand Titel/oberer Seitenrand + +%titletopspace = 1 % nach titlesize + + + +Auswahl der Groß-/Kleinschreibung des Titels + +-*- python; selection: yes, keep; +text = text.title() + + + + +Auswahl zu Großbuchstaben + +Ctrl+U + +-*- python; selection: yes, keep; +text = text.upper() + + + + +Auswahl zu Kleinbuchstaben + +Ctrl+Shift+U + +-*- python; selection: yes, keep; +text = text.lower() + + + + +Basis-Leadsheet + +-*- template; template-run; +\version "$LILYPOND_VERSION" + +\header { + title = "" +} + +global = { + \time 4/4 + \key c \major + \tempo 4=100 +} + +chordNames = \chordmode { + \global + c1 + +} + +melody = \relative c'' { + \global + c4 d e f + $CURSOR +} + +words = \lyricmode { + + +} + +\score { + << + \new ChordNames \chordNames + \new FretBoards \chordNames + \new Staff { \melody } + \addlyrics { \words } + >> + \layout { } + \midi { } +} + + + + +Blank Music Sheet + +-*- template; indent: no; template-run; +\version "${LILYPOND_VERSION}" + +{ + \repeat unfold 12${CURSOR} + { + s1 + \break + } +} + +\layout { + \context { + \Score + \remove "Bar_number_engraver" + } + \context { + \Staff + \remove "Clef_engraver" + \remove "Time_signature_engraver" + \remove "Bar_engraver" + } +} + +\paper { + indent = 0 + ragged-last-bottom = ##f + top-system-spacing = #'((minimum-distance . 10)) + last-bottom-spacing = #'((minimum-distance . 10)) +} + +\header { + tagline = ##f +} + + + + + +Chor-Hymnus + +-*- template; template-run; +\version "$LILYPOND_VERSION" + +\header { + title = "" +} + +global = { + \time 4/4 + \key c \major + \tempo 4=100 +} + +soprano = \relative c'' { + \global + $CURSORc4 + +} + +alto = \relative c' { + \global + c4 + +} + +tenor = \relative c' { + \global + c4 + +} + +bass = \relative c { + \global + c4 + +} + +verseOne = \lyricmode { + \set stanza = "1." + hi + +} + +verseTwo = \lyricmode { + \set stanza = "2." + ha + +} + +verseThree = \lyricmode { + \set stanza = "3." + ho + +} + +\score { + \new ChoirStaff << + \new Staff \with { + midiInstrument = "choir aahs" + instrumentName = \markup \center-column { S A } + } << + \new Voice = "soprano" { \voiceOne \soprano } + \new Voice = "alto" { \voiceTwo \alto } + >> + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #CENTER + } \lyricsto "soprano" \verseOne + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #CENTER + } \lyricsto "soprano" \verseTwo + \new Lyrics \with { + \override VerticalAxisGroup #'staff-affinity = #CENTER + } \lyricsto "soprano" \verseThree + \new Staff \with { + midiInstrument = "choir aahs" + instrumentName = \markup \center-column { T B } + } << + \clef bass + \new Voice = "tenor" { \voiceOne \tenor } + \new Voice = "bass" { \voiceTwo \bass } + >> + >> + \layout { } + \midi { } +} + + + + +Einzelne typografische Anführungszeichen + +Ctrl+' + +-*- menu: text; python; +import lasptyqu +left, right = lasptyqu.preferred().secondary +if text: + text = left + text + right +else: + text = [left, CURSOR, right] + + + + +Entkommentieren + +Ctrl+Alt+C, Ctrl+Alt+U + +-*- python; indent: no; menu: comment; +import re + +def main(): + text = globals()['text'] + # determine state + for s in state[::-1]: + if s in ('lilypond', 'html', 'scheme'): + break + else: + s = 'lilypond' + + def html(text): + if text: + text = text.replace('<!-- ', '') + text = text.replace(' -->', '') + text = text.replace('<!--', '') + text = text.replace('-->', '') + return text + + def lilypond(text): + if text.lstrip().startswith('%{'): + if text.lstrip().startswith('%{ '): + text = text.lstrip()[3:] + else: + text = text.lstrip()[2:] + if text.rstrip().endswith('%}'): + text = text.rstrip()[:-2] + else: + if not text: + cursor.select(cursor.BlockUnderCursor) + text = cursor.selection().toPlainText() + text = re.compile(r'^(\s*)%+ ?', re.M).sub(r'\1', text) + return text + + def scheme(text): + return re.compile(r'^(\s*);+', re.M).sub(r'\1', text) + + if s == 'lilypond': + text = lilypond(text) + elif s == 'html': + text = html(text) + elif s == 'scheme': + text = scheme(text) + + if text != cursor.selection().toPlainText(): + cursor.insertText(text) + + + + + +Farbe + +-*- name: col; python; icon: applications-graphics; + +# Insert a color from a dialog + + +import inputdialog +colors = { + (0, 0, 0): "black", + (255, 255, 255): "white", + (255, 0, 0): "red", + (0, 255, 0): "green", + (0, 0, 255): "blue", + (0, 255, 255): "cyan", + (255, 0, 255): "magenta", + (255, 255, 0): "yellow", + (128, 128, 128): "grey", + (128, 0, 0): "darkred", + (0, 128, 0): "darkgreen", + (0, 0, 128): "darkblue", + (0, 128, 128): "darkcyan", + (128, 0, 128): "darkmagenta", + (128, 128, 0): "darkyellow", +} + +color = inputdialog.getColor(view) +if color is not None: + rgb = color.getRgb()[:-1] + + if rgb in colors: + text = '#' + colors[rgb] + else: + rgb = tuple(map(lambda v: format(v / 255.0, ".4"), rgb)) + text = "#(rgb-color {0} {1} {2})".format(*rgb) + + + + +Fretchord bauen + +\group-verses { + \vspace #2 + \nochordverse #"5." + #" " + \fret-chord #"x;o;1;2;1;2;" #"a:dim7" + } + + + +Katergorien + +categories = "fahrt geschunkel ost" + +% abend anti fahrt feier geschunkel herz irisch jahr jiddisch kanon medi morgen nord ost reisser russisch satz see trist volk Wandern + % bis zu drei Kategorien + + + +Keine Tagline + +-*- name: nt; python; menu: properties; +text = 'tagline = ##f' +if state[-1] != 'header': + text = '\\header {\n%s\n}' % text + + + + +Keine Taktzahlen + +-*- name: nb; python; menu: properties; +text = r'\remove "Bar_number_engraver"' +if state[-1] not in ('context', 'with'): + text = '\\context {\n\\Score\n%s\n}' % text + if state[-1] != 'layout': + text = '\\layout {\n%s\n}' % text + + + + +Letzte Note oder Akkord + +Ctrl+; + +-*- python; menu: music; symbol: note_ellipsis; +# This snippet reads back the last entered note or chord and +# inserts it again. It removes the octave mark from a note of the first +# note of a chord if the music is in relative mode. + +import lydocument +import ly.lex.lilypond as lp + +# space needed before cursor? +block = cursor.document().findBlock(cursor.selectionStart()) +beforecursor = block.text()[:cursor.selectionStart()-block.position()] +spaceneeded = bool(beforecursor and beforecursor[-1] not in "\t ") + +chordstart, chordend = None, None +notestart = None +relative = False +found = False + +c = lydocument.cursor(cursor) +runner = lydocument.Runner.at(c, True) + +for t in runner.backward(): + if t == '\\relative': + relative = True + break + elif isinstance(t, (lp.Score, lp.Book, lp.BookPart, lp.Name)): + break + if found: + continue + if chordend is not None: + if isinstance(t, lp.ChordStart): + chordstart = runner.position() + found = True + continue + if isinstance(t, lp.ChordEnd): + chordend = runner.position() + len(t) + elif isinstance(t, lp.Note) and t not in ('R' ,'q', 's', 'r'): + notestart = runner.position() + found = True + +if found: + if chordstart is not None: + text = [] + removeOctave = 1 if relative else 0 + c.start, c.end = chordstart, chordend + for t in lydocument.Source(c): + # remove octave from first pitch in relative + if isinstance(t, lp.Note): + removeOctave -= 1 + elif isinstance(t, lp.Octave) and removeOctave == 0: + continue + text.append(t) + text = ''.join(text) + elif notestart is not None: + text = [] + c.start, c.end = notestart, None + for t in lydocument.Source(c): + if isinstance(t, lp.Note): + text.append(t) + elif not relative and isinstance(t, lp.Octave): + text.append(t) + else: + break + text = ''.join(text) + if spaceneeded: + text = " " + text + + + + +MIDI-Tempo + +-*- name: mt; python; +text = ['tempoWholesPerMinute = #(ly:make-moment ', CURSOR, '100 4)'] +if state[-1] not in ('context', 'with'): + text = ['\\context {\n\\Score\n'] + text + ['\n}'] + if state[-1] != 'midi': + text = ['\\midi {\n'] + text + ['\n}'] + + + + +Moderne Taktart + +-*- name: 22; +\numericTimeSignature +\time 2/2 + + + +N-Tolen + +Ctrl+3 + +-*- menu: blocks; selection: strip; +\tuplet 3/2 { $SELECTION } + + + +Note in Klammern + +\parenthesize d + + + +Notenzeilen-Größe + +-*- name: ss; python; +if state[-1] == 'music': + text = ( + "\\set Staff.fontSize = #-1\n" + "\\override Staff.StaffSymbol #'staff-space = #(magstep -1)\n") +else: + text = ( + "fontSize = #-1\n" + "\\override StaffSymbol #'staff-space = #(magstep -1)") + if state[-1] == 'new': + text = '\\with {\n%s\n}' % text + elif state[-1] not in ('context', 'with'): + text = '\\context {\n\\Staff\n%s\n}' % text + if state[-1] != 'layout': + text = '\\layout {\n%s\n}' % text + + + + +Nächste Leerzeile + +Alt+Down + +-*- python; indent: no; + +import cursortools + +def main(): + block = cursortools.next_blank(cursor.block()) + if block: + cursor.setPosition(block.position() + block.length() - 1) + return cursor + + + + + +Repeat unfold + +-*- menu: blocks; name: repunf; selection: strip; +\repeat unfold 2$CURSOR { $SELECTION } + + + +Tagline mit Datum und LilyPond-Version + +tagline = \markup { + Engraved at + \simple #(strftime "%Y-%m-%d" (localtime (current-time))) + with \with-url #"http://lilypond.org/" + \line { LilyPond \simple #(lilypond-version) (http://lilypond.org/) } +} + + + + +Taktart (Zahl mit Note) + +-*- name: tac; +\once \override Staff.TimeSignature #'style = #'() +\once \override Staff.TimeSignature #'stencil = #ly:text-interface::print +\once \override Staff.TimeSignature #'text = \markup { + \override #'(baseline-skip . 0.5) + \column { \number $CURSOR1$ANCHOR \tiny \note #"2" #-.6 } +} + + + + +Titelgröße + + titlesize = 8 + + + +Tonart + +\key c \major + % major=dur, minor=moll, + % 1# g-dur & e-moll, 2# d-dur und h-moll, 3# a-dur und fis-moll, 4# e-dur und cis-moll, 5# h-dur und gis-moll 6# fis-dur und dis-moll + % 1b f-dur und d-moll,2b b-dur und g-moll, 3b es-dur und c-moll, 4b as-dur und f-moll, 5b des-dur und b-moll, 6b ges-dur und es-moll + + + + +Unterstreichen textstrophe + +\\underline { } + + + +Wiederholung + +Ctrl+Shift+R + +-*- menu: blocks; name: rep; selection: strip; symbol: bar_repeat_start; +\repeat volta 2 { $SELECTION } + + + +Wiederholung textstrophe + +\\repStart \\repStop + + + +Wähle bis zur nächsten Leerzeile aus + +Alt+Shift+Down + +-*- python; indent: no; + +import cursortools + +def main(): + block = cursortools.next_blank(cursor.block()) + if block: + cursor.setPosition(block.position() + block.length() - 1, cursor.KeepAnchor) + return cursor + + + + + +Wähle bis zur vorherigen Leerzeile aus + +Alt+Shift+Up + +-*- python; indent: no; + +import cursortools + +def main(): + block = cursortools.previous_blank(cursor.block()) + if block: + cursor.setPosition(block.position() + block.length() - 1, cursor.KeepAnchor) + return cursor + + + + + +Zeile(n) löschen + +Ctrl+K + +-*- python; + +import cursortools + +def main(): + start = end = cursortools.block(cursor) + while end.position() + end.length() < cursor.selectionEnd(): + end = end.next() + cursor.setPosition(start.position()) + cursor.setPosition(end.position(), cursor.KeepAnchor) + cursor.movePosition(cursor.EndOfBlock, cursor.KeepAnchor) + cursor.movePosition(cursor.NextBlock, cursor.KeepAnchor) + cursor.removeSelectedText() + + + + + +\header-Vorlage + +-*- name: h; menu: blocks; +\header { + title = "$CURSOR" + composer = "" + tagline = \markup { + Engraved at + \simple #(strftime "%Y-%m-%d" (localtime (current-time))) + with \with-url #"http://lilypond.org/" + \line { LilyPond \simple #(lilypond-version) (http://lilypond.org/) } + } +} + + + + + +<shortcuts /> +<body>-*- name: oo; +\once \override </body> +</snippet> + +<snippet id="1voice"> +<title /> +<shortcuts> +<shortcut>Alt+0</shortcut> +</shortcuts> +<body>-*- name: 1v; +\oneVoice</body> +</snippet> + +<snippet id="score"> +<title /> +<shortcuts /> +<body>-*- menu: blocks; +\score { + $SELECTION + \layout {} + \midi {} +} +</body> +</snippet> + +<snippet id="stanza1"> +<title /> +<shortcuts /> +<body>-*- name: s1; +\set stanza = "1." +</body> +</snippet> + +<snippet id="stanza2"> +<title /> +<shortcuts /> +<body>-*- name: s2; +\set stanza = "2." +</body> +</snippet> + +<snippet id="stanza3"> +<title /> +<shortcuts /> +<body>-*- name: s3; +\set stanza = "3." +</body> +</snippet> + +<snippet id="stanza4"> +<title /> +<shortcuts /> +<body>-*- name: s4; +\set stanza = "4." +</body> +</snippet> + +<snippet id="stanza5"> +<title /> +<shortcuts /> +<body>-*- name: s5; +\set stanza = "5." +</body> +</snippet> + +<snippet id="stanza6"> +<title /> +<shortcuts /> +<body>-*- name: s6; +\set stanza = "6." +</body> +</snippet> + +<snippet id="voice4"> +<title /> +<shortcuts> +<shortcut>Alt+4</shortcut> +</shortcuts> +<body>-*- name: v4; +\voiceFour</body> +</snippet> + +<snippet id="voice1"> +<title /> +<shortcuts> +<shortcut>Alt+1</shortcut> +</shortcuts> +<body>-*- name: v1; +\voiceOne</body> +</snippet> + +<snippet id="voice3"> +<title /> +<shortcuts> +<shortcut>Alt+3</shortcut> +</shortcuts> +<body>-*- name: v3; +\voiceThree</body> +</snippet> + +<snippet id="voice2"> +<title /> +<shortcuts> +<shortcut>Alt+2</shortcut> +</shortcuts> +<body>-*- name: v2; +\voiceTwo</body> +</snippet> + +<snippet id="n597649"> +<title>anführungszeichen + +„ “ + + + +apostroph + +’ + + + +bridge noten + +bridge = \relative c'' { + \global + \repeat volta2{ + d2 a2 + \tuplet3/2{g4 a h} fis2 + d'2 a2 + d4 cis h r4^\markup{3x} + } + \bar "|." +} + + + +bridge noten + +bridge = \relative c'' { + \global + \repeat volta2{ + d2 a2 + \tuplet3/2{g4 a h} fis2 + d'2 a2 + d4 cis h r4^\markup{3x} + } + \bar "|." +} + + + + +bridge text + einbau in group-verses + + + \score { + << + \chords { g2 d2 fis2 h2:m g2 d2 fis2 h4:m} + \new Staff { \bridge } + \addlyrics { + \set stanza = "Bridge:" + Jo, ho, ho, ho, ho, ho. Jo, ho ho ho ho. } + >> \layout { \generalLayout } + } + + + +fermate + +\fermata + + + +fett in textstrophe + +\\bold { } + + + +klammern gepunktet + +\once \slurDotted c4 + + + +klammern gepunktet ignorieren: + + \set ignoreMelismata = ##t dei -- ner \unset ignoreMelismata + + + + +klammern um Akkord in textstrophe + +(jetzt,\\\\klamm{d:m}) + + + +klammern um textstrophe + +\\concat{\\char ##x28 Klammer} auf und Klammer \\concat{zu \\char ##x29 }" + + + +kursiv in textstrophe + +\\italic { } + + + +markup unter den Noten + +_\markup {\italic "čaj’ šukarije!"} + + + +markup über den Noten + +^\markup {\italic "čaj’ šukarije!"} + + + +page-count + +% nach HEADER = \bookpart { + \paper { + %page-count = #1 + } + + + +spalten + +\override #'(verse-hspace . 2) % horizontaler Abstand zwischen den Spalten + \override #'(verse-vspace . 2) % vertikaler Abstand zwischen den Zeilen + \override #'(verse-cols . 2) % Anzahl der Spalten + % vspace funktioniert hier nicht mehr! + \group-verses { + \chordverse #"8." + #" " + + \chordverse #"9." + #" " + + \chordverse #"10." + #" " + } + + + +taktwechsel + +\time 4/4 + + + +trennstrich + +– + + + +triolen + +\tuplet 3/2{cis4 d e} + + + +wiederholung mit klammer 1 und 2 + +\repeat volta 2 { + c4 g'8 g4 g8 + g4 d8 d4 d8 + f4 f8 f (g) f } + \alternative { + {g es4~es4 es8} + {g4 d8 d d4} + } + + + +zweite Stimme in die Notenzeile + +{ "noten einzelstimme" << { \voiceOne "noten" + } \new Voice { \voiceTwo \secondVoiceStyle "noten" + }} >> \oneVoice + + +