Sunday 30 March 2014

VB5, VB6, VB.NET - MIDI IN and MIDI OUT Source Code

Here is some code for you all to play with. I have searched the 'net for decent MIDI IN and MIDI OUT code - it is almost impossible to find - especially MIDI IN. So, here is working code to save all VB programmers from tearing what is left of their hair out ;-)

However, let me just say a few words first. My definition of MIDI IN and MIDI OUT processing is not some baby code that handles a few notes struck on a keyboard - or the odd SYSEX message. No - good MIDI IN and MIDI OUT code has to handle amazingly complex MIDI input and output. The only way to do this is to use MIDI FILES that provide a "torture test" ;-)

To test the code I use loopMIDI from Tobias Erichsen. This is rock solid code. I have tried loopBE1 - but I gave up on this as one of my MIDI files consistently broke it. I have included the file, CHANGING.MID, so you can try this code with it.

Here is the link to the source code and MIDI files:

https://onedrive.live.com/redir?resid=68C7CC233B49C4C2!576&authkey=!AKEp6IWwji2FKzg&ithint=folder%2c.txt

To test MIDI IN and MIDI OUT - use your favourite MIDI file player - you can use mine if you like:

https://onedrive.live.com/redir?resid=68C7CC233B49C4C2!342&authkey=!AFDQL1CnIX7o-Gg&ithint=folder%2c.exe

Install loopMIDI and XG-GS Utilities from the site above.

Set MIDI OUT from the player (XG/GS MIDI Jukebox) to "loopMIDI port".
Set MIDI IN in the test code below to "loopMIDI port".
Set MIDI OUT in the test code below to "Your favourite hardware or software synth"
Press play in your player - sit back - and watch.

The items I have uploaded are:

MIDIIN VB5

This is the code that started it all. MIDI IN and OUT using only VB5. This code is rock solid and never breaks. Just double click "MidiMon.exe" to run it.

MIDIIN VB6

This is exactly the same code as the VB5 code above - just compiled with VB6. It does NOT WORK! I am firmly convinced that MIDI IN is simply not possible with VB6 :-( It can play most of the MIDI files I have uploaded - as long as it is feeling happy and there is not much SYSEX input. It cannot play any of the ANO MIDI files that I have uploaded - apart from ANO5 - which has no SYSEX - and which it sometimes plays. I would be very grateful if someone can find out why this code does not work consistently! Just double click "MidiMon.exe" to run it.

XGGSMON

This is VB.NET using VS 2010. The code is rock solid - it never breaks. Converting this code from VB5 was a real pain - disabling Garbage Collection for the MIDI Headers and using GlobalAlloc had to be used. Just double click "XGGSMON.exe" in the \XGGSMON\bin\Release folder to run it.

A huge thank you to zsyncoz here:

http://codes-sources.commentcamarche.net/source/view/100174/1316105

He/she is the only person who I have seen who has got MIDI IN working properly!

MIDI Files

There are 2 folders:

ANO
- All files were written for Roland Sound Canvas in SC-55 Map mode
- They will almost certainly not play back on anything which is not Roland
- Use XG/GS Reset to set your SC-88, SC-88Pro or SC-8850 into SC-55 Map Mode (see earlier for link)
- Even though you will hear strange things using other equipment - they stress MIDI IN like nothing else

ELP
- Some of my favourite ELP files
- 5BrFugueGS.mid is solo piano - even the VB6 MIDI code plays this one sometimes ;-)
- Changing.mid will break loopBE1 - it has never broken loopMIDI

Enjoy

Friday 14 March 2014

XG-GS Utilities and ELP MIDI Files

After a lot of mucking about, I have these utilities working on Windows 7 - 32 bit and 64 bit - and Windows 8 - 64 bit. It has proven impossible to package this lot up as a nice install file - so until I can work out the details of packaging the utilities for Windows 7 and above, anyone who wants to use them is up for a little bit of manual install.

