GithubHelp home page GithubHelp logo

midiasm's Introduction

build

midiasm

MIDI assembler/disassembler to convert between standard MIDI files and a text/JSON equivalent.

Raison d'être

A Go reimplementation of Jeff Glatt's long defunct Windows-only MIDIASM (last seen archived at MIDI Technical Fanatic's Brainwashing Center). Because sometimes it's easier to just programmatically deal with text or JSON.

Releases

In development

Version Description
v0.1.0 Initial release with support for dissassemble, export, notes, click and transpose

Installation

Executables for all the supported operating systems are packaged in the releases. Installation is straightforward - download the archive and extract it to a directory of your choice.

midiasm help will list the available commands and associated options (documented below).

Building from source

Required tools:

  • Go 1.22+
  • make (optional but recommended)

To build using the included Makefile:

git clone https://github.com/transcriptaze/midiasm.git
cd midiasm
make build

Without using make:

git clone https://github.com/transcriptaze/midiasm.git
cd midiasm
go build -trimpath -o bin/ ./...

The above commands build the midiasm executable to the bin directory.

Dependencies

None

midiasm

Usage: midiasm <command> <options>

Supported commands:

Defaults to disassemble if the command is not provided.

disassemble

Disassembles a MIDI file and displays the tracks in a human readable format.

Command line:

midiasm [--debug] [--verbose] [--C4] [--split] [--out <file>] <MIDI file>

  --out <file>  Writes the disassembly to a file. Default is to write to stdout.
  --split       Writes each track to a separate file. Default is `false`.

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:

  midiasm --debug --verbose --out one-time.txt one-time.mid

assemble

Assembles a MIDI file from a text or JSON source.

Command line:

midiasm assemble [--debug] [--verbose] [--C4] [--out <MIDI file>] <file>

  --out <file>  Output MIDI file. Defaults to the input file with a .midi extension.

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:

  midiasm assemble --debug --verbose --out one-time.mid one-time.json

export

Extracts the MIDI information as JSON for use with other tools (e.g. jq).

Command line:

midiasm export [--debug] [--verbose] [--C4] [--out <file>] <MIDI file>

  --out <file>     Writes the JSON to a file. Default is to write to stdout.
  --json           Formats the output as JSON - the default is human readable text.
  --transpose <N>  Transposes the notes up or down by N semitones.

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:

  midiasm notes --debug --verbose --out one-time.json one-time.mid

notes

Extracts the NoteOn and NoteOff events to generate a list of notes with start times and durations.

Command line:

midiasm notes [--debug] [--verbose] [--C4] [--out <file>] <MIDI file>

  --out <file>  Writes the notes to a file. Default is to write to stdout.

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:

  midiasm notes --debug --verbose --out one-time.notes one-time.mid

click

Extracts the beats from the MIDI file in a format that can be used to create a click track.

Command line:

midiasm click [--debug] [--verbose] [--C4] [--out <file>] <MIDI file>

  --out <file>  Writes the click track to a file. Default is to write to stdout.

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:
  
  midiasm click --debug --verbose --out one-time.click one-time.mid

transpose

Transposes the key of the notes (and key signature) and writes it back as MIDI file.

Command line:

midiasm transpose [--debug] [--verbose] [--C4] --semitones <steps> --out <file> <MIDI file>

  --semitones <N>  Number of semitones to transpose up or down. Defaults to 0.
  --out <file>     (required) Destination file for the transposed MIDI. 

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:
  
  midiasm transpose --debug --verbose --semitones +5 --out one-time+5.mid one-time.mid

tsv

Extracts the MIDI information as a TSV or fixed width file for use with other tools (e.g. miller)

Command line:

midiasm tsv [--debug] [--verbose] [--C4] [--out <file>] <MIDI file>

  --out <file>   Output filepath. Default is to write to stdout.
  --delimiter    Column delimiter for TSV files. Defaults to TAB.
  --tabular      Formats the outputs as fixed width columns

  Options:

  --C4       Uses C4 as middle C (Yamaha convention). Defaults to C3.
  --debug    Displays internal information while processing a MIDI file. Defaults to false
  --verbose  Enables 'verbose' logging. Defaults to false

  Example:

  midiasm tsv --debug --verbose --out one-time.tsv one-time.mid

Tools

  1. jq
  2. miller

References

  1. The Complete MIDI 1.0 Detailed Specification
  2. Somascape - MIDI Files Specification
  3. (archive) MIDI Technical Fanatic's Brainwashing Center
  4. StackExchange::Music Transposing key signatures - how to do so quickly?
  5. An Introduction to MIDI
  6. Roland: Midi Guidebook
  7. Timing in MIDI files

Alternatives

  1. mido
  2. midicsv
  3. Werkmeister
  4. pymidi
  5. DryWetMIDI
  6. Online MIDI Editor
  7. go-midi
  8. midiutil
  9. music21

midiasm's People

Contributors

twystd avatar

Stargazers

 avatar  avatar TcherBer avatar Dmytro Salenko avatar now_its_dark avatar Edward avatar Eric Le Nay avatar

Watchers

Edward avatar  avatar  avatar

midiasm's Issues

"humanise" command

Randomize MIDI event ticks:

  • jacketed drunkards walk
  • (optionally) add as new track

Rework TSV export as built-in command

Golang plugins are poorly supported:

  • no Windows support
  • cross-compilation is problematic

Tasks:

  • Move commands to commands package
  • Add tsv command
  • Remove TSV plugin
  • Remove plugin support
  • Update Makefile
  • CHANGELOG
  • README

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.