lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mapping pitches to other pitches when generating MIDI files for percussi


From: Vinicius Mascarenhas
Subject: Mapping pitches to other pitches when generating MIDI files for percussion?
Date: Tue, 13 Nov 2018 01:22:41 -0200

Hey y’all,

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?

Rationale if you’re curious (feel free to skip it though):

I’m writing for a group that mostly plays drums — to be more precise, taiko 
drums. We rely on vertical position a lot so I can’t just use DrumStaff of 
RhythmicStaff, which print all notes on the line. Instead I override the staff 
symbol line positions to create a one-line staff for the most part, or an 
N-line staff for the occasions where the same person has N distinct drums to 
play simultaneously. This staff is a regular, pitched staff. Like you could 
write a piano piece on it, even though it only has one line, which is the line 
a b pitch falls on if you’re going treble clef. Oh and I also change the clef 
glyph so it looks like a percussion clef but it’s really still the old treble 
clef.

All in all, pitches are written like c and a because c is the first pitch above 
the line and a is the first pitch below it. It’s basically a two-key piano for 
all intents and purposes. We use those two vertical positions for hand 
selection when playing on a single drum, and this is super important to taiko 
performers everywhere, so it’s not something I could just decide to rule out. 
However, no matter which hand you use to play the drum, the sound should be the 
same.

When using multiple drums though, sometimes those drums are of the same kind 
(and should still sound the same), and sometimes they’re different instruments 
entirely. So making the whole staff sound like a single pitch wouldn’t work. I 
need to map some pitches that appear in the PDF to one sound in the MIDI file 
(like say map both c and a to b,) and still be able to map other pitches to 
another sound (e.g. map f, and e, to g,,).

How can I do this with Lilypond? The only way I see is by using a find and 
replace command for all pitch occurrences and saving the result in a different 
variable for a different score that will only produce the midi output. But this 
is a little convoluted and needs to be redone every time a change is made. Not 
to mention it gets crazy with markups and other commands — even though they’re 
not going to be displayed in the midi file, they still cause trouble with the 
parser. Surely there’s a magic way to achieve this more easily?

Thanks in advance! <3


reply via email to

[Prev in Thread] Current Thread [Next in Thread]