The good news - all these utilities are now free. The bad news - you get to do a few tedious tasks before you can play. Some more good news - this stuff works on PCs that currently do not have any decent MIDI software or hardware. I have uploaded some stuff that will show you how to get a pretty good MIDI soft synth working on your PC.

The even better news - I have uploaded all our old ELP MIDI files which have been lovingly prepared over the last 20 years or so. The ELP MIDI directory is in loving memory of Jos Le Voi - sadly taken from us in 2013. She created many of these sequences - we hope you enjoy them.

Here is the link to the lot:

https://onedrive.live.com/redir?resid=68C7CC233B49C4C2!342&authkey=!AFDQL1CnIX7o-Gg&ithint=folder%2c.exe

Here is the link to just the ELP MIDI files:

https://onedrive.live.com/redir?resid=68C7CC233B49C4C2!424&authkey=!ALCzbWe70XMme9s&ithint=folder%2c.mid

If anyone has problems installing this lot, then you can email me at:

mikelevoi AT gmail DOT com

The above email address is hopefully human readable :-)

Enjoy ...

Monday 10 March 2014

MIDI Utilities

After 5 years or more in the wilderness, I have been inspired to start working with MIDI again. The first project was to complete "It Came Upon a Midnight Clear" by Keith Emerson - as featured on the "Christmas Album". In the near future I will be uploading all my ELP MIDI files for general use. These files used to be available on my MODEMSS site but that disappeared a long time ago.

The second project was to resurrect all my old synths. Happily, they all still work! Thus, I now have access to the Roland Sound Canvas SC-155, the Yamaha XG-50 and the Roland Sound Canvas SC-8850. Even better, using the Roland UA-101 as an 8 port input device, I can listen to them all as required without audio patching.

The final project was to get the software working again. To fully work with MIDI on a PC you need a MIDI loop back cable/driver. Thankfully, since my Windows 95/NT days someone has written a loopback cable that works fine under Windows 7 - 32 bit or 64 bit mode. Here is the link:

http://www.tobias-erichsen.de/software/loopmidi.html

loopMIDI allows the user to create one or more loopback ports on-the-fly. Once created, you can send the output of one program to the input of another. In my case, this is used as follows:

XG/GS MIDI Jukebox -> loopMIDI -> XG/GS MIDI Monitor -> SC-8850

The huge advantage this gives you is that you can watch all MIDI messages in the monitor as they are being sent to the synth. It also traps and sends SYSEX so that you can see if the MID file contains XG or GS SYSEX data.

Getting my VB5 XG/GS Utilities working again has been a challenge. It was relatively easy to recompile the toolbar, SYSEX sender and jukebox using VB6. They now all have "Windows 7" look and feel. However, trying to recompile the monitor has been a waste of time. It appears that the code simply does not work if compiled with VB6. The program will run for about 1-30 seconds and then it crashes. I suspect that VB5 is fixing data structures in memory and not allowing Garbage Collection to move them. As MIDI IN requires callback logic to maintain pointers to these data structures, it is necessary that the memory is not relocated.

One of these days - way in the future - these programs may be converted to VB.NET. However, MIDI coding is substantially different in VB.NET and this would take far too long at the moment. Besides, after installing the VB5 runtime modules in Windows 7 64 bit, the old code works fine! You can still get the VB5 runtime modules from here:

http://support.microsoft.com/kb/180071

I will be uploading a ZIP file of all the modules sometime soon so all can play. This stuff used to be shareware - but what the heck - who needs the money any more ;-)

Addendum:

All the XG/GS Utilities have now been tested on Windows 8 64 bit - even the VB5 MIDI monitor code from 2003! Quite amazing that Microsoft retain such backward compatibility in this throwaway age of computing ...

Friday 29 July 2011

Gothic Review

As a result of reading some of the reviews in the UK press re the Proms Gothic, I created my own review of the Gothic Symphony by Havergal Brian. You can read it here:

https://sites.google.com/site/recordingmaninoz/gothicreview

All feedback welcome.

Mike Le Voi