Hi Tina,

I've got the score working with this code :

\version "2.25.28"


\language "english"
\header {
  title = "Riff test"
  composer = "Nelly"
}

\paper {
  #(set-paper-size "a4landscape")
}


nomidiBend =
#(define-music-function (main bend) (ly:music? ly:music?)
   #{
     \afterGrace 1/2
     { \tag nomidi <> \^ #main }
     \tag nomidi { \hideNotes #bend \undo\hideNotes }
   #})






global = {
  \time 4/4
  \key c \major

}

electricGuitar = \relative c' {
  \override NoteHead.extra-spacing-width = #'(-2 . 2)
  \tempo 4 = 90
  \unHideNotes
  \tuplet 3/2 { \nomidiBend d8\^\3 e\3 e\2 a\1 }
  \tuplet 3/2 { \nomidiBend c\^\1 cqs\3 a e\2 }
  \tuplet 3/2 { \nomidiBend g\^\2 a\1 a\1 e\2 }
  \tuplet 3/2 { d\3 c\3 a\4s }
  \unHideNotes




}

\score {
  \new StaffGroup \with {
    \consists "Instrument_name_engraver"
    instrumentName = "Electric guitar"
  } <<
    \new Staff \with {
      midiInstrument = "overdriven guitar"
      \override StaffSymbol.staff-space = #(magstep 2)
    } { \clef "treble_8" \electricGuitar }
    \new TabStaff \with {
      stringTunings = #guitar-tuning
    } \electricGuitar
  >>
  \layout {
      #(layout-set-staff-size 25)
     \omit StringNumber


  }
  \midi {
  \removeWithTag nomidi
  \tempo 4=90
  }
}


But the midi is still outputting the gracenotes.   Any ideas?

Lee

On Sun, 12 Oct 2025 at 14:46, Tina Petzel <[email protected]> wrote:

> Hi Lee,
>
> > This works but isn't ideal as I have duplicate notes.  At least it gives
> me
> > the score I want and the midi notes with no grace notes.
>
> Maybe use tags:
>
> \afterGrace #1/2 { \tag nomidi <>\^ d\3 } \tag nomidi {\once\hideNotes e\3
> }
>
> and then do `\removeWithTag nomidi ...` in your midi score.
>
> You can even put this into a convenience function like so:
>
> %%%
> nomidiBend =
> #(define-music-function (main bend) (ly:music? ly:music?)
>    #{
>      \afterGrace 1/2
>      { \tag nomidi <> \^ #main }
>      \tag nomidi { \hideNotes #bend \undo\hideNotes }
>    #})
> %%%
>
> and then do `\nomidiBend d\3 e\3`.
>
> Best regards,
> Tina

Reply via email to