back to list

Re: [MMM] Improvisation on pitches from a recording of a song thrush

🔗Carl Lumma <ekin@...>

4/13/2005 1:34:20 PM

>Hi there,
>
>http://www.robertinventor.com/improvisation_on_thrush_song_pitches.mp3
>
>[4 Mb]
>
>Robert

Fascinating! How'd you do it? -Carl

🔗Danny Wier <dawiertx@...>

4/13/2005 7:20:30 PM

Robert Walker wrote:

> Hi there,
>
> http://www.robertinventor.com/improvisation_on_thrush_song_pitches.mp3

I liked it, and I intend to use it for ear training.

I know it's not a real violin, but it sounds pretty close. (I have got to start saving for a better synth.)

🔗Robert Walker <robertwalker@...>

4/13/2005 11:06:55 PM

Hi Carl,

> Fascinating! How'd you do it? -Carl

Used FTS 3.0 release candidate for the pitch recognition to make a scale
out of the pitches in the song - it's a development of the exact wave count
+ interpolation of zero crossings method that I was working on a few years
ago - do you remember the midi bird songs I did before?

It's speciality is to find the pitch very exactly for single melodic lines
on suitable voices with easy to locate waveforms particularly.

So, it only works for single melodic lines and for suitable timbres. Bird
song
happens to be suitable apart from one thing - you get
long slow and rather irregular undulations in the waveform.

Like this:
,, , ,
, , , , ,,
, , ,, , , , , ,,
.,. .,....................,,.......,....,...,........
,, ,,, , ,
,,
etc. The waveform itself is easy to follow, just a sine wave,
apart from those superimposed undulations which naturally
confuse a program which relies on counting
the places where the waves cross the zero line - quite often the
waveform actually misses the zero line altogether. You get the same
thing with whistling. I'm not quite sure what they are since
if you remove them then it still sounds pretty much the same
as it did before. They are very low frequency and I'm not
sure really what they are.

Here is an example:

http://www.robertinventor.com/robin.png

As you see the slow undulation is irregular, and at
a frequency of about 20 Hz in this particular example.

It's an 8-bit recording which is why it is so spiky.

Anyway, I found a way to deal with those by an averaging process
which brings the undulations all back down to the zero line
(though this part of the programming can do with some more work
still).

Here is what it can do - but you have to select a kind of magic
time interval by trial and error which copes best with the particular
undulations found. That's where I may be able to improve it at some
later point with some thought. Anyway this is the result:

Then with the undulations removed:

http://www.robertinventor.com/robin_averaged.png

Then FTS can order all the pitches found in ascending order
to make a scale you can play in.

For the thrushes song, here is the scale it found:

http://www.robertinventor.com/improvisation_on_thrush_song_pitches.txt

Then I used FTS to retune my playing to the scale, and improvised
from a keyboard plugged into my laptop using the Dan Dean Solo strings
violin voice in VSampler. Recorded it to midi as I played so that the midi
file is vailable for use if I want to render it some other way later on,
then to make he mp3 I just played the midi file again and recorded it to
audio as it played hrough VSampler. That is pretty much how I do all my
improvised pieces.

The presets for the next release of FTS 3.0 should be suitable already
for many bird song recordings.

Here is its midi rendering of a robin's song made using the FTS 3.0 release
candidate:
http://www.robertinventor.com/Robin.mid

:-)

You can compare it with the original recording of a robin's song at
http://www.scricciolo.com
on this page:

http://www.scricciolo.com/eurosongs/canti.htm
scroll down to European Robin Erithacus rubecula

http://www.scricciolo.com/eurosongs/Erithacus.rubecula.wav

I know that it doesn't sound exactly the same particularly at the
end. If you listen to short sections and compare them then
you do hear the pitches that it finds (usually anyway),
but the overall impression isn't quite the same, for instance
it may play particular pitches a bit longer than they should
or shorter. It probably picks out different pitches
from the ones we notice most.

It does also sometimes find spurious pitches that aren't there
at all, perhaps because of chance regular patterns in noise or inharmonic
sections of the wave sometimes. But I'm hopeful that with more
work it will make midi clips that sound more and more like
what we hear.

I don't think it will ever be perfect in a completely
automatic sense - at least it will have several presets, e.g. high pitched
bird song, middle and low, and one will have to audition it and see which
of those work best, and then perhaps there may be other bird song
ones, and then one would probably still need to tweak it if the settings
used give extra notes, but it is getting easier to use the more
I work on it.

The original audio clips on that site btw are for
non commercial use only. Surely it is all right to just
use them like this to post an example of the technique here,
to show how it works, but I'll need to contact the author or
find other clips if I use them in the documentation for FTS.

Or who knows, maybe I'll have a go at
doing my own recordings some time. I gather that for
recording individual song birds, really you manage it best
with a parabolic reflector type microphone. With my new laptop,
if I get a decent sound USB card and a parabolic reflector
at some point, I would have a reasonable bird song recording
field station. Though maybe I don't want to splash out right
away.

Robert

🔗Carl Lumma <ekin@...>

4/14/2005 1:40:25 AM

>Hi Carl,
>
>> Fascinating! How'd you do it? -Carl
>
>Used FTS 3.0 release candidate for the pitch recognition to make a
>scale out of the pitches in the song - it's a development of the exact
>wave count + interpolation of zero crossings method that I was working
>on a few years ago - do you remember the midi bird songs I did before?

Hi Robert,

Yes, I remember that, and thanks for the explanation.

This sort of thing could be useful not only for bird song, but for
extracting scales from traditional music!

May I ask, how do you cope with note transitions? How do you decide
what discrete pitches to choose? Surely the thrush does not sing in
discrete pitches.

My suggestion for extracting scales from melodic performances is as
follows. Normal audio signals plot energy over time. After continuous
pitch extraction, we have pitch over time. If we apply a time-domain
transform to *that*, we have 'pitch frequencies' -- the amount of time
the performer spent playing each pitch in the entire performance (the
duration of musical tones is typically great compared to the period of
musical pitches, so I think we're OK here). We can now slice the pitch
continuum into octaves, and in each octave hopefully see a manageable
number of Gaussian lumps (if not, we might say there is no discrete
scale abstraction used in the performance). When we superimpose these
octave slices, a majority of lumps hopefully coincide. Finally, the
local maxima of this summed function are written to a Scala file.

Does this make sense? Perhaps we should take this to the tuning
list...

-Carl