With careful listening and consideration, I identified three important factors:
- Some of the instruments are out of tune by as much as a half step.
- At any point in the song, some fraction of the kids are not playing the written note, but choosing an alternative interpretation, plus or minus a major third.
- At any time, a kid might pop an overtone, playing a note at 2, 3, 4, or even 5 times the intended frequency (look out, David Sanborn!).
I implemented these effects with this function, which takes a MIDI number representing the written note and returns the chosen frequency:
def random_freq(midi_num):
# simulate poor tuning by adding
# gaussian noise to the MIDI number
midi_num += random.gauss(0, 0.5)
# one kid out of 10 plays the wrong note
if random.random() < 0.1:
midi_num += random.randint(-5, 5)
freq = midi_to_freq(midi_num)
# and one kid in 10 pops an overtone
if random.random() < 0.1:
freq *= random.randint(2, 5)
return freq
To hear what it all sounds like, check out this IPython notebook. I hope you enjoy it as much as I enjoyed last night's performance!
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.