From 555ca9618e01475d547ce2fbd0fdddaf0da7b41d Mon Sep 17 00:00:00 2001 From: fosanz Date: Fri, 16 Feb 2024 17:07:57 +0100 Subject: [PATCH] Added requirements and Readme --- README.md | 51 +++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | Bin 0 -> 106 bytes server/server.py | 2 +- 3 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 README.md create mode 100644 requirements.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..7b1819b --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Project Title: MIDI Song Player + +This project is a MIDI song player that allows users to request songs from a server and play them on their local machine. The project is written in Python and uses the `mido` library for MIDI file handling. + +## Getting Started + +These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. + +### Prerequisites + +The project requires Python 3 and the following Python packages: + +- mido==1.3.2 +- packaging==23.2 +- python-rtmidi==1.5.8 + +You can install these packages using pip: + +```python +pip install -r requirements.txt +``` + +### Project Structure + +The project is divided into a client and a server. The server hosts a library of MIDI songs and handles requests from the client. The client allows users to request and play songs from the server. + +#### Server + +The server is implemented in the `server.py` file. It uses the `Library` class to manage the song library and the `Song` class to represent individual songs. The server listens for incoming connections and spawns a new thread to handle each client. + +#### Client + +The client is implemented in the `client.py` file. It uses the `MediaPlayer` class to play songs and the `Requestor` class to request songs from the server. The client provides a simple GUI for users to select and play songs. + +## Running the Project + +To run the project, start the server: + +```python +python server/server.py +``` + +Then, in a separate terminal, start the client: + +```python +python client/client.py +``` + +## Authors + +- FosanzDev \ No newline at end of file diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..44b8003523570def2a6f22a978c3bd24b91e2ece GIT binary patch literal 106 zcmezWFP9;cA%!8I!4?P&8T1&8f!K(Fmw}6+fFY3~nIRiUrUTXF0ZEV=BNP>t3?&R1 ZK;3x^x(r1?HpH|{xM`+9(=5QI0RRY45eNVP literal 0 HcmV?d00001 diff --git a/server/server.py b/server/server.py index cde4cdb..0fb82a1 100644 --- a/server/server.py +++ b/server/server.py @@ -5,7 +5,7 @@ from Library import Library from Song import Song import os -SONGS_DIR = os.path.join(os.path.dirname(__file__), 'songs') +SONGS_DIR = os.path.join('../songs') library = Library() library.initialize(SONGS_DIR)