bug-lilypond
[Top][All Lists]
Advanced

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

info on "expressively" playing MIDI


From: Silas S. Brown
Subject: info on "expressively" playing MIDI
Date: Wed, 1 Oct 2003 23:18:51 +0100

Hi,

Something for the "wishlist" of future work: playing MIDI a
little more "expressively".  In my own music program (which
is a bit hacky) I used the following algorithm, and I just
thought describing it would be a good idea so you can
use/adapt/whatever (I'm using description rather than code
because you really don't want to see my code).  Please put
this message somewhere where the developers can use it when
they want to.

There is subtlely more volume on the first beat of each bar;
also more volume at the start of each beaming group and
half-way through bars in duple time (but less than the
first-beat accent).  I found volume increases of 20% for the
first beat and 15% for the others worked about OK, but you
may want to use less than that.

I also made the volume of every note vary at random by about
2% (this helps reduce the "robotic" sound).

Another little trick which helps is this: For each voice,
take the average pitch in each bar that it is playing; call
the average pitch of bar X "A[X]".  If in any bar X (for
X>2), A[X] lies outside the range of A[X-1] and A[X-2]
(i.e. it is higher than the maximum of the two, or lower
than the minimum of the two), AND if the sign of A[X]-A[X-1]
is different from the sign of A[X-1]-A[X-2] (i.e. there has
been a turn-around, or movement after a passage of
non-movement), then notes in bar X are candidates for a
little more volume.  In other words, more volume if the
following expression is true:

((A[X]>A[X-1])!=(A[X-1]>A[X-2]) || A[X-1]==A[X-2]) &&
((A[X]>A[X-1])?A[X]>A[X-2]:A[X]<A[X-2])

Finally, if the first note in any bar is longer than the
maximum length of any note in the previous bar (again this
is done on a voice-by-voice basis), then that longer note is
a candidate for slightly more volume.

Of course, you should be careful that the modified volume
figure does not go out of range.

The algorithm does not sound quite as good as "Sibelius" but
it's better than nothing; it certainly makes checking scores
a slightly nicer experience.

Best wishes,         Silas

-- 
Silas S Brown, St John's College Cambridge UK http://www.cus.cam.ac.uk/~ssb22

"Return your sword to its place, for all those who take the sword will
perish by the sword" - Matthew 26:52




reply via email to

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