Live data from Hacker News

Songdata

songdata.io

21–30 of 39 posts

Re: Songdata

#21

I hadnt heard of the camelot song feature before. Seems its a code to indicate the compatible key: https://www.quora.com/What-does-Camelot-mean-in-musical-term...

"Camelot wheel" is a misnomer for what's actually known as the circle of fifths. Either way, it's a way of quickly spotting "closely related" keys (e.g. C and G are closely related because G is the dominant tone wrt. C) and relative minors/majors (A minor is a relative key to C major, because it uses the same notes with a different tonal center and assignment of scale degrees).

Re: Songdata

#23

Earlier quoted context omitted.

You can find the Spotify Developer Terms here: https://developer.spotify.com/terms Basically, you're not allowed to sell the Spotify in any way.

In those terms, it says "you may not store, aggregate or create compilations or databases of Spotify Content". So for this site to be compliant, they should be serving up the data directly from the Spotify API, which ought to get rate limited pretty quickly (when on the HN frontpage and all), unless they somehow got a very large quota.

I’m serving everything from the Spotify API directly on Noiseblend (https://noiseblend.com) and rate limit has never been a problem.

When a request fails because of a rate limit, Spotify responds with 429 and a Retry-After header so you know when to schedule the next request.

In my tests, that header never had a value greater than 10 seconds, and 429 responses were very rare.

Re: Songdata

#24
post #2

Some time ago I wanted to see how many songs have bass notes that go bellow 50Hz and I quickly realised that it way over my expertise to do that, but I'm still curios: would it be possible to display the frequencies for a particular track?

You should be able to get that from the Spotify API endpoint that returns a track's audio analysis.

I looked into that but there was no information on frequencies.

There’s pitch but that only cares about in which key the frequencies are concentrated (e.g. it tells you that this part of the song has mostly C pitches but not if it’s C2 or C4)

Re: Songdata

#25

How well does this manage songs with key changes?

The data comes from Spotify, so I guess we should ask them :)

But in my tests, the pitches seem to be averaged so only the dominant key is reported.

Re: Songdata

#26

The moment I saw on the front page that Adele's "Easy On Me" was listed at 142 BPM, I was flabbergasted. You only have to play the song while looking at a timer for about 15 seconds to see the BPM is far less than half that number.

The Audio Analysis API also reports a tempo_confidence and there’s a 43.2% confidence on that Adele song.

    {
      "meta": {
        "analyzer_version": "4.0.0",
        "platform": "Linux",
        "detailed_status": "OK",
        "status_code": 0,
        "timestamp": 1633650625,
        "analysis_time": 7.80526,
        "input_process": "libvorbisfile L+R 44100->22050"
      },
      "track": {
        "num_samples": 4954520,
        "duration": 224.69478,
        "sample_md5": "",
        "offset_seconds": 0,
        "window_seconds": 0,
        "analysis_sample_rate": 22050,
        "analysis_channels": 1,
        "end_of_fade_in": 0.26807,
        "start_of_fade_out": 209.58913,
        "loudness": -7.519,
        "tempo": 141.981,
        "tempo_confidence": 0.432,
        "time_signature": 4,
        "time_signature_confidence": 1,
        "key": 5,
        "key_confidence": 0.545,
        "mode": 1,
        "mode_confidence": 0.58,

        ...

    }
[1] https://developer.spotify.com/console/get-audio-analysis-tra...

Re: Songdata

#28
post #23

Earlier quoted context omitted.

In those terms, it says "you may not store, aggregate or create compilations or databases of Spotify Content". So for this site to be compliant, they should be serving up the data directly from the Spotify API, which ought to get rate limited pretty quickly (when on the HN frontpage and all), unless they somehow got a very large quota.

I’m serving everything from the Spotify API directly on Noiseblend ( https://noiseblend.com ) and rate limit has never been a problem. When a request fails because of a rate limit, Spotify responds with 429 and a Retry-After header so you know when to schedule the next request. In my tests, that header never had a value greater than 10 seconds, and 429 responses were very rare.

Right, but you are using user login, and I think that gives you a lot more rate than a single account doing all the requests, which is what you need to get the no-sign-in experience on songdata.io - right?

Re: Songdata

#29
post #23

Earlier quoted context omitted.

I’m serving everything from the Spotify API directly on Noiseblend ( https://noiseblend.com ) and rate limit has never been a problem. When a request fails because of a rate limit, Spotify responds with 429 and a Retry-After header so you know when to schedule the next request. In my tests, that header never had a value greater than 10 seconds, and 429 responses were very rare.

Right, but you are using user login, and I think that gives you a lot more rate than a single account doing all the requests, which is what you need to get the no-sign-in experience on songdata.io - right?

Indeed, I forgot about that part...

I think all of my requests to Spotify have been done on behalf of authenticated users. But I guess you could authenticate with your own user to lift up the limits.

Re: Songdata

#30
post #2

Some time ago I wanted to see how many songs have bass notes that go bellow 50Hz and I quickly realised that it way over my expertise to do that, but I'm still curios: would it be possible to display the frequencies for a particular track?

What you seem to be looking for here is a Fourier transform/spectrogram. Vast majority of audio processing toolkits should have prebuilt tools along those lines for you to use.
Post reply on HN