JBS Midish Extra Commands

This is a set of extra commands for Midish, the commandline based MIDI sequencer by Alexandre Ratchov. It provides easy access to things like routing inputs and outputs, quantisation, step sequencing and track groups.


1. Introduction

The JBS Midish Extra Commands are are a set of commands written for the Midish commandline Midi sequencer, written by Alexandre Ratchov.

Midish comes with a shell program called rmidish, which has its own shell-like language. This language is used to write these "comfort commands", that make Midish/rmidish much more fun to work with. Included are commands to copy, quantise and clear tracks, map channels, creating input/output routings and act on groups. Furthermore a few more transport commands are added. Also some basic step sequencing functionality is provided.

The JBS Midish Extra Commands don't add new functionality to Midish, but they provide higher level functions for an everyday workflow with reasonable amounts of typing.


1.1. Installation

You can use these commands in two ways. To test them you may include them on an ad hoc basis:

bash$ rmidish
[...]
rmidish# exec ".Midish_extrarc"

Since it's a Midish script, you can execute it from within rmidish, using the exec command.

Or you can include the commands permanently, by adding this line to the end of your ~/midishrc:

exec "/path/to/your/user_directory/.midish_extrarc"

You may rename the file and put it where you want. Just remember to adapt the code snippets to the new name and location.

[Back to top]


1.2. What's new?

28.03.2016: Version 1.5

[Back to top]


1.3. Copyright

"JBS Midish Extra Commands" © 2014-2019 Jeanette C. <Jeanette (at) Juliencoder (dot) de>

The "JBS Extra Midish Commands" are provided under the GNU General Public License (GPL), version 3, which is provided with this package in the file COPYING.

Midish is © Alexandre 2003-2015, Alexandre Ratchov <alex@caoua.org>

Midish is Copyright © 2008 Willem van Engen <wvengen@stack.nl>

For more information on Midish and its copyright, pleases visit the Midish website at www.midish.org.

[Back to top]


2. Naming conventions

Most commands from the "JBS Midish Extra Commands" deals with tracks and some more deal with intervals and positions. Since there are many similarities, there are a few naming conventions to indicate, how the command works:

[Back to top]


3. Good practise

To get the best results and the most enjoyment out of these commands, setup your hardware MIDI devices and channels for them in your ~/.midishrc like this:

dnew 0 "USB MIDI Cable 1" rw # synth1 connected to USB MIDI Cable 1
dnew 1 "USB MIDI Cable 2" rw # synth2 connected to USB MIDI Cable 2
inew keys1 {0 0} # first input channel of synth1
inew keys2 {0 1} # Second input channel of synth one
onew keys1 {0 0} # First output channel of synth1
onew keys2 {0 1} # Second output channel of synth1
inew module1 {1 0} # First input channel of synth2
inew module2 {1 1} # Second input channel of synth2
onew module1 {1 0} # First output channel of synth2
onew module2 {1 1} # Second output channel of synth2

When creating tracks use the rnew command to set up your routing. Example:

tnew piano # create a track called piano
rnew keyboard1 piano_module1 # map everything from the channel keyboard1 to the channel piano_module1

Wherever possible, record only one instrument - one MIDI channel - on a single track.

Wherever possible and not too inconvenient, use commands from this set to work with your MIDI. The commands sometimes make extra notes and have some protection against unwanted actions.

Store some extra info in a separate file. As of version 1.1 Midish can't store dynamically created devices and groups, as they are used by the group commands. So here's the typical info that should be written to a secondary file:

# Load the Midish project file
load "my_project.msh"
# Dynamic devices
dnew 2 "MIDI-Soundcard 1" rw
dnew 3 "MIDI USB Cable 1" rw
dnew 6 "Software Synthesizer" wo
# Groups let strings = {violin viola cello bass}
let brass = {trumpets horns trombones tuba}

Store the file as my_project.mcfg .

my_project.msh is the Midish project or song file, that Midish stores, when you call save "my_project.msh". The filename extension is arbitrary. On your next rmidish start after storing don't call load "my_project.msh", but call:

exec "my_project.mcfg"

This will then execute all your special setup commands and load the project file for you.

[Back to top]


4. Transport commands

The transport commands allow you to relocate the position, i.e. forward and rewind.

[Back to top]


5. Track commands

Track commands fall into a few categories: track information, clearing recorded material, copying events as-is from, copying events and mapping channels and quantising.

Track information

Clearing recorded material

Play status

Quantising

Copying

Channel copying/mapping

[Back to top]


6. Step sequencing commands

The step sequencing commands allow you to enter notes on the rmidish commandline. Additionally the pstep and pstepv commands rely on the settings of plen and pgrid, since they work on a grid of fixed note lengths like traditional, analogue step sequencers.

[Back to top]


