-
-
A familiar input image, a painting from Minecraft.
-
The output image after converting image to MIDI to image.
-
An example of many colors being saved into music and being converted back.
-
The output image after converting image to MIDI to image.
-
Another example of many colors being saved into music and being converted back.
-
The output image after converting image to MIDI to image.
SoundsAwful - Image to Music Encryption
About
SoundsAwful provides a novel method for cryptographically encoding pictures as music and reversing said encryption within a simple python GUI.
Instructions
To encode an image, select the image via the file selection dialog and click Convert. After the program finishes its conversion, you will be prompted to save the resulting midi.
The process is nearly the same for a midi. Select the file via the dialog and similarly select Convert-- you will be prompted to save the image outputted from the decryption process.
Demo video:
Examples
Input | Midi Output | Reconstructed Image |
---|---|---|
![]() |
Burst midi | ![]() |
![]() |
Fluid Midi | ![]() |
Description
The image-to-music algorithm works as such*
- Read the image from the file
- Downscale the image to a user-defined resolution (default 64 x 64)-- larger resolutions roughly result in longer output songs
- Extract the red, green, and blue channels for each of these downscaled convolutions
- The blue channel is normalized to be between 0 and the number of notes, so that it can then be mapped to a specific note.
- The green channel is normalized to be between 0.25 and 2.00, representing the length of a note in terms of quarter-notes.
- The red channel is normalized to be between 20 and 127, representing the volume of the note in the generated file.
- Generate chords using the inputs of the notes, lengths, and volumes
- The actual chord generation works by generating possible chords using a baroque chord progression ruleset and a user-defined key, and then inverting the chord such that the input note is the base note.
- Output the converted .midi file
*please note that these values are configurable for the most part
The music-to-image algorithm works by reversing the above steps; read the midi, extract the chords & their base notes, determine their quarter-note lengths & volumes, and reconstruct the downscaled image.
Future Improvements
As shown in the video, there are a few ways we could improve this project to make it more useful for real-world applications (i.e. steganography). Some include:
- Hiding the generated chords throughout a piece of music
- More precise compression when converting from image -> midi so as to preserve more data
- A more visually pleasing GUI
- Quicker conversion (especially with larger resolutions)
- More comprehensive encryption algorithms accounting for filetype, metadata, and other properties
Contributors
Made for the HackGT 7 hackathon by Marius Juston, Russell Newton, and Akshin Vemana.
Built With
- music21
- numpy
- opencv
- pygubu
- python
- scikit-learn
Log in or sign up for Devpost to join the conversation.