Behind the Code
Our Code:
A copy of the Python code can be found here.Link opens in a new window
There are instructions on the Python file describing how to install required modules and work the user configuration panel.
Brief Summary of the Code:
Our code takes the chosen image and divides it into vertical slices (the amount decided by the user). Then, the image properties in each slice are mapped to certain musical elements, outlined in the table below:
| Image Property |
Musical Element |
|---|---|
| Average RGB colour |
Degree of scale |
| Brightest area |
Octave of melodic line |
| Saturation | Complexity of harmony |
| Brightness | Dynamics |
| Image Property | Musical Element |
|---|---|
| Overall most dominant colour of image | Type of ending cadence |
Flowchart explaining code:
Here is an explanation of how the code works in more detail, cell by cell.