Advertisement
Meneer_Jansen

My midishrc

Nov 22nd, 2024 (edited)
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.19 KB | None | 0 0
  1. # Download a general version of this RC file from:
  2. # https://pastebin.com/
  3.  
  4. # Device numbers. Use 'aseqdump -l' to determine client names.
  5. dnew 0 "i2 mini 32 plus" ro
  6. dnew 1 "SINCO" rw
  7. dnew 2 "Cre8audioNiftyCASE" wo
  8. dnew 3 "JT-4000 MICRO" rw
  9. dnew 4 "RHYTHM DESIGNER RD-6" rw
  10. dnew 5 "Arturia MicroFreak" rw
  11. dnew 6 "monologue" rw
  12.  
  13. # Inputs
  14. inew monologue {6 0}
  15. inew Arturia_MicroFreak {5 0}
  16. inew RD6_drum {4 0} # Device number 4, Midi channel 0. Midi
  17. # channel 0 is called channel 1
  18. # on some devices or computers.
  19. inew JT4000_synth {3 0}
  20. inew Sinco_wireless {1 0}
  21. inew i2_mini {0 0}
  22.  
  23. # Outputs
  24. onew monologue {6 0}
  25. onew Arturia_MicroFreak {5 0}
  26. onew RD6_drum {4 0}
  27. onew JT4000_synth {3 0}
  28. onew Sinco_wireless {1 0} # Output to the Sinco because it's in- and out.
  29. onew NiftyCase {2 0} # I'm gonna name device 2, channel 0 to
  30. # output: "NiftyCase".
  31.  
  32. # Create new (temporary) track (default is 120 BPM)
  33. tnew temptrack
  34.  
  35. # Set quantisation to 16th note (check w/ 'getq'). Set tempo to 100 BPM (check w/ 'mtempo')
  36. setq 16; t 100
  37.  
  38. # Go to measure 1 instead of 0 because of the problems w/ the 'wipe' procedure (see further on).
  39. #g 1
  40. # Nope. Go to bar 0 because of problems with looping...
  41. g 0
  42.  
  43.  
  44. ##############
  45. # PROCEDURES #
  46. ##############
  47.  
  48. # Procedure to quantize every bar (from 0 to end) at 100%
  49. proc quantize \
  50. {
  51. g 0; sel [mend]; tquanta 100
  52. print "Everything is now quantized to "[getq]"-th note."
  53. }
  54.  
  55. # Procedure to set the metronome on easier. Assume device is on Midi channel 0. Set metronome on only when recording.
  56. proc metronome dev_number \
  57. {
  58. metrocf {non {$dev_number 0} 68 127} {non {$dev_number 0} 60 127};
  59. m rec;
  60. print "During record the metronome is played on device: " $dev_number
  61. }
  62.  
  63. # Procedure show note-to-midi conversion table.
  64. proc conversiontable \
  65. {
  66. print
  67. print "Table to convert music note to Midi-note-number: "
  68. print
  69. print " C C# D D# E F F# G G# A A# B "
  70. print "0 12 13 14 15 16 17 18 19 20 21 22 23 "
  71. print "1 24 25 26 27 28 29 30 31 32 33 34 35 "
  72. print "2 36 37 38 39 40 41 42 43 44 45 46 47 "
  73. print "3 48 49 50 51 52 53 54 55 56 57 58 59 "
  74. print "4 60 61 62 63 64 65 66 67 68 69 70 71 "
  75. print "5 72 73 74 75 76 77 78 79 80 81 82 83 "
  76. print "6 84 85 86 87 88 89 90 91 92 93 94 95 "
  77. print "7 96 97 98 99 100 101 102 103 104 104 106 107"
  78. print "8 108 109 110 111 112 113 114 115 116 117 118 119"
  79. print
  80. }
  81.  
  82. # Scratchpad: sequence {ll 68 s s 64 l 62 60 s s s s s s s s}
  83. proc sequence mylist {
  84. print "Example: sequence {ll 68 s s 64 65 l 62 60 s s s s s s s} "
  85. print " "
  86. print "Input 16 Midi note numbers between curly braces { } "
  87. print " "
  88. print " s = silence/skip. "
  89. print " l + note = long note (8th) of 2 steps "
  90. print " ll + note + s + s = long long note (4th) of 4 steps (1 beat) "
  91. print " "
  92. print "Use the command [conversiontable] for conversion of notes to numbers. "
  93. print "Bar at which seq. will be inserted (numbering starts at 0) is: "[getpos]" th bar."
  94. print
  95. let step = 0
  96. let flag_l = 0
  97. let flag_ll = 0
  98. for note in $mylist {
  99. if $step != 16 {
  100.  
  101. if $note != s && $note != l && $note != ll && $flag_l != 1 && $flag_ll != 1 {
  102. pstep [getpos] $step $note
  103. let step = $step + 1
  104. }
  105.  
  106. if $note == s {
  107. let step = $step + 1
  108. }
  109.  
  110. if $flag_l == 1 {
  111. let flag_l = 0
  112. pstep [getpos] $step-1 $note
  113. let pattern_note_length = 16
  114. let step = $step + 1
  115. }
  116.  
  117. if $note == l && $flag_l == 0 {
  118. let flag_l = 1
  119. let pattern_note_length = 8
  120. let step = $step + 1 # Enter note in next loop
  121. }
  122.  
  123. if $flag_ll == 1 {
  124. let flag_ll = 0
  125. pstep [getpos] $step-1 $note
  126. let pattern_note_length = 16
  127. let step = $step + 1
  128. }
  129.  
  130. if $note == ll && $flag_ll == 0 {
  131. let flag_ll = 1
  132. let pattern_note_length = 4
  133. let step = $step + 1 # Enter note in next loop
  134. }
  135. } # close if
  136. } # close for
  137. } # close proc
  138.  
  139. # Scratchpad (C4maj F4maj F5maj):
  140. # rnew i2_mini JT4000_synth; chord {60 64 67 s l 65 69 72 s s s s 77 79 84 s}
  141. proc chord chordlist {
  142. print "Example: chord {60 64 67 s l 65 69 72 s s s s 77 79 84 s} "
  143. print " "
  144. print "Input 3 note chords between curly braces { } "
  145. print " "
  146. print " s = skip a step (16th note) "
  147. print " chord + s = chord of a quarter note (1 beat) "
  148. print " l chord + 4 x s = long chord of a half note (2 beats) "
  149. print " ll chord + 8 x s = long long chord of 1 bar (4 beats) "
  150. print " "
  151. print "Use the command [conversiontable] for conversion of notes to numbers. "
  152. print "Bar at which seq. will be inserted (numbering starts at 0) is: "[getpos]" th bar."
  153. print
  154.  
  155. let step = 0
  156. let chordpos = 0
  157. let counter = 0
  158. let flag_l = 0
  159. let counter_l = 0
  160. let flag_ll = 0
  161. let counter_ll = 0
  162. for note in $chordlist {
  163.  
  164. if $note != s && $note != l && $note != ll && $flag_l != 1 && $flag_ll != 1 {
  165. let pattern_note_length = 4
  166. pstep [getpos] $chordpos $note
  167. let step = $step + 1
  168. }
  169.  
  170. if $note == l {
  171. let flag_l = 1
  172. let step = $step + 1
  173. }
  174. if $note == ll {
  175. let flag_ll = 1
  176. let step = $step + 1
  177. }
  178.  
  179. if $flag_l == 1 && $counter_l < 8 && $note != s && $note != l && $note != ll && $flag_ll != 1 {
  180. # Count if [l]ong note is set
  181. let counter_l = $counter_l + 1
  182. let pattern_note_length = 2
  183. pstep [getpos] $chordpos $note
  184. let step = $step + 1
  185. }
  186. if $flag_ll == 1 && $counter_ll <= 4 && $note != s && $note != l && $note != ll && $flag_l != 1 {
  187. # Count if [ll]ong long note is set
  188. let counter_ll = $counter_ll + 1
  189. let pattern_note_length = 1
  190. pstep [getpos] $chordpos $note
  191. let step = $step + 1
  192. }
  193.  
  194. # Reset counter_l and flag_l
  195. if $counter_l >= 8 {
  196. let counter_l = 0
  197. let flag_l = 0
  198. }
  199. # Reset counter_ll and flag_ll
  200. if $counter_l > 4 {
  201. let counter_ll = 0
  202. let flag_ll = 0
  203. }
  204.  
  205. if $note == s {
  206. let step = $step + 1
  207. }
  208.  
  209. if $step % 4 == 0 {
  210. let chordpos = $step
  211. # End long chord modes
  212. let flag_l = 0
  213. let flag_ll = 0
  214. }
  215. } # close for
  216.  
  217. # Reset note length to "normal"
  218. let pattern_note_length = 16
  219. } # close proc
  220.  
  221.  
  222. proc help \
  223. {
  224. print
  225. print "Additional procedures: "
  226. print "[sequence], [conversiontable], [wipe] track, [quantize], [t]empo in BPM, "
  227. print "[metronome] on 'devicenumber'. [chord] "
  228. print
  229. print "[sequence]: "
  230. print "This command takes a list of 16 Midi note numbers between curly braces { }. "
  231. print "You can also enter an 's' to skip a step and 'l' for a long 8th note. Use "
  232. print "'ll note s s' for an even longer entry of a 1/4 note. The procedure "
  233. print "[conversiontable] prints a table to help you to convert notes to numbers. "
  234. print
  235. print "Type '[procedure] help' for more info. "
  236. print
  237. }
  238.  
  239.  
  240. # General info to show at startup:
  241. print "This is the file ~/.midishrc "
  242. print "Inputs and outputs you can use are called (check with 'ilist; olist'): "
  243. print "Inputs: "
  244. print [ilist]
  245. print "Outputs: "
  246. print [olist]
  247. print
  248. print "Ignore these messages about Midi devices that you've not connected (yet): "
  249. print "alsa_open: couldn't parse alsa port"
  250. print
  251. print "Current tempo: "[mtempo]" BPM, quantsation: "[getq]"th, track: "[gett]
  252. print
  253. print "Short procedure "
  254. print "--------------- "
  255. print "1. Connect input to output, example: rnew Sinco_wireless JT4000_synth "
  256. print "2. Then [i]nteractive, [r]ecord, [s]top or [p]lay "
  257. print "3. Type [help] for more procedures or '[procedure] help' "
  258. print
  259.  
  260. # ---------------------------------------------------------------------------
  261. # Make use of the extra functions from Jeanette C. Unfortunately one may ONLY use a hard path reference to a file to executed (you cannot use ~ for '/home/your_name/' nor /home/$USER/').
  262. print "Messages from midish_extrarc: "
  263. exec "/home/your_name/.midish_extrarc"
  264. print
  265.  
  266. # ----------------------------------------------------------------------------
  267.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement