Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- __ __ _ _ _ ____ _
- | \/ (_) __| (_) ___|| |__
- | |\/| | |/ _` | \___ \| '_ \
- | | | | | (_| | |___) | | | |
- |_| |_|_|\__,_|_|____/|_| |_|
- - Midi shell -
- pastebin.com/NvZQkvTW
- o==========o
- | Contents |
- o==========o
- A. General setup/usage/add Midi devices
- 1. General Linux commands
- 2. General midish commands and info
- 3. Edit "~/.midishrc" to add Midi devices
- 4. Record, play, etc.
- B. Extra RC, install
- C. Step Sequencing (Extra RC)
- D. Make connections
- 1. Assign input/output names to devices
- 2. Connect input to output
- E. Define track particulars
- 1. Track commands
- 2. Measure commands
- 3. Tempo (in BPM)
- 4. Quantise
- 5. Metronome, configure
- 6. Metronome, usage
- 7. External master clock
- F. Basic editing
- 1. Clear measures
- 2. Re-record bar x
- 3. Concatenate bars
- 4. Clear all data for one note
- G. Save and load
- 1. Midish Project
- 2. Midi file im- & export
- H. Usage example
- I. Quirks/bugs
- 1. Loop
- 2. Clear
- X. References
- Appendix A. Note to Midi Note number table
- -<>-<>-<>-<>-<>-<>-<>-
- o========================================o
- | A. General setup/usage/add Midi device |
- o========================================o
- 1. General Linux commands
- ~~~~~~~~~~~~~~~~~~~~~~~~~
- Determine Linux's Midi port nr.'s and client names:
- aseqdump -l
- Determine Midi channel:
- aseqdump -p <port nr.>
- 2. General midish commands and info
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Tip: midish supports TAB-completion.
- Midish does not support wiping steps from a measure (bar). Only wiping whole measures (bars). Neither can you see what notes will be played back, other than studying the saved .msh text file, the command 'tdump' or 'debug norm 1' (gives everything in hex). Deal breaker?
- It is also very annoying that there is no clear command to print what device actually belongs to a certain midish-device number. For an indication use the command:
- ls
- Or outside of midish:
- cat ~/.midishrc | grep dnew
- Commands for the metronome and sync will *only* accept a midish-device number, not "human-readable" names.
- See my ~/.midishrc file for procedures written by me and other remarks.
- Midish is most useful (maybe even meant for) quick recording of Midi data and playback (in a loop). It is not a meant to be a sequencer with "per step edit" functionality and it's hard to write a shell script to turn it into one (I've tried/done so).
- 3. Edit "~/.midishrc" to add Midi devices
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- Check Midi devices for their so-called Linux/Alsa "client names":
- aseqdump -l
- Example of output:
- Port Client name Port name
- 24:0 SINCO SINCO MIDI 1
- :
- :........... This is the name to use.
- Edit "~/.midishrc" and use the client names:
- dnew 0 "SINCO" rw
- # This is a remark.
- print "Syntax in midishrc is case sensitive so don't use |P|rint instead of |p|rint."
- Check my personal "~/.midishrc" file for more info on hardware one can use etc. and to add setup info to "~/.midishrc" that's described in the chapter "Make connections".
- 4. Record, play, etc.
- ~~~~~~~~~~~~~~~~~~~~~
- [p]lay, [s]top, [r]ecord, [i]nteractive & [loop].
- o======================o
- | B. Extra RC, install |
- o======================o
- How to use the extra's by Jeanette C., download archive from [3].
- 1. Copy the file to a directory somewhere in your path, e.g.:
- cp .midish_extrarc ~/
- 2. To include extrarc by default from your standard "~/.midishrc" add the following line to the end of it (midish needs a hard path except for it's own rc file):
- exec "/home/yourname/.midish_extrarc"
- o===============================o
- | C. Step Sequencing (Extra RC) |
- o===============================o
- 1. Connect input to output (example):
- rnew Sinco NiftyCase
- 2. Patterns. Per default the number of steps ('pgrid') is set to 16 and the length of a note ('plen') is 16 (i.e. 1/16-th note).
- 3. Use [p]attern [step]. Example for bar 0, step 3 (step numbering starts at 0 to 15) and note C4 (= Midi note number 60, see [1]):
- pstep 0 2 60
- | | |____ Midi note number 60 = C4
- | |______ Step 3 (starts at 0)
- |________ Bar 0
- Or in general:
- pstep bar step note
- Note/bug/quirk! The html manual in the source tarball and on the website [3] is wrong about 'ppenv'. Rather read the comment before its procedure in the midish_extrarc file itself.
- o=====================o
- | D. Make connections |
- o=====================o
- Do this via the .midishrc file or on midish's command line.
- 1. Assign input/output names to devices
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- First check the Midi channel you've set your device to with (check port number with aseqdump -l):
- aseqdump -p <portnumber>
- Then give these devices a midish-name and define if they're input or output. Example:
- inew Sinco_wireless {1 0}
- | | |___ Midi channel (between 0 and 15)
- | |_____ Midish's device number
- |___________________ Name you made up yourself
- This means that one of midish's Midi input devices (inew) is named "Sinco_wireless" (i.e. the Sinco Midi USB dongle), midish's device number is 1 (as previously assigned) and it is outputting data on Midi channel 0. Note that midi channel 0 is sometimes called channel 1 on certain devices or computers, very confusing.
- Output device names are assigned the same way with 'onew'.
- Check your currently defined midish-names with (example):
- ilist; olist
- {Miditech Sinco}
- {NiftyCase}
- Check currently set in- and output:
- geti; geto
- 2. Connect input to output
- ~~~~~~~~~~~~~~~~~~~~~~~~~~
- Example:
- rnew Sinco NiftyCase # rnew is from Extra_rc!
- The 'r' stands for record I think.
- o=============================o
- | E. Define track particulars |
- o=============================o
- Track commands, tempo, quantize, loop, metronome, click.
- 1. Track commands
- ~~~~~~~~~~~~~~~~~
- tnew mytrack (create NEW Track)
- ct mytrack (set Current Track)
- gett (GET current Track)
- tlist (LIST Tracks)
- Remark: each track has a "current filter" and that determines in- and output.
- 2. Measure commands
- ~~~~~~~~~~~~~~~~~~~
- mend first "free" measure (doesn't contain recorded note data)
- g x set current position & go to measure x
- getpos current position & start position of the current selection
- (NOTE! this measure DOES contain data)
- 3. Tempo (in BPM)
- ~~~~~~~~~~~~~~~~~
- t 100
- mtempo (check tempo)
- 4. Quantise
- ~~~~~~~~~~~
- setq 16 (set quantisation step to 16th note)
- getq (check quantisation, if any)
- sel 10; tquanta 100 (select 10 bars; set track quantisation amount
- to 100%)
- sel [mend]; tquanta 100 (select to end measure and quantizise)
- Loop (also see chapter "Quirks/bugs"):
- g 2; sel 1; loop; p (goto bar 2, select one bar, loop, play)
- noloop (end loop mode)
- ???? (make sure no silent bar is played as countdown)
- 5. Metronome, configure
- ~~~~~~~~~~~~~~~~~~~~~~~
- metrocf {non {0 9} 68 127} {non {0 9} 60 127}
- | | | | | |__ Note for the low click (on
- | | | | | the other beats)
- | | | | |___ Velocity
- | | | |______ Note for high click (on 1st beat of bar)
- | | |__________ Midi channel 9 (0 - 15)
- | |____________ Midish device 0
- |_______________ Note on
- Make sure the metronome is off whilst playing back. You can use the same synth for recording, playback and metronome.
- 6. Metronome, usage
- ~~~~~~~~~~~~~~~~~~~
- m on/off/rec (rec = at recording only)
- 7. External master clock
- ~~~~~~~~~~~~~~~~~~~~~~~~
- Set external drum machine (example: midish's device-number 1) as master clock source (Device CLocK Receive), i.e. synchronize midish to an external sequencer:
- dclkrx 1
- Works for Midi ticks, start- and stop events.
- o==================o
- | F. Basic editing |
- o==================o
- Here's where it gets hairy. You can *NOT* see exactly what notes you've input, you can only hear them. You can try get some info by reading a project file that you've saved to disk or use the command:
- tdump
- but it's neigh impossible to get step info from that. It's all in "ticks from last step". Additionally, wiping data can only be done for whole measures, not for a step!
- 1. Clear measures
- ~~~~~~~~~~~~~~~~~
- Also see chapter "Quirks/bugs"
- The track won't be shortened, the measures will just emptied out. Example, in [c]urrent track [cl]ea[r] measure 4 up to (but not including) 6:
- cclr 4 6 (from Extra RC, won't delete only wipe)
- mend (print last measure to contain note data)
- cclr 0 [mend] (clear ALL measures)
- 2. Re-record bar x
- ~~~~~~~~~~~~~~~~~~
- Use 'cclr' to cut and create an empty bar in between. Then create a sequence on that bar. What if you recorded "live"? Create temptrack, record 1 bar and copy it over to project/other track? From the manual:
- tcopy # copy current selection
- ct mypiano2 # change current track to ``mypiano2''
- g 5 # go to measure 5
- tpaste # paste the copy
- 3. Concatenate bars
- ~~~~~~~~~~~~~~~~~~~
- The parameter to 'mdup' is the number of measures to leave between the the original and the point where the replica is inserted.
- g 17 # go to measure 17
- sel 4 # select the next 4 measures
- mdup 0 # duplicate selected measures 3 x at bar 17 + 4 = 21
- mdup 0
- mdup 0
- Remark: this makes midish crash (as do all insert procedures!) if the 'rnew' command has been used because of the wretched line:
- kat {3 0} 0 0
- Workaround: cut that out temporarily (and reinsert after concatenating)? Or use 'tcheck' to clean it up? Or simply don't use the 'mdup' command at all and use my 'sequence' procedure again and again?:
- sequence {...}; g [mend]
- 4. Clear all data for one note
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- If your measure is a (complicated) drum sequence then you may want to wipe all data for a certain note (i.e. drum instrument). After that use the 'sequence' procedure again for that note/instrument. Example:
- g 1 # Go to bar 1.
- sel 2 # Select 2 bars
- ev {note {} 64} # Event, mark all notes of 64 (E3)
- tclr # Track, clear marked events
- o==================o
- | G. Save and load |
- o==================o
- 1. Midish Project
- ~~~~~~~~~~~~~~~~~
- Save/load Midish project file:
- save "project.msh"
- load "project.msh"
- Note that the local settings (like device configuration, metronome settings) are NOT saved [2].
- 2. Midi file
- ~~~~~~~~~~~~
- Multichannel? Song mode? Loop?
- import "mysong.mid"
- export "mysong.mid"
- Playback via command line with amidiplay:
- aplaymidi -p <<portnumber>> mysong.mid
- o==================o
- | H. Usage example |
- o==================o
- Make sure that your Midi hardware is setup in ~/.midishrc and connected to your computer!
- 1. Connect input to output (check w/ 'ilist; olist'):
- rnew Sinco JT4000
- Check if it works by going into [i]nteractive mode and playing the keyboard.
- 2. Load/save a project:
- load "project.msh"
- Or: program step by step, example (bar 0, step 3, note C4):
- pstep 0 2 60
- Or:
- [r]ecord ([s]top and [p]lay) live playing.
- Or import/export Midi file:
- export "project.mid"
- 4. Tip: use the extra features described in the section "Define track particulars".
- o================o
- | I. Quirks/bugs |
- o================o
- 1. Loop
- ~~~~~~~
- I think that, unless you start the first bar at bar-number 0, a short silence is entered between two loops. I think I could check that in a .msh file or something... Or I could get rid of it by editing the .msh file...??
- 2. Clear
- ~~~~~~~~
- Don't wipe to the very end! You can't enter a new sequence then because kat {3 0} 0 0 (kat = key after touch) is deleted.
- Use 'tcheck' to clean it up?
- 3. Error messages
- ~~~~~~~~~~~~~~~~~
- Error:
- bad v0 in event spec
- probably means that v0 (= variable 0, the first one) in a procedure (that you defined in an rc file) is "wrong". Like a letter instead of a number.
- Error:
- statelist_done: non {5 0} 36 7f: unterminated frame
- statelist_done: kat {5 0} 0 0: unterminated frame
- statelist_done: kat {5 0} 0 0: unterminated frame
- The "7f" means velocity 7f (= 127). The "unterminated frame" means ...? A frame is a Midi event like a combination of midish device-number, Midi channel, Midi note-number and velocity. This error always follows the 'pstep' command for some reason. Because there is no note off (noff)?
- o===============o
- | X. References |
- o===============o
- [1] MIDI note number chart:
- https://computermusicresource.com/midikeys.html
- [2] Midish manual on-line:
- https://midish.org/manual.html
- [3] JBS Midish Extra Commands:
- http://juliencoder.de/test/sound/jbs_midish_extra-1.8.tar.bz2
- website:
- http://juliencoder.de/test/index.php?page=software/index
- manual on-line :
- http://juliencoder.de/test/publications/jbs_midish_extra-manual.html
- [4] Linuxmusicains topic w/ the link to the Extra Commands:
- https://linuxmusicians.com/viewtopic.php?t=24338
- o============================================o
- | Appendix A. Note to Midi Note number table |
- o============================================o
- First column is the octave (A4 = 440 Hz). Note: some standards set all these one octave higher, i.e. they start numbering at 0 [1].
- C C# D D# E F F# G G# A A# B
- 1 12 13 14 15 16 17 18 19 20 21 22 23
- 0 24 25 26 27 28 29 30 31 32 33 34 35
- 1 36 37 38 39 40 41 42 43 44 45 46 47
- 2 48 49 50 51 52 53 54 55 56 57 58 59
- 3 60 61 62 63 64 65 66 67 68 69 70 71
- 4 72 73 74 75 76 77 78 79 80 81 82 83
- 5 84 85 86 87 88 89 90 91 92 93 94 95
- 6 96 97 98 99 100 101 102 103 104 104 106 107
- 7 108 109 110 111 112 113 114 115 116 117 118 119
- Miditech 12-Mini 32 Plus, Qtractor:
- C C# D D# E F F# G G# A A# B
- 0 12 13 14 15 16 17 18 19 20 21 22 23
- 1 24 25 26 27 28 29 30 31 32 33 34 35
- 2 36 37 38 39 40 41 42 43 44 45 46 47
- 3 48 49 50 51 52 53 54 55 56 57 58 59
- 4 60 61 62 63 64 65 66 67 68 69 70 71
- 5 72 73 74 75 76 77 78 79 80 81 82 83
- 6 84 85 86 87 88 89 90 91 92 93 94 95
- 7 96 97 98 99 100 101 102 103 104 104 106 107
- 8 108 109 110 111 112 113 114 115 116 117 118 119
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement