The Music Maker Application is a Node.js and WebSocket-based application that generates and plays modern hip-hop beats. It utilizes OpenAI's GPT-3.5 model for music generation and Tone.js for real-time music playback.
Follow these steps to set up and run the Music Maker Application:
- Node.js installed on your machine.
-
Clone the repository to your local machine:
git clone https://github.com/storbeck/MusicMaker.git
-
Navigate to the project directory:
cd <project_directory>
-
Install server dependencies:
cd server npm install
-
Install client dependencies:
cd client npm install
-
Set your OpenAI API key by creating a
.env
file in the server directory:OPENAI_API_KEY=your_api_key_here
You can run the server and client separately or together.
To start the server for generating and playing music, run the following commands from the server directory:
-
Generate music and save to a file:
npm run generate-music --save songs/sample5.json
-
Generate music and output to stdout:
npm run generate-music
-
Play a music file:
npm run play-music example_song2.json
To start the client for real-time music playback, run the following commands from the client directory:
-
Start the local development server
npm run dev
To run both the server and client concurrently, use the following command from the project directory:
npm run start:both
This will start both the server and client, allowing you to generate and play music in real-time.
- The server uses OpenAI's GPT-3.5 model to generate hip-hop beats in JSON format.
- The client connects to the WebSocket server and plays the received music using Tone.js synthesizers.
- You can customize the instruments and music generation by modifying the server code.
- The Music Maker Application requires a WebSocket connection between the server and client.
- Music generation is based on OpenAI's GPT-3.5 model and may vary in musicality.
- The client-side script uses Tone.js to synthesize and play music in real-time.