Architerion Posted April 26, 2014 Posted April 26, 2014 (edited) Howdy All Im wanting to use Cubase SX/Midi (via loopmidi virtual cable) to drive usb 8 channel (FTD2XX.dll_UDF.au3). So far, the FTD udf is working great. Now I simply want to use the midi udf to trap midi in. ie Any note on/off event will have its channel (0-7) used to add/sub bit operations to address the relay number and note velocity to turn on and off. Does anyone have a simple example??? Scoured without success I was thinking of something like (incomplete snippet to give an idea) this to send to the controller board Func SetRelayState($NoteChan, $NoteVel) If ($NoteVel > 0) Then $RelayState = BitOR ($RelayState, $NoteChan) Else ;0 velocity = note off $RelayState = BitXOR ($RelayState, $NoteChan) Endif ;Set inits for serial write to control relay DllStructSetData($lpBuffer, 1, Chr($RelState)) $dwBytesToWrite = StringLen(Chr($RelState)) ; this uses 8 bits to set each relay eg 00000001 = relay 1 etc $Do = _FT_Write($FT_HANDLE, $lpBuffer, $dwBytesToWrite, $lpdwBytesWritten) EndFunc So, in abstract I just want to do something like this (snippet from old vbs > midiox I did) Sub Sink_MidiInput( ts, port, stat, dat1, dat2) 'ts = timestamp, port, stat = status eg note, ctrl etc 'Divide notes into appropriate subs 'notenum on #13 If Port = FCBIn Then 'Sort MsgType and Chn here Chn = stat AND &h0F mMsgType = stat AND &hF0 Select Case Stat ' ---- notes on chan1 Case &h90 ' Call SetRelayState from here End Select End If End Sub In other words, an example of code showing reading midi input, is it a sink/event driven structure or is it a loop reading the stream etc Hope that make sense Many thanks for any input Edited April 26, 2014 by Architerion
Architerion Posted July 5, 2014 Author Posted July 5, 2014 (edited) So absolutely no help??? All that time spent making beautiful UDFs and no examples on the deeper level stuff...hmm shame but ok...will move on I guess and use something a bit more supported. Edited July 5, 2014 by Architerion
Moderators Melba23 Posted July 5, 2014 Moderators Posted July 5, 2014 Architerion,If no-one has answered it is because no-one knows the solution or no-one is interested enough to work on it - it does look like a very niche request. Remember that what is important to you is not necessarily so to others - and also that you paid nothing to use AutoIt or to post here, so no-one among the volunteer responders here has any obligation to offer you any help at all. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Architerion Posted July 18, 2014 Author Posted July 18, 2014 Architerion, If no-one has answered it is because no-one knows the solution or no-one is interested enough to work on it - it does look like a very niche request. Remember that what is important to you is not necessarily so to others - and also that you paid nothing to use AutoIt or to post here, so no-one among the volunteer responders here has any obligation to offer you any help at all. M23 I guess you are right. It just seems a waste of others time when many people have gone to a lot of trouble to do the midi udf work and there doesnt seem to be one example of its use. The examples I gave obscure a very simple request, on second look...but the question remains; Is there one example of using midi in? Specifically the use of a callback. Im happy to pay someone for their example script... Thanks
czardas Posted July 19, 2014 Posted July 19, 2014 (edited) I think part of the problem is that not many people have 'midi out' capable instruments, so testing a 'midi in' example is (perhaps) somewhat problematic. I suggest you look at examples on music coding forums and search MSDN. Edited July 19, 2014 by czardas operator64 ArrayWorkshop
Architerion Posted July 20, 2014 Author Posted July 20, 2014 I think part of the problem is that not many people have 'midi out' capable instruments, so testing a 'midi in' example is (perhaps) somewhat problematic. I suggest you look at examples on music coding forums and search MSDN. Hi czardas, thanks for your reply. A test input can be easily achieved by using a free prog eg midiox and a virtual midi loop back eg loopbe. Have had a look at the resources but its handling dlls and I want to stay with the simple syntax of autoit rather than spending my time wading through another level. Hence why its better use of resource to simply pay someone for the startup info. Cheers mark
czardas Posted July 20, 2014 Posted July 20, 2014 (edited) If I didn't have such a backlog to clear I would spend time looking into this (it's most unfortunate). I wasn't sure that testing could be done any other way, but now I understand that it can. Thanks for the information you provided. Edited July 20, 2014 by czardas operator64 ArrayWorkshop
jaberwacky Posted July 20, 2014 Posted July 20, 2014 What is $RelState? I ask because of its similarities to $RelayState. Is it a poorly named global? Helpful Posts and Websites: AutoIt3 Variables and Function Parameters MHz | AutoIt Wiki | Using the GUIToolTip UDF BrewManNH | Can't find what you're looking for on the Forum?
Architerion Posted July 21, 2014 Author Posted July 21, 2014 What is $RelState? I ask because of its similarities to $RelayState. Is it a poorly named global? Sorry...typo...I cut and pasted from different test scripts. It is the same variable.
JJC2 Posted August 19, 2016 Posted August 19, 2016 Here is a working midi_in example, BUT it doesn't work for SYSEX. I wish I could figure it out though. You do need to compile for 32 bit for it to work, under 64-bit it crashes. It shows callback and other things. However, I'm looking to receive SYSEX which doesn't work. MIDI.au3 MidiIn Example.au3
binbinhfr Posted October 26, 2021 Posted October 26, 2021 (edited) Sysex receives seems to work for me !!! Nice work JJC2 ! Edited October 26, 2021 by binbinhfr
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now