GithubHelp home page GithubHelp logo

tonejsmidijson's Introduction

Tone.js MIDI Generator

This project utilizes OpenAI's GPT-3.5 model to generate MIDI scores in JSON notation that can be played back using Tone.js. The generated JSON music score includes tracks with labeled notes containing pitch, duration, and startTime. The duration and startTime are represented as numerical integers.

Try it here: https://kazado.github.io/tonejsmidijson/

Instructions for Use:

  1. Dependencies:

  2. Setup:

    • Clone this repository to your local machine.
    • Open the index.html file in a web browser.
  3. Interface:

    • The interface allows you to adjust between direct generation and code generation of MIDI music.
    • Use the slider to select between direct generation and code generation.
    • Click the "Start Generation" button to initiate the MIDI generation process.
  4. Playback:

    • After initiating the generation process, the generated MIDI music will be played back automatically.
    • The playback can be controlled using the play/pause toggle button.

Code Overview:

  • JavaScript (main.js):

    • The generateCode function uses OpenAI's API to generate JavaScript code for MIDI music generation based on predefined prompts.
    • The generateMidiJson function generates MIDI music directly by calling OpenAI's API with specified prompts.
    • The loadJson function loads the generated MIDI JSON based on user selection.
    • The startPlayback function starts the playback of the generated MIDI music using Tone.js.
  • HTML (index.html):

    • Provides the user interface for controlling MIDI generation and playback.
    • Includes necessary scripts for Tone.js and MIDI playback.

Usage Notes:

  • Ensure you have a stable internet connection to utilize the OpenAI API for MIDI generation.
  • Adjust the slider between direct generation and code generation to explore different approaches to MIDI music creation.

Credits:

  • This project utilizes OpenAI's GPT-3.5 model for MIDI generation.
  • Tone.js library is used for MIDI playback.

For any questions or issues, please open an issue in the GitHub repository. Thank you for using Tone.js MIDI Generator!

tonejsmidijson's People

Contributors

kazado avatar santolucito avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.