7. Group commands

These commands act on a group of tracks. As of Midish version 1.1, groups can't be stored inside the project files. A way around it, is to store them in an extra file, that can be executed by Midish later on. A group is a simple list of tracks, you can create it like this:

let strings = {violin viola cello bass}

ATTENTION: a group must always be named as a variable, i.e. preceded by a dollar sign ($). So to display all tracks in a group type:

gshow $strings

Now here's how the extra file can look. Imagine your project is called big_hit and the Midish project file is called big_hit.msh:

load "big_hit.msh"
let strings = {violin viola cello bass}

You could store that under the name "big_hit.mcfg". Then when you open your project for the next time, you don't type the load command, but:

exec "big_hit.mcfg"

The group commands cover areas similar to track commands and where appropriate are just the same:

[Back to top]


8. General commands

These commands don't fit in any other category. They range from some device and channel setup to routing input and output channels for tracks.

Track channel routing

Device and channel setup

These commands will setup new MIDI-devices and channels. It can be useful to add software synthesizers, that aren't always running or MIDI-USB-devices, that will only turn up, once the instrument is turned on.

As of Midish version 1.1 extra devices aren't stored with a project, you can add them in an extra file, where you can also store groups. The order of adding devices and groups is arbitrary. Example:

dnew 5 "LinuxSampler" wo

This will add the software synthesizer with the MIDI-port named "LinuxSampler" as MIDI device number 5. The corresponding channels will be stored in your Midish project. When you add new devices using the functions below, the command to put into your extra file will be printed to the screen.

[Back to top]


9. Tips and tricks

rmidish - the Midfish shell interface - was never really intended as a program for the real world. It was meant to be an example of how to use Midish as an engine in your own applications. Years later, it is still here though. It does not have all the features you would expect from a graphical - or hardware - MIDI sequencer. This means working around it. One way is by being methodical and systematic. This section shows one way of effectively using Midish.

For using groups and dynamic devices, please see the good practises section above.

An extra script as the project.mcfg can also be used to store further dynamic information that Midish won't store in a project by default.

Too many tracks to see them all

Organising your tracks: the groups have many advantages. You can mute and unmute tracks that belong together, you can copy whole sections within a group, but you can also display tracks in logical units. Especially when a project grows, a full list of tracks won't fit on the screen, that's where groups can help, using the gshow command.

Slimming down audio recording without missing a single track

Organising audio recording and rendering: again a case for groups. Perhaps you have multiple hardware synthesizers and multiple software synthesizers. Once you have completed your composition in MIDI, it's time to record all tracks to audio. You can create small groups of tracks that can be recorded in parallel. Say you have two tracks on synth1 and two tracks on synth2, you can create two groups:

let run1 = {synth1_piano synth2_bass}
let run2 = {synth1_string synth2_drums}

Now you can setup your audio recording and use gsolo $run1 and gsolo $run2 respectively to record your tracks. It looks pointless here, but when you have 20 or 40 tracks in total it makes much more sense.

Which track plays on which synth?

The sh command will list the playback channel of a track. But it is tedious to inspect every track this way. Naming conventions can help. Put the name or initial of the playback synth in the track name. Say you have the Megasynth and the Gigasynth, you can create m_piano and g_bass. This way you see the name and know to which synth they belong.

Recording a piece in section, maybe even nonlinear?

Think of electronic music, or any music that has repeating sections. What many people do is, record a few patterns/sections and then cut, copy and paste them to create the final song. Midish can do that. Again some track naming conventions might help.

For the final result, i.e. the complete song, you can create another batch of tracks without the section names and copy the patterns to these. So you can copy the eight bars from g_piano_intro to g_piano, then the eight bars from g_piano_verse to g_piano ...

For even more control you can create groups to relfect your section tracks. You could create the groups intro, verse, bridge and chorus and add all the necessary tracks to those. Then you might create a group full_song. Now you can easily flip back and forth between sections to see which instruments you might want and the full song to hear how everything fits together.

Midish and Yoshimi

Yoshimi is a software synthesizer that runs on Linux - and other operating systems. Yoshimi can respond to MIDI from the ALSA sequencer. However, I have experienced problems with that. Yoshimi sees an incoming connection, but doesn't react to any data. No notes, no sound.

Yoshimi can also use JACK MIDI. There are several programs to bridge MIDI between JACK and ALSA. You can use a2j_midi_bridge, or any other, to connect Midish to Yoshimi.

More complex real world scenarios

On Juli-Encoder you can find more articles describing how to synchronise Midish to Nama (and other Linux DAWs) as well as managing bigger projects with software synthesizers. Just check back there and look at the publications page.

Has this manual missed a trick? Have you found other brilliant ways to improve your Midish workflow? Please let Jeanette know.

[Back to top]