Live data from Hacker News

Transcribing Piano Rolls, the Pythonic Way

zulko.github.io

31–38 of 38 posts

Re: Transcribing Piano Rolls, the Pythonic Way

#31
post #24

Earlier quoted context omitted.

The maximum frequency you can detect is limited by your sampling rate, but there's not a limit on the precision with which you can break those frequencies up. It's controlled by a parameter NFFT -- the PSD will compute (NFFT/2+1) values evenly spaced between 0 and the Nyquist frequency. So say the frame rate is 15Hz and you compute with NFFT=2048, then PSD[970] contains the amplitude at 7.09Hz. This was a really cool…

Thanks, I learned something. I will try it and amend the blog when I have time.

Forgot to say, great post! :)

Re: Transcribing Piano Rolls, the Pythonic Way

#32

Earlier quoted context omitted.

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.

Longer than that. The Jaquard loom was invented in 1801 and the player piano was first demonstrated in 1876.

Re: Transcribing Piano Rolls, the Pythonic Way

#33
Very cool!

Relevant: Zenph makes "re-performances" of old piano recordings. They take a recording, do music transcription magic to get the exact timings and velocities of each note event, and then feed that into a player piano. So it's as if you are listening to the ghost of Rachmaninov sitting at the piano, as shown here: https://www.youtube.com/watch?v=eevzbV6Hkkk&t=28 (music starts at 0:28)

(I just visited http://zenph.com for the first time in about a year, and it appears that they've pivoted into a music education company.)

Re: Transcribing Piano Rolls, the Pythonic Way

#34
post #27

What if you tried to transcribe the music solely from Fourier transform of the audio source? I expect the piano has an abundance of harmonics, but there should be some way to distinguish them from the keys. Hasn't someone done it already?

i've seen NNLS/chroma referenced in a few places, like the chordify papers:

http://isophonics.net/nnls-chroma

Here's chordify: http://ismir2012.ismir.net/event/papers/295_ISMIR_2012.pdf

That conference has great references but unfortunately hasn't been repeated since 2012 http://www.ismir.net/proceedings/index.php

Re: Transcribing Piano Rolls, the Pythonic Way

#37
post #21

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…

I knew I was going to have this remark :) Now correct me if I am wrong, but I think the FFT (which computes the discrete Fourier transform) cannot replace the continous fourier transform in my case, because the optimal periods I find are non-integer values. In the first case, the holes are separated by 7.5 pixels. The FFT could only have told me that they are separated by 7 or 8 pixels, which is not precise enough. S…

There are a lot of parametric (as opposed to the nonparametric FFT) methods for tracking frequency, I'm not totally convinced they're applicable to this case, but I think they might be fun to try out. Maybe start here: http://en.wikipedia.org/wiki/Multiple_signal_classification
Post reply on HN