Advertisement
Meneer_Jansen

My Midish tips and hints

Jul 6th, 2025 (edited)
12
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.94 KB | None | 0 0
  1. __ __ _ _ _ ____ _
  2. | \/ (_) __| (_) ___|| |__
  3. | |\/| | |/ _` | \___ \| '_ \
  4. | | | | | (_| | |___) | | | |
  5. |_| |_|_|\__,_|_|____/|_| |_|
  6.  
  7. - Midi shell -
  8. pastebin.com/NvZQkvTW
  9.  
  10.  
  11. o==========o
  12. | Contents |
  13. o==========o
  14.  
  15. A. General setup/usage/add Midi devices
  16. 1. General Linux commands
  17. 2. General midish commands and info
  18. 3. Edit "~/.midishrc" to add Midi devices
  19. 4. Record, play, etc.
  20.  
  21. B. Extra RC, install
  22.  
  23. C. Step Sequencing (Extra RC)
  24.  
  25. D. Make connections
  26. 1. Assign input/output names to devices
  27. 2. Connect input to output
  28.  
  29. E. Define track particulars
  30. 1. Track commands
  31. 2. Measure commands
  32. 3. Tempo (in BPM)
  33. 4. Quantise
  34. 5. Metronome, configure
  35. 6. Metronome, usage
  36. 7. External master clock
  37.  
  38. F. Basic editing
  39. 1. Clear measures
  40. 2. Re-record bar x
  41. 3. Concatenate bars
  42. 4. Clear all data for one note
  43.  
  44. G. Save and load
  45. 1. Midish Project
  46. 2. Midi file im- & export
  47.  
  48. H. Usage example
  49.  
  50. I. Quirks/bugs
  51. 1. Loop
  52. 2. Clear
  53.  
  54. X. References
  55.  
  56. Appendix A. Note to Midi Note number table
  57.  
  58. -<>-<>-<>-<>-<>-<>-<>-
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74. o========================================o
  75. | A. General setup/usage/add Midi device |
  76. o========================================o
  77.  
  78. 1. General Linux commands
  79. ~~~~~~~~~~~~~~~~~~~~~~~~~
  80. Determine Linux's Midi port nr.'s and client names:
  81.  
  82. aseqdump -l
  83.  
  84. Determine Midi channel:
  85.  
  86. aseqdump -p <port nr.>
  87.  
  88.  
  89. 2. General midish commands and info
  90. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  91. Tip: midish supports TAB-completion.
  92.  
  93. 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?
  94.  
  95. 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:
  96.  
  97. ls
  98.  
  99. Or outside of midish:
  100.  
  101. cat ~/.midishrc | grep dnew
  102.  
  103. Commands for the metronome and sync will *only* accept a midish-device number, not "human-readable" names.
  104.  
  105. See my ~/.midishrc file for procedures written by me and other remarks.
  106.  
  107. 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).
  108.  
  109. 3. Edit "~/.midishrc" to add Midi devices
  110. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  111. Check Midi devices for their so-called Linux/Alsa "client names":
  112.  
  113. aseqdump -l
  114.  
  115. Example of output:
  116.  
  117. Port Client name Port name
  118. 24:0 SINCO SINCO MIDI 1
  119. :
  120. :........... This is the name to use.
  121.  
  122. Edit "~/.midishrc" and use the client names:
  123.  
  124. dnew 0 "SINCO" rw
  125. # This is a remark.
  126. print "Syntax in midishrc is case sensitive so don't use |P|rint instead of |p|rint."
  127.  
  128. 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".
  129.  
  130. 4. Record, play, etc.
  131. ~~~~~~~~~~~~~~~~~~~~~
  132. [p]lay, [s]top, [r]ecord, [i]nteractive & [loop].
  133.  
  134.  
  135.  
  136. o======================o
  137. | B. Extra RC, install |
  138. o======================o
  139.  
  140. How to use the extra's by Jeanette C., download archive from [3].
  141.  
  142. 1. Copy the file to a directory somewhere in your path, e.g.:
  143.  
  144. cp .midish_extrarc ~/
  145.  
  146. 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):
  147.  
  148. exec "/home/yourname/.midish_extrarc"
  149.  
  150.  
  151.  
  152. o===============================o
  153. | C. Step Sequencing (Extra RC) |
  154. o===============================o
  155.  
  156. 1. Connect input to output (example):
  157.  
  158. rnew Sinco NiftyCase
  159.  
  160. 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).
  161.  
  162. 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]):
  163.  
  164. pstep 0 2 60
  165. | | |____ Midi note number 60 = C4
  166. | |______ Step 3 (starts at 0)
  167. |________ Bar 0
  168.  
  169. Or in general:
  170.  
  171. pstep bar step note
  172.  
  173. 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.
  174.  
  175.  
  176. o=====================o
  177. | D. Make connections |
  178. o=====================o
  179.  
  180. Do this via the .midishrc file or on midish's command line.
  181.  
  182. 1. Assign input/output names to devices
  183. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  184. First check the Midi channel you've set your device to with (check port number with aseqdump -l):
  185.  
  186. aseqdump -p <portnumber>
  187.  
  188. Then give these devices a midish-name and define if they're input or output. Example:
  189.  
  190. inew Sinco_wireless {1 0}
  191. | | |___ Midi channel (between 0 and 15)
  192. | |_____ Midish's device number
  193. |___________________ Name you made up yourself
  194.  
  195.  
  196. 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.
  197.  
  198. Output device names are assigned the same way with 'onew'.
  199.  
  200. Check your currently defined midish-names with (example):
  201.  
  202. ilist; olist
  203. {Miditech Sinco}
  204. {NiftyCase}
  205.  
  206. Check currently set in- and output:
  207.  
  208. geti; geto
  209.  
  210. 2. Connect input to output
  211. ~~~~~~~~~~~~~~~~~~~~~~~~~~
  212. Example:
  213.  
  214. rnew Sinco NiftyCase # rnew is from Extra_rc!
  215.  
  216. The 'r' stands for record I think.
  217.  
  218.  
  219.  
  220. o=============================o
  221. | E. Define track particulars |
  222. o=============================o
  223.  
  224. Track commands, tempo, quantize, loop, metronome, click.
  225.  
  226. 1. Track commands
  227. ~~~~~~~~~~~~~~~~~
  228. tnew mytrack (create NEW Track)
  229. ct mytrack (set Current Track)
  230. gett (GET current Track)
  231. tlist (LIST Tracks)
  232.  
  233. Remark: each track has a "current filter" and that determines in- and output.
  234.  
  235. 2. Measure commands
  236. ~~~~~~~~~~~~~~~~~~~
  237. mend first "free" measure (doesn't contain recorded note data)
  238. g x set current position & go to measure x
  239. getpos current position & start position of the current selection
  240. (NOTE! this measure DOES contain data)
  241.  
  242. 3. Tempo (in BPM)
  243. ~~~~~~~~~~~~~~~~~
  244. t 100
  245. mtempo (check tempo)
  246.  
  247. 4. Quantise
  248. ~~~~~~~~~~~
  249. setq 16 (set quantisation step to 16th note)
  250. getq (check quantisation, if any)
  251. sel 10; tquanta 100 (select 10 bars; set track quantisation amount
  252. to 100%)
  253. sel [mend]; tquanta 100 (select to end measure and quantizise)
  254.  
  255. Loop (also see chapter "Quirks/bugs"):
  256.  
  257. g 2; sel 1; loop; p (goto bar 2, select one bar, loop, play)
  258. noloop (end loop mode)
  259. ???? (make sure no silent bar is played as countdown)
  260.  
  261. 5. Metronome, configure
  262. ~~~~~~~~~~~~~~~~~~~~~~~
  263.  
  264. metrocf {non {0 9} 68 127} {non {0 9} 60 127}
  265. | | | | | |__ Note for the low click (on
  266. | | | | | the other beats)
  267. | | | | |___ Velocity
  268. | | | |______ Note for high click (on 1st beat of bar)
  269. | | |__________ Midi channel 9 (0 - 15)
  270. | |____________ Midish device 0
  271. |_______________ Note on
  272.  
  273. Make sure the metronome is off whilst playing back. You can use the same synth for recording, playback and metronome.
  274.  
  275. 6. Metronome, usage
  276. ~~~~~~~~~~~~~~~~~~~
  277. m on/off/rec (rec = at recording only)
  278.  
  279. 7. External master clock
  280. ~~~~~~~~~~~~~~~~~~~~~~~~
  281. 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:
  282.  
  283. dclkrx 1
  284.  
  285. Works for Midi ticks, start- and stop events.
  286.  
  287.  
  288.  
  289. o==================o
  290. | F. Basic editing |
  291. o==================o
  292.  
  293. 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:
  294.  
  295. tdump
  296.  
  297. 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!
  298.  
  299. 1. Clear measures
  300. ~~~~~~~~~~~~~~~~~
  301. Also see chapter "Quirks/bugs"
  302.  
  303. 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:
  304.  
  305. cclr 4 6 (from Extra RC, won't delete only wipe)
  306. mend (print last measure to contain note data)
  307. cclr 0 [mend] (clear ALL measures)
  308.  
  309. 2. Re-record bar x
  310. ~~~~~~~~~~~~~~~~~~
  311. 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:
  312.  
  313. tcopy # copy current selection
  314. ct mypiano2 # change current track to ``mypiano2''
  315. g 5 # go to measure 5
  316. tpaste # paste the copy
  317.  
  318. 3. Concatenate bars
  319. ~~~~~~~~~~~~~~~~~~~
  320. The parameter to 'mdup' is the number of measures to leave between the the original and the point where the replica is inserted.
  321.  
  322. g 17 # go to measure 17
  323. sel 4 # select the next 4 measures
  324. mdup 0 # duplicate selected measures 3 x at bar 17 + 4 = 21
  325. mdup 0
  326. mdup 0
  327.  
  328. Remark: this makes midish crash (as do all insert procedures!) if the 'rnew' command has been used because of the wretched line:
  329.  
  330. kat {3 0} 0 0
  331.  
  332. 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?:
  333.  
  334. sequence {...}; g [mend]
  335.  
  336. 4. Clear all data for one note
  337. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  338. 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:
  339.  
  340. g 1 # Go to bar 1.
  341. sel 2 # Select 2 bars
  342. ev {note {} 64} # Event, mark all notes of 64 (E3)
  343. tclr # Track, clear marked events
  344.  
  345.  
  346.  
  347. o==================o
  348. | G. Save and load |
  349. o==================o
  350.  
  351. 1. Midish Project
  352. ~~~~~~~~~~~~~~~~~
  353. Save/load Midish project file:
  354.  
  355. save "project.msh"
  356. load "project.msh"
  357.  
  358. Note that the local settings (like device configuration, metronome settings) are NOT saved [2].
  359.  
  360. 2. Midi file
  361. ~~~~~~~~~~~~
  362. Multichannel? Song mode? Loop?
  363.  
  364. import "mysong.mid"
  365. export "mysong.mid"
  366.  
  367. Playback via command line with amidiplay:
  368.  
  369. aplaymidi -p <<portnumber>> mysong.mid
  370.  
  371.  
  372.  
  373. o==================o
  374. | H. Usage example |
  375. o==================o
  376.  
  377. Make sure that your Midi hardware is setup in ~/.midishrc and connected to your computer!
  378.  
  379. 1. Connect input to output (check w/ 'ilist; olist'):
  380.  
  381. rnew Sinco JT4000
  382.  
  383. Check if it works by going into [i]nteractive mode and playing the keyboard.
  384.  
  385. 2. Load/save a project:
  386.  
  387. load "project.msh"
  388.  
  389. Or: program step by step, example (bar 0, step 3, note C4):
  390.  
  391. pstep 0 2 60
  392.  
  393. Or:
  394.  
  395. [r]ecord ([s]top and [p]lay) live playing.
  396.  
  397. Or import/export Midi file:
  398.  
  399. export "project.mid"
  400.  
  401. 4. Tip: use the extra features described in the section "Define track particulars".
  402.  
  403.  
  404.  
  405. o================o
  406. | I. Quirks/bugs |
  407. o================o
  408.  
  409. 1. Loop
  410. ~~~~~~~
  411. 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...??
  412.  
  413. 2. Clear
  414. ~~~~~~~~
  415. 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.
  416.  
  417. Use 'tcheck' to clean it up?
  418.  
  419. 3. Error messages
  420. ~~~~~~~~~~~~~~~~~
  421. Error:
  422.  
  423. bad v0 in event spec
  424.  
  425. 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.
  426.  
  427. Error:
  428.  
  429. statelist_done: non {5 0} 36 7f: unterminated frame
  430. statelist_done: kat {5 0} 0 0: unterminated frame
  431. statelist_done: kat {5 0} 0 0: unterminated frame
  432.  
  433. 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)?
  434.  
  435.  
  436.  
  437. o===============o
  438. | X. References |
  439. o===============o
  440.  
  441. [1] MIDI note number chart:
  442. https://computermusicresource.com/midikeys.html
  443.  
  444. [2] Midish manual on-line:
  445. https://midish.org/manual.html
  446.  
  447. [3] JBS Midish Extra Commands:
  448. http://juliencoder.de/test/sound/jbs_midish_extra-1.8.tar.bz2
  449. website:
  450. http://juliencoder.de/test/index.php?page=software/index
  451. manual on-line :
  452. http://juliencoder.de/test/publications/jbs_midish_extra-manual.html
  453.  
  454. [4] Linuxmusicains topic w/ the link to the Extra Commands:
  455. https://linuxmusicians.com/viewtopic.php?t=24338
  456.  
  457.  
  458.  
  459. o============================================o
  460. | Appendix A. Note to Midi Note number table |
  461. o============================================o
  462.  
  463. 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].
  464.  
  465. C C# D D# E F F# G G# A A# B
  466. 1 12 13 14 15 16 17 18 19 20 21 22 23
  467. 0 24 25 26 27 28 29 30 31 32 33 34 35
  468. 1 36 37 38 39 40 41 42 43 44 45 46 47
  469. 2 48 49 50 51 52 53 54 55 56 57 58 59
  470. 3 60 61 62 63 64 65 66 67 68 69 70 71
  471. 4 72 73 74 75 76 77 78 79 80 81 82 83
  472. 5 84 85 86 87 88 89 90 91 92 93 94 95
  473. 6 96 97 98 99 100 101 102 103 104 104 106 107
  474. 7 108 109 110 111 112 113 114 115 116 117 118 119
  475.  
  476. Miditech 12-Mini 32 Plus, Qtractor:
  477.  
  478. C C# D D# E F F# G G# A A# B
  479. 0 12 13 14 15 16 17 18 19 20 21 22 23
  480. 1 24 25 26 27 28 29 30 31 32 33 34 35
  481. 2 36 37 38 39 40 41 42 43 44 45 46 47
  482. 3 48 49 50 51 52 53 54 55 56 57 58 59
  483. 4 60 61 62 63 64 65 66 67 68 69 70 71
  484. 5 72 73 74 75 76 77 78 79 80 81 82 83
  485. 6 84 85 86 87 88 89 90 91 92 93 94 95
  486. 7 96 97 98 99 100 101 102 103 104 104 106 107
  487. 8 108 109 110 111 112 113 114 115 116 117 118 119
  488.  
  489.  
  490.  
  491.  
  492.  
  493.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement