Jump to content

Recommended Posts

Hi all,

Attached below are two segments of this project.

The first "Midi API" is a wrap of the windows functions below.

The second "Midi UDF" library is built on the first, and aims to provide a user friendly code base for people working with midi.
In broad strokes, this UDF so far covers:

  • Channel Voice and Mode Messages
  • Registered Parameters (Channel Tuning, Mod Wheel/Pitch Bend ranges)
  • Some more prolific Non-Registered Parameters (Yamaha XG & Roland GS common controls)
    • Drum editing
    • Envelope control
    • Vibrato control
    • Filter control
  • General SysEx messaging
  • Global parameter control (GM2 like Reverb & Chorus control)
  • Device Control (Master Volume/Balance/Tuning)
  • Octive/Scale Tuning
  • Controller Destination settings (aftertouch/cc modulation editing)

Any other notation/streaming type functionality is not yet covered by the UDF, nor is Midi Machine/Show Control or reading/writing midi files.
Midi streams are addressed fairly well with the midiAPI library however for those wanting to explore at that level.

Lastly a big shoutout to Water and Mr_Creator for the Simple Library Docs Generator.  The help files are a straight generation from his script.

A couple of notes on synths.

I've based the UDF on a couple of different RPs published many years apart, so implementation can be quite instrument specific.
Don't expect too much of the builtin MS Wavetable Synth! I've had some more joy with the coolsoft midisynth if anyone is looking for a free alternative to test with.

The two software synths mentioned above are also very slow responding to midi messages. If you forward messages to a physical instrument you should be able to play in real time. 




Edited by MattyD
Link to post
Share on other sites


I just found your posting and I am most grateful, I've been hoping for something like this for a very long time. I enjoy working with AutoIt but have never able to use it much with midi. Since I'm not a programmer I often use something else for the midi parts and AutoIt for most everything else. (Not the greatest way of doing things - it gets surprisingly messy.) I've been running your examples all morning and and have not had even the smallest of issues. Your work on this is top shelf and your commitment to it's thorough development is blatantly obvious. As to your mention of a second layer, I very much look forward to seeing it. I'm sure that whatever you come up with will make a great addition to the AutoIt language. Please keep up your great work.

Link to post
Share on other sites
  • 4 weeks later...

I was playing with the excellent new "midiAPI" today and I found I had to add a line for the sake of
one of the functions. I could not get _midiAPI_InGetNumDevs to tell me how many devices I had until I

    Global Const $__g_hWinMMDll = DllOpen("winmm.dll")
I found "$__g_hWinMMDll" listed as a global variable at the top of midiAPI.au3 but not in midiAPIConstants.
Just thought you'd like know.

I was taking my project forward this morning when I found the  _MidiInStart() & _MidiInStop() functions. My apologies for my mistake and solemnly swear to not do it again. I should have gone a little farther yesterday, I've never used  MidiInStart/Stop in this or any other way. They say "You can learn something new every day" but what they don't tell you is you have to have your head outside of your own butt  to thoroughly benefit from the experience. 


Edited by JAPP
Link to post
Share on other sites
  • 2 weeks later...

Hi folks.

First release of the general midi UDF.

The underlying API library is pretty much unchanged and bedded down, but the UDF I would treat as a "beta" at this stage.
The functions themselves shouldn't be too buggy, but I haven't really proofed the doco as of yet so hopefully it makes sense!

Any comments, thoughts, suggestions for change are most welcome. Hopefully no fundemental changes are needed, but I'd like to stamp out anything that is particularly bad or nonsensical while the project is young.


Link to post
Share on other sites

Hi all - quick heads up,

There are a couple of silly things that have been corrected since yesterday around doco, calltips and one of the examples.

I'm sure there'll be a few more, so for now I won't make an announcement every time I release for these minor fixes. I will keep try to keep the changelog up to date though.

Any changes or additions to the actual code (beyond a tidyup) will still get a special mention.

Link to post
Share on other sites

Just a couple of small changes today.

UDF v1.2

- Added "address" and "size" un/packing functions to complement the existing SysEx data transfer functions.
(Roland DT1/RQ1, XG Data Dump etc.)
- Added functions for retrieving names from midi device handles
- Fixed scite integration script stripping out _midiAPI_* keywords/calltips instead of old _midi_* ones.
- Fixed _midi_SetDrumLevel example refrencing a non-exsiting function

Link to post
Share on other sites

Version UDF 1.4 release:

This release is mainly around better GM2 support.
There are a couple of script breaking things this time around (sorry), though I've tried to keep this at a minimum.

- Removed the notification window parameter when opening devices (moved to _midi_Startup).
- Common patchs are better supported with the new functions, GM2 patch names are now inbult and can be filtered by category.
- Modified some GM1 $PGM_* (program) names to bring into line with the new GM2 $PAT_* (patch) definitions.
- Fixed/added a few other constants to better suit modern implementations
- extended $NTE_* (note) constants for better GM2 compatability, added $NTE_* constants for the SFX rhythm percussion set.

Link to post
Share on other sites
  • 3 weeks later...

@MattyD Thanks for this wonderful library! It was very easy to use it for creating the midi interface of the Peace equalizer. I only had to make one small adjustment in the library to make it work with the Peace source code architecture. Thanks 🙂

Creator of the Peace equalizer, an interface for Equalizer APO. Besides Peace, my library of functions is also available on SourceForge.

Link to post
Share on other sites

Added your MIDI UDF to the wiki :)

My UDFs and Tutorials:


Active Directory (NEW 2022-02-19 - Version - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version - Download - General Help & Support - Example Scripts
OutlookEX (2021-11-16 - Version - Download - General Help & Support - Example Scripts - Wiki
OutlookEX_GUI (2021-04-13 - Version - Download
Outlook Tools (2019-07-22 - Version - Download - General Help & Support - Wiki
PowerPoint (2021-08-31 - Version - Download - General Help & Support - Example Scripts - Wiki
Task Scheduler (NEW 2022-07-28 - Version - Download - General Help & Support - Wiki

Standard UDFs:
Excel - Example Scripts - Wiki
Word - Wiki

ADO - Wiki
WebDriver - Wiki


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...