Skip to content

EmoDJ is a brand-new AI-powered offline music player desktop application that focuses on improving listeners' emotional wellness.

License

Notifications You must be signed in to change notification settings

peggypytang/EmoDJ

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

EmoDJ Music Player

Buy Me A Coffee Buy me a ☕️ if you like and want to support my projects. :)

TL;DR

EmoDJ is a brand-new AI-powered offline music player desktop application that focuses on improving listeners' emotional wellness.

This application is designed based on psychology theories. It is powered by machine learning to automatically identify music emotion of your songs.

Key Features

  • AI-powered music emotion recognition - identify music emotions automatically for songs in your music library.
  • Innovative music retrieval panel - organise songs based on psychology theories and retrieve songs from your music library by music emotion.
  • Playlist recommendation - keep on playing songs with similar music emotion.
  • No fee, no ad, no tracking. Completely offline.

Motivation

Psychology researches show that music could change and support our mood. The power of mood regulation is the main reason why so many of us like to listen to music. We listen to music in our daily life, and we have different preferences for music in different emotional situations.

Often, we picked songs out of habit because we do not know what fits our mood. Sometimes, we relied on music streaming applications to feed us the pieces they think are "the best" for us. When we get songs that don't feel fit, for now, we can only keep clicking next and next, until we reach one that feels right.

The existing music experience is yet to ideal. EmoDJ is designed to offer listeners to get the most out of the benefits of listening to music - enjoy music that can best improve our emotional wellness at our preference.

Russell's circumplex model - Jonathan Posner, James A. Russell, and Bradley S. Peterson. The circumplex model of affect: An integrative approach to affective neuroscience, cognitive development, and psychopathology". In: Development and Psychopathology (2005)

Demo Video on Youtube

EmoDJ Demo

Design

AI-powered Music Emotion Recognition Engine

Music emotion of the songs, represented by arousal and valence values, is recognised and annotated automatically by the machine learning model. This music emotion information is used as a search index for retrieval and music visualisation.

Music Retrieval Panel

Four quadrants in arousal-valence space are represented by four colours associated to music emotion.

💛 Green-yellow (associates with happiness): Quadrant with positive arousal and valence value.

💚 Green-blue (associated with relaxation): Quadrant with negative arousal and positive valence value.

💙 Blue (associated with sadness): Quadrant with negative arousal and valence value.

❤️ Red (associated with anger): Quadrant with positive arousal and negative valence value.

Music Player and Recommendation Engine

In addition to standard functions including next, pause, resume, it provides recommendation function. Upon listener selected a piece of music, this engine would generate a playlist of recommended music based on music emotion similarity with the selected music piece, calculated by Euclidean distance. It would automatically play continuously, starting from the most similar one, until the playlist exhausts.

Music Visualisation Engine

This engine processes music data to generate music visualisation effects for each music. While playing music, colourful dynamic effect is generated simultaneously. Loudness and frequency, obtained by Fast Fourier Transform, controls magnitude of the effect. Time-varying music emotion controls colour, which has the same colour association as the music retrieval panel.

System Configuration

EmoDJ is a desktop application based on Python 3 with GUI. Programs and resources required, including application codes, music emotion recognition models, index files, music files, are under 'EmoDJ Music Player' folder.

It has below folder structure:

EmoDJ Music Player
    ├── index                          # Folder with music emotion index files
    ├── model                          # Folder with music emotion recognition model
    ├── musics                         # Place your music files under this folder. The supported music file format is .wav.
    └── EmoDJ Music Player Code.ipynb  # Run this Jupyter notebook to start EmoDJ Music Player

Users are provided with a GUI to interact with the application, including browsing music information, retrieving music, pausing and resuming music. The screen would display live music visualisation.

For smooth execution of EmoDJ, ensure below packages are installed before execution is attempted. EmoDJ was tested under macOS Big Sur 11.1 with below package versions.

  • python (version 3.7)
  • tkinter (version 8.6)
  • librosa (version 0.6.3)
  • pygame (version 1.9.6)
  • pandas (version 1.2.0)
  • scikit-learn (version 0.20.1)

Getting Started

User should copy whole 'EmoDJ Music Player' folder and store in their local device.

1. Import Music:

Music files should be placed under 'EmoDJ Music Player/musics' folder. The supported music file format is .wav. Sample music files in the folder are from Free Music Archive.

Upon launching EmoDJ, unprocessed new music files will be recognised automatically to obtain their music emotion values. It may take a while to complete the music emotion recognition.

2. Main Interface:

To execute EmoDJ Music Player, the user should open the 'EmoDJ Music Player Code.ipynb' under 'EmoDJ Music Player' folder. To start EmoDJ for the first time, click 'Cell - Run All' in Jupyter notebook. To restart after quit, click 'Kernel - Restart and Run All' in Jupyter notebook.

Upon launching the application, users are presented with the main interface. Users perform operations via GUI by using a pointing device, such as a mouse and touchpad.

3. Browse Music Emotion Information:

Upon hovering on markers in Music Retrieval Panel, song name, valence and arousal value of that piece of music is displayed.

4. Start Playing Music:

Upon clicking on markers in Music Retrieval Panel, that selected piece of music will start playing. Live music visualisation is shown.

5. Playlist Recommendation:

Recommended music playlist based on music emotion similarity is generated upon select music to play, starting from the most similar one. Music currently playing is shown by the yellow marker. Music played are indicated by grey markers. It will play continuously until playlist exhausts. Notification will show when playlist reaches the end.

6. Play Next Music in Playlist:

To play next music in the playlist, click the 'Next' button.

7. Resume/Pause Playing:

To resume or pause the playing of music, click the 'Resume/Pause' button.

8. Quit EmoDJ:

To quit EmoDJ, click 'Quit' button. To restart after quit, click 'Kernel - Restart and Run All' in Jupyter notebook.

Troubleshooting

  • Unsychronisation of music visualisation and sound:

The unsychronisation is due to the difference in system specifications. It could be solved by adjusting the 'SYNC' parameter under 'GUI Engine' section in "EmoDJ Music Player Code.ipynb".

  • Distorted GUI at a relaunch:

The proper way to relaunch after quitting is by clicking 'Kernel - Restart and Run All' in Jupyter notebook. At this case, relaunch EmoDJ by clicking 'Kernel - Restart and Run All' in Jupyter notebook.

  • Music still playing after closing EmoDJ window:

The proper way to exit EmoDJ is by clicking the 'Quit' button, this would stop the music and close EmoDJ window. At this case, it could be solved by clicking 'Kernel - Shutdown' in Jupyter notebook.