Hi Stefano,
Yes, but it gets more complicated. For example, this is something I
transcribed in drumburp:
Cr|X-------|--------|X-------|--------|
Hh|--x-x-x-|x-x-x-x-|--x-x-x-|x-x-x-x-|
HT|--------|--------|--------|----oooo|
MT|--------|--------|--------|-----o--|
Sn|--o---o-|--o---o-|--o---o-|--o---o-|
FT|--------|--------|--------|--------|
Bd|o---oo--|o---oo-o|o---oo--|o---oo-o|
1+2+3+4+ 1+2+3+4+ 1+2+3+4+ 1+2+3+4+
HT, MT, FT are the toms (high, mid, and floor). Cr is a crash cymbal,
Hh is hihat, Sn is Snare and Bd is kick drum. Not shown, but also
common are pedal hihat and other cymbals, cowbells, woodblocks,
triangles, etc. Each instrument may get it's own line, but sometimes
different note heads can indicate different instruments on the same
line.
Yes, thanks for this more feature-rich example.
I don't want to enter notes that way though. Typing tabs is not fun.
Aligning all the ascii sucks. That's why drumburp is a nice program
because graphically, it sucks much less.
Better would be some lilypond like syntax with different lines for the
different instruments like the tab I wrote above.
So you want to enter (for instance) the Cr part as a separate LilyPond
voice? In this case something like 1 R1 1 R1 or even \breve \breve? (The
point being is that you want to enter durations and rests, even though
they are in some sense arbitrary?)
What's *not* easy is:
- convert a series of zero-time events (kicks, combined kicks) into
musical notation.
It's not just that. It's interweaving the kick and combined kicks with
the other instruments grouped within that same voice.
I disagree insofar that I think that this isn't actually a complication.
Interweaving instruments simply means forming a set-theoretic union, so
to speak: We get a sum voice consisting of "a kick wherever one of the
involved instruments has a kick". Then it's just a matter of
representing the kick as one or multiple note heads, i.e. a note or a
chord at the right point of time.
Agreed. But as I said it's not just about getting the kick notes
correct. Take for example something easy:
Cr|X-------|
Hh|--x-x-x-|
Sn|--o---o-|
Bd|o---o---|
1+2+3+4+
Here if you have the bass drum grouped with snare (drums and cymbals),
then each beat is on quarters:
bd4 sn4 bd4 sn4
But if the kick drum is all by itself (hands and feet), then you could
have:
bd2 bd2
Although that would be weird. I think:
bd4 r4 bd4 r4
would be more appropriate.
To demonstrate what I mean by set-theoretic union: If you want to group
as drums+cymbals, we get the following diagram:
Cy|C-h-h-h-|
Dr|B-S-B-S-|
1+2+3+4+
where C means Crash, h means Hihat etc.
If we want to group as hands+feets, we get:
Hd|C-Z-h-Z-|
Ft|B---B---|
1+2+3+4+
where Z means "Snare plus Hihat" (and will be realised as a LilyPond
chord <snare hihat>).
So you see, the actual problem is really just that of converting a
series of "kicks" [i.e. virtual kicks comprising one or multiple
instruments being played at the same point of time] into a sequence of
durations, rests and ties.
Your last remark then forms one first rule for this: For |x---x---|, the
LilyPond realisation as 4 r4 4 r4 seems so be preferred over 2 2.
This is a very general problem - algorithmically converting a sequence
of points in musical time into a sequence of notes (/rests/ties). There
are certainly lots of possible styles, depending on musical genre, time
signature, instruments etc., but it's a problem that might be
interesting to tackle. One just should think carefuly about the desired
degree of configurability etc.
Agreed. But there are common ways to do it. Perhaps those common ways
could be used to steer decisions.
If you're interested in how one project has tackled it, have a look at
drumburp:
<https://whatang.org/>
Specifically this file (also attached):
https://github.com/Whatang/DrumBurp/blob/1.1.2/src/Notation/lilypond.py
Thanks for the links, I hope I'll have time to dive into the source soon.
Just while looking at drumburp, there are a number of example tabs of
whole songs in the git repo. I've attached the output of one of the
songs in lilypond format, tab format, and pdf. In the lilypond file, I
see some interesting functions defined:
#(define (rest-score r) ...
#(define (merge-rests-on-positioning grob) ...
But I don't yet know what they do.
In the example you posted, they seem not to do anything. But from
reading the source, I think they are supposed to act in situations where
LilyPond would create two simultaneous rests, in order to decide which
one to keep.
Lukas