Suppress end-of-line key signature change
Hi. By default LP will add the new key signature to the end of a line if the next line has a key signature change (as per this example). Is there an easy way to suppress this behaviour? For pedagogic exercises like these scales it is not really needed TIA! ---[ ex ]--- \version "2.22" melody = \relative c'' { \clef treble \time 4/4 \set Staff.printKeyCancellation = ##f \key c \major c8 d e f g a b c | \bar "||" \key f \major f,8 e d c bes a g f | \bar "||" \break \key bes \major bes8 c d ees f g a bes | \bar "||" \key ees \major ees,8 d c bes aes g f ees | \bar "||" } \score { << \melody >> } ---[ end ex ]--- -- -mark.
Re: Conditional fermata padding
Thank you very much, Lukas! Well, I didn't want to bother so much with more conditions. They are namely: only sharp accidentals and only notes starting from the fourth line and higher when the stem is down. For my use case I would just add those extra conditions in abjad. The reason why we have now a default fermata padding of 0.4 and not 0.5, for example, is that the padding should ideally be intelligent enough to cater for these special conditions. 0.4 is for now a universal compromise. Am Do., 8. Sept. 2022 um 12:30 Uhr schrieb Lukas-Fabian Moser : > Hi Martín, > Am 08.09.22 um 10:52 schrieb Martín Rincón Botero: > > I would like to have less padding for a fermata when a note has an > accidental. Say, if the fermata has a padding of x, I would like it be > x-0.1 or so when the note in question has an accidental. I would be > thankful for a snippet :-). > > Scripts (like a fermata) can be added to a chord (instead of a single note > head); which note's accidentals should then be considered? > > Anyway, the following snippet changes the padding of a fermata if _any_ of > the note heads in the fermata's note column has an accidental: > > \version "2.23.10" > > mus = \relative { > f''4 fis fis > > } > > { > \override Script.before-line-breaking = > #(lambda (script-grob) > (let* > ((script-cause (ly:grob-property script-grob 'cause)) >(articulation-type (ly:event-property script-cause > 'articulation-type)) >(default-padding (ly:grob-property script-grob 'padding)) >(note-column (ly:grob-parent script-grob X)) >(note-heads (ly:grob-array->list > (ly:grob-object note-column 'note-heads))) >(accidentals > (map > (lambda (note-head) (ly:grob-object note-head 'accidental-grob)) > note-heads))) > (if (and (eq? articulation-type 'fermata) >(any ly:grob? accidentals)) > (ly:grob-set-property! script-grob 'padding > (+ default-padding 2) > > \time 2/4 > << \mus \repeat unfold 6 s4\fermata >> > % tenuto (and staccato, ...) should not be changed > << \mus \repeat unfold 6 s4\tenuto >> > > } > > Note that this needs a fairly recent LilyPond version, since we changed > the 'articulation-type from a string to a symbol at the end of 2021. > > Lukas > -- www.martinrinconbotero.com
Re: Use of NeoVim and Lilypond
Hi Colin, It should work this way ! Can you try with a minimal nvim config ? e.g. : call plug#begin() Plug 'martineausimon/nvim-lilypond-suite' Plug 'MunifTanjim/nui.nvim' call plug#end() Let me know ! Thanks, Simon -- https://www.simonmartineau.com/ +33 (0)6 17 94 06 72
Re: custom chord (Stan Sanderson)
> > Stan, > > Here is one way to do it. > > > \version "2.22.2" > > % Define your chord usage > % Here, I am interpreting the "sus 4/2", which is an unusual symbol, as > replacing the 3rd in a major chord with both the 2nd and 4th degrees, so 1 2 > 4 5 > myChordSequence = \chordmode { > \set chordChanges = ##t > fis1:1.2.4.5 > } > > % Define your desired chord symbol design > % here is some formatting that is in the ballpark, but you will probably want > to tweak further, based on your font and design goals > myChordExceptions = { > 1-\markup { \small " sus" \raise #2.25 { \tiny \center-column { > \lower #1.25 { " 4" } " 2" } } } > } > > % Replace the old chord symbol with your new one > chordExceptions = #(append (sequential-music-to-chord-exceptions > myChordExceptions #t) ignatzekExceptions) > > % Use the new chord symbol > << > \new ChordNames { > \set chordNameExceptions = #chordExceptions > \myChordSequence > } > \new Staff \relative c'' { gis1 } > >> Elaine, Perfect! Thank you for your explanation and solution. It is not only in the ballpark, but also right on the money. Stan
Re: Use of NeoVim and Lilypond
Colin, I think I have it : The plugin use api functions only available in Neovim 0.7.0+ : https://github.com/nanotee/nvim-lua-guide/blob/master/README.md#defining-user-commands What is your current version ? (type `:version` in nvim) On Thu, Sep 08, 2022 at 09:22:49AM +0100, Colin Baguley wrote: Hi Jean Thank you so much for that link - at first glance it looks perfect but I'm afraid at the moment I can't get it to work - probably because of my inexperience and ineptitude rather than a fault with the program! I have added the two required plugins to my init-vim, and have run :PlugInstall but I'm not sure what to do from here. I opened a test.ly lilypond file and I assumed I could test by running (in nvim) the command :LilyCmp to compile it but the error came up as E492 Not an Editor Command Do you have any suggestions as what to do next? Thank you for your time Colin On Wed, 7 Sept 2022 at 19:13, Jean Abou Samra wrote: Le 07/09/2022 à 20:11, Colin Baguley a écrit : > Hi - I realise there are some instructions for integrating 'vim' and > 'lilypond' but could anybody point me where to look for how to use > 'neovim' - which is supposed to be an advance on 'vim' - it certainly > uses different configuration files. > vim uses ~/.vimrc > neovim uses ~/.config/nvim/init.vim > Can we still use the same plugin for neovim > Thanks for your help Have you seen this? https://github.com/martineausimon/nvim-lilypond-suite Best, Jean -- https://www.simonmartineau.com/ +33 (0)6 17 94 06 72
Re: Conditional fermata padding
Hi Martín, Am 08.09.22 um 10:52 schrieb Martín Rincón Botero: I would like to have less padding for a fermata when a note has an accidental. Say, if the fermata has a padding of x, I would like it be x-0.1 or so when the note in question has an accidental. I would be thankful for a snippet :-). Scripts (like a fermata) can be added to a chord (instead of a single note head); which note's accidentals should then be considered? Anyway, the following snippet changes the padding of a fermata if _any_ of the note heads in the fermata's note column has an accidental: \version "2.23.10" mus = \relative { f''4 fis fis } { \override Script.before-line-breaking = #(lambda (script-grob) (let* ((script-cause (ly:grob-property script-grob 'cause)) (articulation-type (ly:event-property script-cause 'articulation-type)) (default-padding (ly:grob-property script-grob 'padding)) (note-column (ly:grob-parent script-grob X)) (note-heads (ly:grob-array->list (ly:grob-object note-column 'note-heads))) (accidentals (map (lambda (note-head) (ly:grob-object note-head 'accidental-grob)) note-heads))) (if (and (eq? articulation-type 'fermata) (any ly:grob? accidentals)) (ly:grob-set-property! script-grob 'padding (+ default-padding 2) \time 2/4 << \mus \repeat unfold 6 s4\fermata >> % tenuto (and staccato, ...) should not be changed << \mus \repeat unfold 6 s4\tenuto >> } Note that this needs a fairly recent LilyPond version, since we changed the 'articulation-type from a string to a symbol at the end of 2021. Lukas
Conditional fermata padding
Dear Scheme wizards, I would like to have less padding for a fermata when a note has an accidental. Say, if the fermata has a padding of x, I would like it be x-0.1 or so when the note in question has an accidental. I would be thankful for a snippet :-).
Re: Use of NeoVim and Lilypond
Let me look at it. Andrew On 8/09/2022 6:22 pm, Colin Baguley wrote: Do you have any suggestions as what to do next? Thank you for your time Colin
Re: Use of NeoVim and Lilypond
Hi Jean Thank you so much for that link - at first glance it looks perfect but I'm afraid at the moment I can't get it to work - probably because of my inexperience and ineptitude rather than a fault with the program! I have added the two required plugins to my init-vim, and have run :PlugInstall but I'm not sure what to do from here. I opened a test.ly lilypond file and I assumed I could test by running (in nvim) the command :LilyCmp to compile it but the error came up as E492 Not an Editor Command Do you have any suggestions as what to do next? Thank you for your time Colin On Wed, 7 Sept 2022 at 19:13, Jean Abou Samra wrote: > > > Le 07/09/2022 à 20:11, Colin Baguley a écrit : > > Hi - I realise there are some instructions for integrating 'vim' and > > 'lilypond' but could anybody point me where to look for how to use > > 'neovim' - which is supposed to be an advance on 'vim' - it certainly > > uses different configuration files. > > vim uses ~/.vimrc > > neovim uses ~/.config/nvim/init.vim > > Can we still use the same plugin for neovim > > Thanks for your help > > > > Have you seen this? > > https://github.com/martineausimon/nvim-lilypond-suite > > Best, > Jean > >