Hi Aaron,

Thank you for replying. This could really help. I'm going to look at it
when I get home, but what I can tell you right now is that I've
experimented with making a custom pitch name language file — not remotely
resembling your solution — and I came across one big problem: it was a
work-wide change that affected all staves across all included files.

This is only a problem because most of our pieces have one or two staves
for flutes. So I have to keep the custom pitch names local; otherwise,
every time I need to play a b, if I'm not mistaken, I'd need to type "trh"
instead of "b" or "si". However, this line in your code:

drumPitchTable = #(alist->hash-table midiDrumPitches)

Makes me think your solution IS local rather than the global scope. Is this
correct? Like do pitch names remain unchanged for voices used in staves
where this line is not present? Sorry if the question is silly; I can't run
the code you adapted or the one provided in the link right now.

Thanks again,
Vinicius

On Tue, Nov 13, 2018, 05:55 Aaron Hill <lilyp...@hillvisions.com> wrote:

> On 2018-11-12 7:22 pm, Vinicius Mascarenhas wrote:
> > TLDR: I need to map different pitches displayed in the layout block /
> > PDF file to a single sound in the midi block / file (like say map both
> > c and a to b,) but I can’t to that to the whole staff — I need to be
> > able to map other sets of pitches to another single sound. Can
> > Lilypond do this?
>
> Sounds like what could work is to define your own drum pitch names.
> These would have different visual appearance in the notation but can map
> to the same MIDI note.  See the following:
>
>
> http://lilypond.org/doc/v2.19/Documentation/snippets/midi#midi-customize-drumpitchnames-drumstyletable-and-drumpitchtable-in-layout-and-midi
>
> Here is a adaptation of that snippet for a simple left-hand and
> right-hand taiko where the left-hand marking lies below and the
> right-hand above.
>
> %%%%
> \version "2.19.82"
>
> drumPitchNames.taikolefthand  = #'taikolefthand
> drumPitchNames.tlh            = #'taikolefthand
> drumPitchNames.taikorighthand = #'taikorighthand
> drumPitchNames.trh            = #'taikorighthand
>
> #(define taikoStyle
>    '((taikolefthand  default #f -1)
>      (taikorighthand default #f  1)))
>
> midiDrumPitches.taikolefthand = e
> midiDrumPitches.taikorighthand = e
>
> \score {
>    \new DrumStaff
>    \with {
>      \override StaffSymbol.line-count = #1
>      instrumentName = #"Taiko"
>      drumStyleTable = #(alist->hash-table taikoStyle)
>      drumPitchTable = #(alist->hash-table midiDrumPitches)
>    }
>    \drummode {
>      \set Staff.midiInstrument = #"taiko drum"
>      \tempo 2 = 60
>      tlh4. trh16 tlh trh2 | tlh8. tlh16~ 8 tlh trh2
>    }
>    \layout {}
>    \midi {}
> }
> %%%%
>
> -- Aaron Hill_______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to