Live data from Hacker News

Transcribing Piano Rolls, the Pythonic Way

zulko.github.io

11–20 of 38 posts

Re: Transcribing Piano Rolls, the Pythonic Way

#11
post #10

See a master at work making original rolls at QRS. http://www.youtube.com/watch?v=i3FTaGwfXPM If was a fun place to see in the 70's after watching my father rebuild our player piano.

excellent to see the Apple //e [1] http://youtu.be/i3FTaGwfXPM?t=4m28s

Re: Transcribing Piano Rolls, the Pythonic Way

#13
post #10

See a master at work making original rolls at QRS. http://www.youtube.com/watch?v=i3FTaGwfXPM If was a fun place to see in the 70's after watching my father rebuild our player piano.

Interesting that they used computers to make them. It seems obvious in hindsight; player piano music is digital!

Re: Transcribing Piano Rolls, the Pythonic Way

#15
The faster way of doing this:

    def fourier_transform(signal, period, tt):
        """ See http://en.wikipedia.org/wiki/Fourier_transform
        How come Numpy and Scipy don't implement this ??? """
        f = lambda func : (signal*func(2*pi*tt/period)).sum()
        return f(cos)+ 1j*f(sin)
is using the FFT.

What you want is the power spectral density in the discrete case, called the power spectrum. It can be calculated by multiplying the discrete Fourier transform (FFT) with its conjugate, and shifting. NumPy can do it. Here is an example: http://stackoverflow.com/questions/15382076/plotting-power-s...

Re: Transcribing Piano Rolls, the Pythonic Way

#17
post #10

See a master at work making original rolls at QRS. http://www.youtube.com/watch?v=i3FTaGwfXPM If was a fun place to see in the 70's after watching my father rebuild our player piano.

Interesting that they used computers to make them. It seems obvious in hindsight; player piano music is digital!

Also interesting that we had digital data storage, in the form of punched cards and tape, decades before digital computers.

Re: Transcribing Piano Rolls, the Pythonic Way

#18
post #7

I love the abundance of Python. For those unaware, even the youtube-dl command line utility he used to download the video is written in Python.

And in contrast to what its name suggests, youtube-dl supports 150+ different services: http://rg3.github.io/youtube-dl/supportedsites.html

Re: Transcribing Piano Rolls, the Pythonic Way

#19
post #3

Really fantastic hack. Now try transcribing with just the audio track.

That's a hard problem. If you have some material like that with a clear recording, the only good commercial solution that I know of is Melodyne, and he's not saying how he does it. In theory you just look for multiple peaks in the FFT, but this is much easier said than done.

i built a plogue bidule patch before melodyne rolled out "dna" and it is extremely difficult to get the optimal fft parameters to get an accurate conversion. i cant imagine an algorithm that would get it right from analyzing the sample would be any less difficult. ableton's and cubase's options are pretty rough too. i am a drummer though, i am just trying to make up for my ears.
Post reply on HN