How I Made a Bitcoin Music Machine with LOOK MUM NO COMPUTER
I collaborated with one of my favorite youtubers LOOK MUM NO COMPUTER and we made music with cryptocurrency data 💁🏻♀️.
The project
I made a scraper that took crypto values in real time off of the internet as input and output voltages that change every time the crypto coin value changes. At the same time Sam made a synth that used the voltage variances and make music with it.
I tried CoinMarketCap but noticed that the values were not updating on my side. They sell an API so they use Javascript to hide it.
So I tried Google.
I tried Bitcoin and then Ethereum and it updated every 20 seconds which was good enough for the project. But when I tried adding more coins to the script I realized that Google doesnt display other-not-as-popular coins. So I had to start over and scrape Yahoo Finance which did display a bunch of crypto values and updated every 20 seconds or so like Google.
The Voltage
I had been using a Raspberry Pi to run my python script and for Sam to reproduce back at his studio. To do the analog outputs / voltages I used PWM and LEDs to see the variances.
The math
To see the I changed the voltage output percentages based on the coin difference percentages. So:
difference# = new# - current#
new% = difference# / current# * 100
newVoltage% = new% + prevVoltage%
I sent the code to Sam, we met again, we integrated with the synth he made, and it worked!
Watch our videos on how we did it below: