Giter Site home page Giter Site logo

midi-tape's Introduction

midi-tape

A tape mode style recorder for external MIDI devices, created using Web MIDI.

I made this as an alternative to using a DAW, for situations where you want to control a few external MIDI devices to make quick songs.

User guide

midi-tape is a 4-track tape mode style recorder that takes input from one MIDI device (ex: a MIDI keyboard), and outputs that recording to other MIDI devices and channels.

You can use this to create songs in a more linear, free-form way than with a traditional DAW or MIDI sequencer.

Web MIDI isn't supported in many browsers, so please use the latest Chrome and do not switch tabs while recording.

Controls

All user input is done through the keyboard to make usage with a smaller external device (ex: remapped numpad) possible.

  • p - Play/pause
  • P (shift+p) - Stop
  • r - Toggle recording
  • R (shift+r) - Toggle replace recording
  • m - Toggle metronome
  • m + up/down - Change beats per minute
  • m + left/right - Change beats per bar
  • M (shift+m) - Toggle count-in
  • 1-9/0 - Change track
  • 1-9/0 + up/down - Change output device
  • 1-9/0 + left/right - Change output channel
  • 1-9/0 + delete - Delete track
  • i + up/down - Change input device
  • up/down - Change track
  • left/right - Move tape
  • shift + left/right - Move tape to next/previous bar
  • t - Add/clear start point
  • y - Add/clear end point
  • backspace/delete - Deletes everything between start/end points
  • shift + backspace/delete - Deletes pitch bends and control changes between start/end points
  • v - Pastes the current track's data between start/end points to current point
  • V (shift+v) - Pastes all track data between start/end points to current point
  • i + p - Plays and tells the input device to play. Useful for recording drum machines
  • u - Undo (for track deletion, note deletion, recording sessions, and paste)
  • U (shift+u) - Redo
  • q - Toggle quantization
  • q + up/down - Change quantization level
  • q + left/right - Change quantization strength

If you need more than 10 tracks, use the "o" key instead of the numerical keys:

  • O (shift+o) - Add a track
  • o + delete - Delete current track
  • o + up/down - Change output device
  • o + left/right - Change output channel
  • o + p - Play and solo current track

The timeline

The timeline displays all notes, pitch bends, and control changes for each track.

Notes in the current track are green, pitch bends are purple, and control changes are cyan. When recording, the current track's content will turn red.

The start point, if placed, is turquoise, and the end point if placed is yellow. You can use start/end points to work on loops in your song - when the end point is reached, the tape will automatically loop back to the start point. When you're happy with your loop, you can paste it to the next bar(s). If not you can delete it to start over.

Per the above control guide, you move around the timeline using arrow keys, and can hold shift to jump from bar to bar. Most of your time with midi-tape will be spent moving on the timeline, changing start/end points, and changing tracks.

Saving/loading

By default the current tape is saved to persistent browser storage often to prevent data loss between sessions.

To save your work long-term, click the "Save" button at the bottom of the screen. This will save the tape as JSON, which you can then load back into midi-tape when needed.

Using dummy devices

To avoid errors and allow for easier testing of the tool, dummy/fake input and output devices are provided for you. The "Dummy Synth" uses Tone.js and supports polyphony and pitch changes. The "Dummy Keyboard" allow you to play a C major scale using the keys a, s, d, f, g, h, and j. The k and l keys move the octave up and down.

Note that these are not meant to be useful for real recording scenarios, so their functionality will always be limited.

Monitoring and recording audio

Since it can be a bit difficult to monitor the output of your synths while listening to midi-tape's metronome, you can click "Monitor Audio" and have your browser's default input played through the default output. This is also useful for quick jam sessions without opening a DAW or using something like JACK.

While monitoring, you can click "Record Audio", which will lock keyboard controls, go to the start of the tape, and play it through while recording everything that's monitored. Once finished, .webm file will be downloaded. I would have preferred .wav, but the browser APIs for this are pretty limited.

Once downloaded, you can convert the .webm file with a command like:

ffmpeg -i ~/Downloads/midi-tape.webm -vn ~/Downloads/midi-tape.mp3

Exporting a MIDI file

If you're finished recording but want to edit some of the MIDI manually, you can click "Export MIDI" to download your tape as a .mid file.

Note that this is a one-way operation, you cannot import MIDI files as parsing them accurately given midi-tape's limited feature set could result in data loss.

Notes

  • Your input device's MIDI channel is ignored, to keep the idea that one track is one MIDI output device + one channel.
  • A MIDI clock is sent to all outputs every quarter note.
  • Since it's JavaScript, the BPM is likely always a little off.
  • The tape runs at a resolution of 24 PPQ. Higher PPQ values make the tape run inconsistently.
  • Replacing is destructive (just like a real tape) - use it wisely!
  • You will have to manage MIDI input delays yourself - for Linux, try installing a package like Ubuntu's linux-lowlatency. For Windows, try using ASIO4All Driver.

Development

midi-tape is built using vanilla JavaScript, and is intended to be used in modern browsers with Web MIDI support (basically latest Chrome).

I built this over a weekend, and would like to maintain it minimally going forward. Please do not refactor the entire codebase, and instead add small sensible features if needed.

To start a local dev server, run npm start.

To format code, run npm run prettier.

To update copies of vendor libraries, run npm run build-assets.

midi-tape's People

Contributors

mortenson avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

cadr adrienjoly

midi-tape's Issues

Support sharp tones in Dummy Synth

Cool project! So many great features and little touches, like how the tape transfers from one reel to the other.

Would it be possible to add support for sharp tones in the Dummy Synth, so that for example Shift + a results in a sharp tone?

Re-name "overdub"

"Overdub on" is actually the opposite of what's happening. Whoops. Should be renamed "Replace/Overdub" or "Punch in/out".

Launchkey Mini MIDI keyboard is not recognized

First, thank you for this awesome work! I was looking for a four-track recorder that I could use to quickly record ideas with my MIDI keyboard, and was impressed by your implementation + the article you wrote to explain the development process. ๐Ÿ‘

While trying to use https://mortenson.coffee/midi-tape/ on the latest version of Chrome, with my Launchkey Mini MIDI keyboard plugged in, I did not find I way to get any input from it. All tracks are apparently configured with "dummy keyboard". (which works as expected: it plays notes whenever I press keys of my laptop's keyboard.)

EDIT: it works, it just took me some time to realize I had to press i + up/down key to set my input. (as explained in the guide)

Could it be that my keyboard is not compatible with your software, or that any of these warnings are in cause?

image

FYI, I know that it's at least supported by WebMidi, because it works with that little synth I made: https://adrienjoly.com/webmidi-launchkey-mini/

I'd be happy to fork this repo and/or contribute to it in order to fix this, so I'd appreciate any ideas or tips you may have to help me fix that problem.

Support undo/redo

We have one numpad key available, and I don't see how save/load in embedded mode would work with one additional key.

Prevent double note hits

There are scenarios where, while recording, you'll input something at the same time the step is being played back, which sends two note inputs to your output device. This results in the volume being amped up, or the sound sounding distorted depending on the device.

Fully support embedded device use

Ideas:

  1. Have an "embedded mode" which changes features of the app
  2. Start in full screen
  3. Load/save projects to a backend web server
  4. Have larger UI elements or use icons (this could be a global change)
  5. Add "numpad mode" that remaps all inputs to standard (17 key) numpad keys, so users could put labels over a numpad and have a controller

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.