home *** CD-ROM | disk | FTP | other *** search
/ Sound, Music & MIDI Collection 2 / SMMVOL2.bin / MIDI_PAT / MDLPBK22.ZIP / MIDLPBK.TXT < prev    next >
Encoding:
Text File  |  1995-10-10  |  19.5 KB  |  462 lines

  1.  
  2.   Hubi's LoopBack device   Version 2.2              October 10, 1995
  3.     
  4.  virtual MIDI driver for Windows3.1 to connect multiple Windows-MIDI-programs.
  5. _____________________________________________________________________________
  6.  
  7.  This package may be of use for You, if you
  8.  * work simultaneous with multiple MIDI programs in Windows (or want to do it).
  9.  * hate the Message "the MIDI device is currently in use by another ...".
  10.  * simply want to hear the OPL2-FM chips of your SoundBlaster when you play 
  11.    your Waldorf Wave keyboard (can't get that noiz out).            do you? :-)
  12.  * Use your favorite Synth-Editor together with your favourite MIDI-Sequencer,
  13.    Combine the best of all MIDI programs.
  14.  * Don't want to wait for OMS.
  15.  
  16.  This package is NOT for You, if you
  17.  * ask now "What is MIDI ?"
  18.  * laugh with pleasure about Microsofts error messages and their funny
  19.    translations. (is there a BestOf anywhere on the Net ?) 
  20.  * won't hear a PC ventilator fan near your Waldorf Wave.  
  21.  * your only MIDI application is a MIDI Jukebox player. 
  22.  
  23. _____________________________________________________________________________
  24.  
  25. Highlights
  26.  
  27.  up to 4 new MIDI In/Outputs 
  28.  Multi client feature allows mixing and duplication of MIDI messages
  29.  full SysEx support
  30.  Very low memory requirements (about 5K fixed / 4k discardable Windows memory)
  31.  No hardware required (except your Windows-PC)
  32.  Port names can be edited 
  33.  CAN EXTEND YOUR MIDI-DRIVER TO MULTI-CLIENT FASCILITY !
  34.  comes with hwmdcabl.exe - the realtime SysEx-thru icon.
  35.  program source is available
  36.  IT'S FREEWARE
  37.  
  38. _____________________________________________________________________________
  39.  
  40.                            Table of Contents
  41.   
  42.   Installation
  43.   Updating from a Previous Version
  44.   How "Hubi's LoopBack works"
  45.   How "Hubi's MidiCable works"
  46.   Simple Example Setup
  47.   Making a MIDI port Multi Client able
  48.   Hints and Warnings : Midi-Thru, Cubase, CTL3D.DLL
  49.   History
  50.   Future Enhancements - What YOU can do
  51.   About the Author
  52.   
  53. _____________________________________________________________________________
  54.  
  55. Installation
  56.  
  57.  Unzip into an empty directory
  58.  
  59. pkunzip a:mdlpbk22 -d c:\tmp
  60. Copy the files HWMDCABL.EXE and HWMDCB.DLL to another directory. If you use
  61. Windows FileManager, use the Drag&Drop feature to install a ProgramManager
  62. icon. 
  63.  
  64.  Start Windows, select "Control Panel" from the "Main" group, select Drivers,
  65. select Add button, select "unlisted driver", OK, enter your directory
  66. (eg. C:\TMP). Now you should see "Hubis Loopback V2.2", and press OK. Now the
  67. configuration dialog comes up and you must select the number of ports to use.
  68. 2 should be a good starting point, but WARNING: Windows cannot handle more than
  69. 10 midiports (+Midimapper). 
  70. After Restart, the new MIDI In and Outputs will be available then. If you have
  71. no CTL3D.DLL in your \windows or \windows\system directory (nearly impossible)
  72. then you must install one manually.
  73.  
  74. ______________________________________________________________________________
  75.  
  76. Updating from a previous version
  77.  
  78.  The main difference to the previous versions 1.0 and 1.1 is, that midlpbk.dll
  79. now can deal with multiple clients. Each port can be opened by up to 4 MIDI-In
  80. clients and up to 10 MIDI-Out clients. This feature makes the old matrix
  81. configuration now unnecessary, and allows a more powerful and flexible
  82. configuration that is also easier to maintain.
  83.  
  84. Removed features are:
  85. - IN- and OUT ports now have the same name
  86. - Matrix-setup removed
  87. - No more a Control Panel Applet
  88.  
  89. This means you have to 
  90.  remove your ProgMan-Icons for "control midlpbk.dll",
  91.  remove from control.ini, Section [MMCPL] the line
  92.   Hubis LoopBack=c:\windows\system\midlpbk.dll
  93.  
  94. Please remove the old driver before installing the new one. This saves some
  95. space in system.ini.
  96.  
  97. The new features are
  98. + Multi Client
  99. + Port Name Dialog
  100. The setup dialog is now only available from SytemControl->Drivers->Configure.
  101.  
  102.  Between the versions 2.0 to 2.2 is no functional difference, only peripheral
  103. smoothing.
  104. ______________________________________________________________________________
  105.  
  106.  How "Hubi's LoopBack" works:
  107.  
  108.  There is a MIDI output port and a MIDI input port. All data sent to
  109. the output will be available at the input port, that is the MIDI output
  110. from one program is the input of another program.
  111.  
  112.    Prog1 >--[ LB1 ]--> Prog2
  113.  
  114. You should think about a MIDI node, which can be opened as output
  115. from several programs and input of others. Each of this programs is named
  116. "a client". The output of all OUT-clients is mixed down and sent to all 
  117. IN-clients. Multi-Client means, that each node can have up to 4 IN-clients 
  118. and 10 OUT-clients.
  119. Hubi's LoopBack can serve up to 4 nodes, but changing the number of active
  120. ports (=nodes) requires to restart Windows.
  121. ______________________________________________________________________________
  122.  
  123. How "Hubi's MIDI cable" works
  124.  
  125. It's a simple MIDI-thru program with following features: 
  126. - All MIDI processing in realtime - no Windows delays
  127. - Full SysEx support
  128. - unlimited SysEx Message size
  129. - low resource requirements (I could start it 57 times!)
  130.     
  131. Unique Feature: === skip this paragraph if you're not a programmer ===
  132.  The design of Windows MMSYSTEM extensions would not allow to use the
  133. function midiInAddBuffer during interrupt time, so it must be done later by a
  134. Window-Message response. But Windows is a preemptive multitasking system and
  135. sometimes applications have no chance to process the queued Window messages.
  136. If much MIDI System Exclusive messages are sent in a short time (like editing
  137. Synth parameters), and Window messages cannot be processed (e.g.  the user
  138. holds down the mouse button over a slider), then the MIDI buffers cannot be
  139. re-added to the input driver before the next buffer is filled and delivered...
  140. the data chain is broken.  So I decided to use a better solution. 
  141.  I programmed the midiInAddBuffer functionality myself, so I can use it at
  142. interrupt time. I simply remember the last added buffer and set its lpNext
  143. member to the new buffer, and the new buffer will become the last added buffer
  144. (that's what all MIDI driver do).  The result looks perfect for me.  I use
  145. three 1kB buffers (only one global handle).  A buffer overflow can only occur
  146. when receiving from a a 38400 baud (serial "To Host" device) and sending to
  147. 31250 baud (MPU401) MIDI port (that is, receive from a fast hardware port and
  148. send to a slower hardware port). The COM port gets ~ 715 bytes per second more
  149. than the MPU can transmit and so data will be lost after 3-4 seconds ( ~
  150. 10-15k System Exclusive Message Size). No lost data is possible when one port
  151. of the connection is a Windows MIDI application, connected via a virtual MIDI
  152. driver.
  153.       
  154. Usage:
  155.     - Start
  156.     - Search icon, then select MIDI-in port and MIDI-out port.
  157.     - .... play your attached MIDI keyboard
  158.     - Close 
  159.     - the settings are remembered for the next start (in win.ini).
  160.  
  161. Usage for advanced users:
  162.     The pro's need more than one instance running (I tried 57!), so I 
  163.     gave the program the option to pass the ports on the command line. 
  164.     e.g.   HWMDCABL.EXE IN=1 OUT=1 
  165.     Create an own program manager icon for each needed MIDI-connection
  166.     and edit the appropriate command line. The numbers are the same as
  167.     in the icon menu.
  168.      If it should start at startup, copy the program manager icons into
  169.     the Autostart program group (hold down the <Ctrl> key while dragging
  170.     with the mouse).
  171.  
  172. ______________________________________________________________________________
  173.  
  174.  
  175. Simple Example Setup:
  176.  
  177. The symbol >>>> means a running HWMDCABL.EXE instance.
  178.  
  179. [SB MIDI In]--->>>>---[LB1]---<Cubase>---[LB2]--->>>>--[SB MIDI out]
  180.                      / / \\_<SynthEditor>_// \
  181.            MidiJoy_/  /   \<CakeWalk>____/    \<MidiMonitor>
  182.    virtual Keyboard_/      \<MidiMonitor>
  183.  
  184. Note what's possible with only 2 nodes activated, and now imagine how
  185. complicated your setup could be with all 4 nodes activated...
  186.  
  187. But if Creative Labs makes their SB16 MIDI Driver with multi client support,
  188. most would work without midlpbk.dll
  189.  
  190. _____________________________________________________________________________
  191.  
  192.  MAKING A MIDI PORT MULTI-CLIENT-ABLE
  193.  
  194. You can use a loopback-port together with HWMDCABL.EXE to make a Hardware
  195. MIDI port (eg. SoundBlaster) able to handle with multiple clients.
  196.  
  197. There exist already several MIDI drivers which are able to deal with more
  198. than one client. I know of following:
  199.   Twelve Tone Systems MPU401 driver (comes with Cakewalk)
  200.   Voyetra Super SAPI FM synth (comes with SB16)
  201.   KORG PC I/F V1.11 (for KORG X5/05RW/X5DR)
  202.   Jamie O'Conell's FMSynth driver for OPL2/3 (V1.04? )
  203.   All Turtle Beach drivers
  204.  
  205. A test if your driver supports multi-client access is simple:
  206.   - start 2 instances of HWMDCABL.EXE 
  207.   - try to open one port (in or output) simultaneous by both midicable-icons.
  208.     If this works without an error message box, the port supports multi-client
  209.     access. If an error message box comes with "the midi port is already in 
  210.     use..", multi client access is not supported.
  211.   - IN and OUT - ports are independent of each other, so you must check both.
  212.  
  213. To make a single access port multi client able, you must combine a LoopBack
  214. node with a MIDI thru application: HWMDCABL.EXE
  215.  
  216. I'll demonstrate how to make the SB-MIDI port Multi-Client:
  217. If you install midlpbk.dll and configure it with 2 active ports, then you'll
  218. have 4 available MIDI inputs:
  219.  1 [SB16 MIDI In]
  220.  2 [Voyetra Super SAPI FM Synth]
  221.  3 [LB1]
  222.  4 [LB2]
  223.  
  224. The MIDI outputs should look like:
  225.  1 [Microsoft MidiMapper]
  226.  2 [SB16 MIDI Out]
  227.  3 [Voyetra Super SAPI FM Synth]
  228.  4 [LB1]
  229.  5 [LB2]
  230.  
  231. We use LB2 for the extension. For easier maintenance of the resulting setup,
  232. we rename LB2 to "Multi SB MIDI In" (This is done by double-clicking at the
  233. port name in the configuration dialog in Windows-Sytem-Control, Drivers). Now
  234. we must start hwmdcabl.exe. The most user friendly way would be to start it
  235. automatic on Windows startup. The installation is easy: 
  236.  - Open ProgramManager and FileManager so that both are visible (Why do most
  237.    users use them in full screen mode ? ).
  238.  - Select the hwmdcabl.exe directory in FileManager
  239.  - Open the AutoStart group in ProgramManager
  240.  - Move the mouse (only the cursor) to FileManager, click over "hwmdcabl.exe"
  241.    and hold the mouse button down and move this icon into ProgramManagers
  242.    Autostart group and release the mouse button. Installed.
  243.  - Now we must tell hwmdcabl.exe which ports it should use. Start hwmdcabl.exe
  244.    and open the system menu of the appearing icon. You'll see a large menu
  245.    with all MIDI-IN ports in the middle and all MIDI-OUT ports at the right
  246.    side. Look at the numbers before the ports and remember the wanted IN and
  247.    OUT port number. Now switch to ProgramManager and hilight the Hwmdcabl icon
  248.    in the Autostart group. Press Alt-Enter to edit its properties.
  249.  - Append " IN=x OUT=y" (without quotes but with leading blank) to the
  250.    CommandLine field. x and y must be replaced with the appropriate port
  251.    numbers from the menu. 
  252.  - Edit the Description field to "Multi SB MIDI In" or whatever you want
  253.  - press OK
  254.  
  255. In the above example, this could look like this dialog snapshot: 
  256.   
  257.   Description  [Multi SB MIDI In                         ]   ( OK   )
  258.   CommandLine  [C:\WINUTILS\MIDI\HWMDCABL.EXE IN=1 OUT=5 ]   (Cancel)
  259.   Directory    [C:\WINUTILS\MIDI                         ]   (Search)
  260.   Hotkey       [<none>                                   ]   (Symbol)
  261.  
  262. The next step is to change the setup of your MIDI programs to use the new
  263. "Multi SB MIDI In port", which can be opened by 4 programs simultaneous now.
  264.  
  265. The menu of the running HWMDCABL.EXE program should look like:
  266.  
  267.  0   None                        | 0   None                        |
  268.  --------------------------------|---------------------------------|
  269.  1 X SB16 MIDI In                | 1   Microsoft MidiMapper        |
  270.  2   Voyetra Super SAPI FM Driver| 2   SB16 MIDI Out               | 
  271.  3   LB1                         | 3   Voyetra Super SAPI FM Driver|
  272.  4   Multi SB MIDI In port       | 4   LB1                         |
  273.                                  | 5 X Multi SB MIDI In port       |
  274.                  
  275. an the icon title should be "SB 16 MIDI In to Multi SB MIDI In port".
  276.  
  277.  
  278. To make an output Multi-Client, read this chapter again with words IN and OUT
  279. swapped.
  280. _____________________________________________________________________________
  281.  
  282. Integrating MIDIMAPPER in setup
  283.  
  284. Example: a Yamaha PSS790 + Cakewalk Homestudio
  285.     - PSS790 sends all MIDI IN unchanged to MIDI OUT (merged with Keys)
  286.     - Cakewalk Homestudio has no Input Channel Filter.
  287.     - If you want to sequence a song using the PSS790 Synth during record,
  288.       you'll get all MIDI data back at the MIDI-In and will record all
  289.       16 MIDI channels (echoed from PSS790 out) at the current track.
  290.  
  291.  [PSS790]-[MPU]-->>>--[MidiMapper]--[LB1]--[Sequencer]--[MPU]--[PSS790]
  292.  
  293.     * enable one virtual Node LB1
  294.     * Setup MidiMapper: Only channel 1 is enabled and sent to LB1, rest off.
  295.     * MidiCable with IN=MPU and OUT=MidiMapper
  296.     * Only LB1 as Input in Sequencer
  297. Now the Sequencer receives only channel 1 ! And you can record track by track now.
  298. _____________________________________________________________________________
  299.  
  300. HINTS & WARNINGS:
  301.  
  302.  
  303. MIDI THRU
  304.  
  305.  When using the MIDI-thru option in your Sequencer application, be sure 
  306. it doesn't record it's own output when it sends to a virtual MIDI port. The
  307. system will slow down or hang if a Midi-message circles around.
  308.  
  309. ! A SEQUENCER PROGRAM MUST NOT HAVE THE SAME MIDI-NODE AS INPUT AND OUTPUT !
  310. If it has, then be sure that any Midi-thru option is disabled.
  311.  
  312.  
  313. CUBASE 
  314.  
  315. Using with Cubase for Windows, MusicStation and Cubasis:
  316.  Since Cubase allocates all MIDI-Inputs and Outputs by default, you must
  317. download the MROS-MME setup-utitlity from 
  318.  ftp://mcc.ac.uk/pub/cubase/updates/Windows/set_mme.exe (upl. Feb 95)
  319. This utility comes from Steinberg, but I don't know if it's included in the
  320. current releases of Cubase/Cubasis/MusicStation. It can de/activate, sort and
  321. even rename (inside Cubase) the available MIDI ports. To avoid midi-thru
  322. problems, enable only LB1 for input and only LB2 for output. 
  323. Cubase will hang on startup if it one Node is activated as In- and Output.
  324.  
  325. I have tested following Sequencers:
  326.    Cubasis Demo, MusicStation Demo 1.1, CubaseScore1.1 : Require all SET_MME !
  327.    Cubase 1.0 (the unstable, but not-copy protected version) requires SET_MME+newest
  328.     MROS.DLL and drivers, but the ports can only be seen as numbers then.
  329.  
  330. I had no problems with:
  331.    Cakewalk 3.0 Demo, WinJammer 2.3, Passport Trax, MidiSoft Recording Session,
  332.    WinSysEx 3.0, TTS Virtual Piono, MidiKeyb, .......
  333.  
  334. I was able to synchronize demos of SoundForge 3.0, SAW and Samplitude Studio with Cubase,
  335. I could record from Cakewalk to Cubase and vice versa.
  336.  
  337. I couldn't get any sound out of a MicroLogic demo (seems to be fixed to first MIDI port). 
  338.  
  339.  
  340. CTL3D.DLL 
  341.  
  342. midlpbk.dll uses ctl3dv2.dll for their dialogs if installed.
  343. _____________________________________________________________________________
  344.  
  345. History:
  346.  
  347. V 0.x Jan 94 : 1st working version, but nearly unused due to Cubase problems.
  348.  
  349. V 1.0 Feb 95 : first upload (Steinberg released set_mme-utility)
  350.  
  351. V 1.1          Code segment made fixed. 
  352.                MidiOutShortMsg can be reentered 4 times now (should be enough)
  353.                Device Names can be edited in system.ini
  354.  
  355. V 2.0 Jun 95 : Multi-Client version. Remove all beautiful features (no more
  356.                necessary). Source splitted in fixed- and discardable code.
  357.            Packaged with HWMDCABL.EXE
  358.  
  359. V 2.1 Aug 95 : Fix for SB16 with TB-Rio, IN- and OUT- names can be different
  360.            (required for TB-WavePatch - see wfpatch.wri )
  361.  
  362. V 2.2 Oct 95 : dynamic load of Ctl3dV2.dll, only if installed.
  363.  
  364. ------------------------------------------------------------------------------
  365. Future enhancements:
  366.  
  367.     If no-one finds a bug, it's the FINAL RELEASE
  368.      (see end of document for email address)
  369.  
  370.  
  371.  WHAT OTHER PROGRAMMERS CAN DO :
  372.  
  373.  I think it should now be easy for musical programmers to enhance their system
  374. with small MIDI utilities, like random note generators, midi message
  375. translation applications, problem specific input dialogs (VB is a good
  376. language for this). 
  377.  
  378.  What do you think of something like an MCI-Sequencer? It could play
  379. Sounds, Videos and Animations synchronous to your MIDI files (something
  380. like the MCI commands in Cakewalk). 
  381.  
  382.  Or a MIDI-triggered WAV-player ? I've tried one using Microsoft's
  383. WAVEMIX.DLL, but I'm not happy with timing and quality. It should be possible
  384. to MIX up to 16 Channels with volume and pitch control at 44kHz 16Bit Stereo
  385. (most MOD-Players can do this!).
  386.  
  387.  Or a MicroPhone to MIDI converter ? 
  388.  
  389.  -------------
  390.  
  391. Win95 : I have neither a compiler nor a SDK for Win95 nor Win95ß nor 
  392.         any MIDI app that strictly requires Win95. My money would be better
  393.         invested in a good MIDI-Keyboard with Aftertouch (polyphonic??).
  394.  
  395. Note: In the documentation of version 1.1, I said that the MMSYSTEM design of
  396.       Microsoft would not allow full featured multi-client drivers. I was
  397.       wrong. It was indeed very simple to implement it. As a hobby programmer, 
  398.       I can't afford MSDN Level 1 or 2, so I'm always behind in getting
  399.       information (I had to do some disassembling). 
  400.       But I don't know why Microsoft has not impelemented this very useful
  401.       feature in their own drivers and their DDK SoundBlaster example.
  402.  
  403.  BTW, I've bought a Microsoft Home Mouse. It contains some funny programs for
  404.     modifying the Windows-cursor. After installation of the 2 floppies, one 
  405.     of the directories contains 457 cursor files with 326 bytes length each. 
  406.     But if you install this onto a harddisk partition with more than 1 GB, 
  407.     15 MB of your C: drive is occupied (a 32 kB cluster per file). What I want
  408.     to say is, only Microsoft is able to copy 15 MB uncompressed to a floppy.
  409.  
  410. ______________________________________________________________________________
  411. Undocemented features:
  412.  
  413. WIN.INI:
  414.  
  415. [Hubi's MIDI cable]
  416. SysExSize=1024
  417. Use3D=1
  418.  
  419.  
  420. SYSTEM.INI:
  421.  
  422. [midlpbk.drv]
  423. Use3D=1
  424. ______________________________________________________________________________
  425.  
  426. The following programs should be available at the same where place you got 
  427. this file. I've uploaded them to ftp.cs.ruu.nl/pub/MIDI/PROGRAMS/MSWINDOWS
  428. Simtel and CICA will follow
  429.  
  430.   MDUTLS10.ZIP : 
  431.      MIDI_MON: "MIDI MONITOR" - show received MIDI messages, (with SysEx!) 
  432.      MIDICONN: "MIDI CABLE" - simple MIDI Thru application (with SysEx!)
  433.      SYX_OUT: an Iconized-Application for sending .SYX dumps to Synthesizers,
  434.              with File Manager Drag and Drop Interface.
  435.    ==> The file hwmdcb.dll in mdutls10.zip is an older version of the one
  436.        included in mdlpbk20.zip. Please replace the old with the new one to
  437.        avoid problems.
  438.        Also MIDICONN.EXE is superseeded by HWMDCABL.EXE.
  439.  
  440.  
  441.   MDJSTK10.ZIP: MIDI-Joystick. Use a PC-Joystick as MIDI controller.
  442.              X,Y and 2 Buttons configurable.
  443.  
  444.   HWSIMSAM.ZIP: Hubi's Simple Sampler. Load a .WAV file Into memory, play
  445.              it as MIDI intrument (w. pitch transpose and volume control)
  446.  
  447.   HWMCICOM.ZIP: Hubi's MCI Commander, Execute MCI commands by MIDI.
  448.  
  449. ______________________________________________________________________________
  450.  
  451. About the author:
  452.  
  453. Dipl. Ing. Hubert Winkler
  454. Neunkirchner Str. 17
  455. A - 2732 Willendorf 
  456.  Austria
  457.  
  458. Email: winkler@cobra.gud.siemens.co.at        (office)
  459.  
  460.  
  461.  
  462.