Re: Useful MIDI Utilities
By George Bogatko
At 11:56 AM 3/24/96 PST, you wrote:
> Subject: Useful MIDI Utilities
I'm cranking on one to allow me to compose new O rolls using many "piano roll views" on Cakewalk and compress all those views into two "channels". The idea is to preview the arrangement using GS MIDI ( with the orchestral drum kit ) and then map all the notes into O roll format. It uses a library of utilities I found on the net..
To specify the mapping you create a map description file. Each line has this format:
<input channel>, <input note>, <output channel>, <output note>
The first hack takes an example file that came with the library, that converts a MIDI 1 file and converts it into a MIDI 0 file. I've modified it to do this mapping during the conversion. I still have to study the MIDI spec and the examples, and will then be able to filter a MIDI 1 file into a mapped MIDI 1 file, but for now, the results are very usable. One could, for instance, compose a tune destined for a Wurlitzer 150, and then map it into a MIDI file that would have all the "missing" notes mapped out.
Here is the map I'm using currently in my experiments.
file: "oroll.map" ***************************
#OROLL.MAP #Assumes piano is on channel 1 # xylo is on channel 2 - suppressed during conversion c=2, suppress
# pipes are on channel 3 - suppressed during conversion c=3, suppress
# percussion on channel 10 - assumes GS MIDI Orchestral percussion set # controls on channel 4
#Normal Chromatic scale e3 to a61 (notes 20-61) c=1, i=e3, c=2, o=e3 c=1, i=f3, c=2, o=f3 c=1, i=f#3, c=2, o=f#3 c=1, i=g3, c=2, o=g3 c=1, i=g#3, c=2, o=g#3 c=1, i=a3, c=2, o=a3 c=1, i=a#3, c=2, o=a#3 c=1, i=b3, c=2, o=b3
c=1, i=c4, c=2, o=c4 c=1, i=c#4, c=2, o=c#4 c=1, i=d4, c=2, o=d4 c=1, i=d#4, c=2, o=d#4 c=1, i=e4, c=2, o=e4 c=1, i=f4, c=2, o=f4 c=1, i=f#4, c=2, o=f#4 c=1, i=g4, c=2, o=g4 c=1, i=g#4, c=2, o=g#4 c=1, i=a4, c=2, o=a4 c=1, i=a#4, c=2, o=a#4 c=1, i=b4, c=2, o=b4
c=1, i=c5, c=2, o=c5 c=1, i=c#5, c=2, o=c#5 c=1, i=d5, c=2, o=d5 c=1, i=d#5, c=2, o=d#5 c=1, i=e5, c=2, o=e5 c=1, i=f5, c=2, o=f5
#SPLIT MIDI CHANNEL HERE AT PIANO MIDDLE C (assume two devtronix devices)
c=1, i=f#5, c=1, o=f#5 c=1, i=g5, c=1, o=g5 c=1, i=g#5, c=1, o=g#5 c=1, i=a5, c=1, o=a5 c=1, i=a#5, c=1, o=a#5 c=1, i=b5, c=1, o=b5
c=1, i=c6, c=1, o=c6 c=1, i=c#6, c=1, o=c#6 c=1, i=d6, c=1, o=d6 c=1, i=d#6, c=1, o=d#6 c=1, i=e6, c=1, o=e6 c=1, i=f6, c=1, o=f6 c=1, i=f#6, c=1, o=f#6 c=1, i=g6, c=1, o=g6 c=1, i=g#6, c=1, o=g#6 c=1, i=a6, c=1, o=a6
#SOLO chromatic scale a#6 to a8 c=1, i=a#6, c=1, o=a#6 c=1, i=b6, c=1, o=b6
c=1, i=c7, c=1, o=c7 c=1, i=c#7, c=1, o=c#7 c=1, i=d7, c=1, o=d7 c=1, i=d#7, c=1, o=d#7 c=1, i=e7, c=1, o=e7 c=1, i=f7, c=1, o=f7 c=1, i=f#7, c=1, o=f#7 c=1, i=g7, c=1, o=g7 c=1, i=g#7, c=1, o=g#7 c=1, i=a7, c=1, o=a7 c=1, i=a#7, c=1, o=a#7 c=1, i=b7, c=1, o=b7
c=1, i=c8, c=1, o=c8 c=1, i=c#8, c=1, o=c#8 c=1, i=d8, c=1, o=d8 c=1, i=d#8, c=1, o=d#8 c=1, i=e8, c=1, o=e8 c=1, i=f8, c=1, o=f8 c=1, i=f#8, c=1, o=f#8 c=1, i=g8, c=1, o=g8 c=1, i=g#8, c=1, o=g#8 c=1, i=a8, c=1, o=a8 c=1, i=a#8, c=1, o=a#8 c=1, i=b8, c=1, o=b8
# Percussion mapping - GS MIDI patch 48 (orchestra drum set) # 1. timpani - MIDI 36 c=10, i=36, c=2, o=21
# 2. Bass drum and tap cymbal - MIDI 59 (cymbal only) c=10, i=59, c=2, o=22
# 3. timpani - MIDI 87 c=10, i=87, c=2, o=23
# 4. wood block - MIDI 62 c=10, i=62, c=2, o=24
# 5. snare drum tap - MIDI 38 c=10, i=38, c=2, o=25
# 6. snare drum roll - MIDI 40 (but you have to reiterate yourself) c=10, i=40, c=2, o=26
# 7. triangle - MIDI 34 c=10, i=34, c=2, o=27
# 86. tambourine - MIDI 54 c=10, i=54, c=1, o=106
# 88. crash cymbal - MIDI 57 c=10, i=57, c=1, o=108
# CONTROLS # 50 - forward to play c=4, i=50, c=2, o=20
# 51 - piano sustain c=4, i=51, c=2, o=28
# 52 - piano soft pedal on c=4, i=52, c=2, o=30
# 53 - piano soft off c=4, i=53, c=2, o=29
# 54 - mandolin on c=4, i=54, c=2, o=32
# 55 - mandolin off c=4, i=55, c=2, o=31
# 56 - pipes on c=4, i=56, c=2, o=33
# 57 - pipes off c=4, i=57, c=2, o=39
# 58 - drum expression on (soft) c=4, i=58, c=2, o=35
# 59 - drum expression off (loud) c=4, i=59, c=2, o=36
# 60 - xylophone on c=4, i=60, c=2, o=34
# 61 - xylophone off c=4, i=61, c=2, o=37
# 62 - crescendo c=4, i=62, c=1, o=87
# 63 - shut off c=4, i=63, c=2, o=38
# 64 - rewind c=4, i=64, c=1, o=89
************************
If you don't map the note, you don't get it in the output.
I'm still playing with speeding it up. It uses linked lists for storage, which grinds to a slow crawl rather quickly. A btree approach will speed things up.
The other major drawback is that it currently only successfully compiles with the GNU C/C++ compiler for DOS. I do *no* work on DOS or Windows (my major money making job is on UNIX systems), so have never bought the MS C++ compiler. The GNU compiler has the advantage of being incredibly cheap. You can find it on the "Source Code" disk from InfoMagic (info@infomagic.com) which costs $20. A complete C/C++ environment which purports to contain hooks into windows.
JODY: If this is interesting, when I get the b-tree version going I can upload the source and a GNU binary (it runs under DOS, but needs some supporting executables) to wherever you want. Just let me know where to store it. I can also put it on my web page. Everything is covered under the GNU license. If anybody is *really* interested, drop me a line and I'll post/send the current hack now.
GB ************************************************* George Bogatko - gbogatko@intac.com http://www.intac.com/~gbogatko
[ George, [ All of my MIDI programs use a sorted linked list with an array of [ "hints" to help find the insertion point. A B-Tree would probably [ be more general (its easy to exceed the size of the hint array). [ Unfortunately I found that its easy to end up with more data structure [ "overhead" than actual data, and running under DOS thats a disaster. [ Perhaps paging portions of the tree out to disk might help. [ [ There's quite a few subscribers that would be interested in seeing [ your code. I'd be happy to put any source you want to upload into [ the .../misc subdirectory in the FTP archive on foxtail. I assume [ you intend to let people do what they want with this ? [ [ Being permanently connected to the Internet at 56Kb allows me to [ download all kinds of goodies pretty quickly, so I've only bought a [ few CDs containing "free" software. I did buy the entire GNU archive [ a while back, though. The GNU stuff works really well with all of [ the Unix clones (BSDI, Free BSD, and Linux). I really like that [ you get the source code and are encourage to embellish on the programs [ if you want to. Linux has become quite popular amongst the hobby crowd [ and is also distributed under a "GNU Style" license (sometimes referred [ to as a "copyleft"). Linus is available on CD (there are several vendors) [ and is cheaper than the floppies that it would take to hold all the source. [ Linux had sound card and MIDI card drivers, supports X Windows and [ 32 bit virtual addressing. I can process the largest MIDI files [ imaginable on Linux running on a 386 with 8 Meg of Ram. Of course, [ I'm now running BSDI on a Pentium with 32 meg, but thats another story. [ [ For my "commercial" MIDI products that run under DOS on the PC, I use [ Borland C++ 3.5 with its Integrated Development Environment. I still [ prefer the Unix "vi" editor, but the Borland IDE does a nice job of [ integrating the Editor, Compiler, and Debugger in a way that is a lot [ less mysterious than using the Unix equivalent. [ [ Jody |
(Message sent Sun 24 Mar 1996, 21:51:44 GMT, from time zone GMT-0500.) |
|
|