dhmit / sonification

15 stars 5 forks source link

Color encoding to sound #42

Closed MasterEchez closed 3 years ago

MasterEchez commented 3 years ago

Summary

This PR allows a user to select a color on a React color picker, and the RGB values are then converted to an energy value using this formula: energy = round(0.299 r + 0.587 g + 0.114 * b). This energy value, with a range of 0-255, is then normalized to a frequency range of 150-350 hz. After submitting a given color on the color picker, a volume control slider with a tone corresponding to the energy of the color is generated and the sound is played.

image

Next Steps:

anastasia commented 3 years ago

From conversation with @leanneshen, the last commit (revert merge) is attempting to revert code already on the main branch (from the ADSR team). I will try to fix this right now

anastasia commented 3 years ago

The PR looks great! My only other comment (aside from moving views.py method to our more general app/views.py) is that the calculation is taking quite a bit of time and I am not currently sure why. Let's take a look at that and add a todo for the near future to speed up if we're able.