Jump to content

Recommended Posts

Posted (edited)

Hi all,

Attached below are two segments of this project.

The first "Midi API" is a wrap of the windows functions below.
https://docs.microsoft.com/en-us/windows/win32/multimedia/midi-functions

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. 

 

midi.zip

Edited by MattyD
Link to post
Share on other sites

MattyD

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
added:

    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
Correction
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.

Enjoy!

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

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...