Code Monkey home page Code Monkey logo

sjrbmidi's Introduction

sjrbMIDI

sjrbMIDI is an open-source (GNU-GPL3 license) collection of classes to simplify creating and reading MIDI files via PHP.

The idea was to make it as easy as possible to write a bunch of MIDI events to a physical MIDI file. The file will be readable by any DAW.

PHP is such an easy language to work with, I wanted to be able to experiment with algorithmic composition in PHP. I am sharing this here in case anyone else finds it helpful and fun.

Capabilities

  1. Can read and write existing MIDI files, and dump their contents.
  2. Can create new MIDI files, with full control over all aspects of the MIDI file.
  3. A class exists for a musical Key, to enable diatonic math & writing logic that stays "in key".
  4. A class exists for Rhythm, to make it easier to manipulate note durations to follow a rhythm.
  5. An extension to the Rhythm class exists for Euclid, for generation of Euclidean rhythms.
  6. Classes exist for creation & manipulation of event series, for both Pitch Wheel events and Control Change events. Several wave forms exist, from sin to sawtooth to square, etc., for these curves.
  7. A class exists for a musical Phrase, that allows you to operate on sets of notes a time. Methods exist for various musical transformations, e.g., retrograde, transpose, inversion, etc.
  8. A class exists for Dynamics, that allows you to emphasize notes according to the rhythm and time signature being used.
  9. A class exists for a DrumGenerator, which will do what it says - generate a drum track. Highly configurable, the DrumGenerator allows you to specify a set of sequences to be generated and a set of instrument properties. The result can range from dreamy & spacey to manic metal jazz...
  10. A class exists for a ChordGenerator, which will generate chord sequences.
  11. A class exists for a TonalGenerator, which will generate melodic lines based on phrases.

To use

Create your file in .php and execute it from your browser. The MIDI file that is created can then be loaded into your DAW.

Use one of the examples as an easy starter.

Documentation may be found here: https://github.com/sbulen/sjrbMIDI/blob/main/sjrbMIDI.pdf

Limitations

  1. This does not honor any of the real-time MIDI messages at this time. Not sure PHP would be the platform to do that...
  2. This software is geared towards generating files in MIDI file format 1.
  3. I have not tested the SMPTE functions, only straight-up MIDI.

Further reading

sjrbmidi's People

Contributors

sbulen avatar

Stargazers

Roman avatar Quadarius Moore avatar

Watchers

 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.