r/Rlanguage • u/frequencymatch • 2d ago
First time publishing an R analysis: converted Spotify pitch classes to frequencies (Hz)
Hey everyone,
I recently started learning R after a non-tech background (law and PR) and just completed my first standalone project: coldplay-in-hz.
Using tidyverse and rmarkdown, I mapped Spotify API's pitch class integers (0–11) to actual frequencies in Hz (f=440×2n/12) across Coldplay's 20-year catalog.
Main findings from the data:
- Strong preference for E (~330 Hz) and A (~440 Hz) fundamentals.
- Pitch distribution mean barely drifted across albums (2000–2021).
- Evaluated changes under a 432 Hz reference tuning.
I would love any feedback from experienced R users on the project structure, code efficiency, or rmarkdown style.
Link to repo: https://github.com/frequencymatch/coldplay-in-hz
1
u/bogdanelcs 19h ago
Solid first project, especially coming from law/PR.
One catch: Spotify's pitch class integers don't carry octave info. So f=440×2^(n/12) locks everything into one octave (closest to A4), but the actual guitar or bass note could sit anywhere. Worth a README note saying this tracks tonal center, not literal pitch height.
Also check if Spotify ever returns -1 for key (no confident detection). If those rows got dropped silently, mention it in the analysis.
Nice touch on the 432 Hz comparison. Most people skip that.
3
u/mirlaca 1d ago
Thanks for sharing. I'm discovering RStudio (and its myriad package) capabilities to render pretty much any result in whatever format.
I assume all the rigmarole was ai generated, though, wasn't it?