Pysic is a desktop music player built using Python, Tkinter, and Pygame, but the real star here is the custom data structure architecture that powers the playlist and playback system.
This project intentionally avoids built‑in list shortcuts and instead implements its own Circular Doubly Linked List and Stack to demonstrate how real‑world software can be driven by fundamental data structures.
- Load and play
.mp3files from any folder - Next/Previous navigation using CDLL traversal
- Shuffle mode with random access
- Pause, resume, stop controls
- Recently Played list managed by a stack
- Playlist viewer with remove‑song functionality
- Clean and interactive Tkinter GUI
Each entry in the Circular Doubly Linked List is represented by a SongNode. It stores:
name- the song's title (derived from filename)file_path- the full path to the mp3 fileprev- pointer to the previous SongNodenext- pointer to the next SongNode
This node structure is the backbone of the playlist system, enabling bidirectional and circular traversal.
Pysic is built around two custom‑implemented structures:
This structure stores the playlist in a circular loop, enabling infinite navigation in both directions.
Why CDLL?
- Lets the player go next and previous smoothly
- No need to handle index boundaries manually
- Every node has prev and next, forming a perfect loop
Used for:
- Maintaining the playlist
- Keeping track of the currently active song
- Sequential mode navigation
Key Operations:
add(name, path)– Inserts song nodesremove(name)– Unlinks nodes safelynext_song()/previous_song()– Circular traversalget_random_song()– Shuffle mode random accessfind_song(name)– Search inside the loop
Works exactly like a real‑world history stack.
Why a Hybrid Stack? A pure stack only allows removing the top element, which doesn't fit a full recently-played history display. This project uses a hybrid approach: a stack-like behavior for pushes but allows reading the entire structure without popping anything.
Used for:
- Tracking history
- Displaying all recent songs without destructive pops
Key Operations:
push(song)– Adds a song to historypop()– Removes the last playedget_all()– Returns items in LIFO order
pysic/
│── app.py # Main application
│── README.md # You are reading this
pip install pygame
Tkinter ships with Python on most systems.
python app.py
Click Load Music Folder and select a directory containing .mp3 files.
You're ready to go.
+-----------------------+
| Circular Doubly |
| Linked List (CDLL) |
| - Playlist |
+-----------+-----------+
|
v
+--------------------+
| Current Song Node |
+--------------------+
|
v
+-------------------------+
| Stack (Recently Played) |
+-------------------------+
This isn’t just another MP3 player. It’s a demonstration of:
- How custom data structures fit into real applications
- How GUI interaction maps to node‑level operations
- How playlist engines work under the hood
Perfect for students and developers exploring:
- DSA in real applications
- Tkinter GUI development
- File handling and media frameworks
- Volume control
- Progress bar seeking
- Queue system
- Favorites
Feel free to contribute or fork!