On Tue, Oct 14, 2025 at 6:29 AM Lee <[email protected]> wrote:

> 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?
>

You need two score blocks, like this:

\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
  }
}

\score {
  \removeWithTag nomidi
  \new Staff \with {
    midiInstrument = "overdriven guitar"
  } \electricGuitar
   \midi {}
}

Reply via email to