User Forum    :: Powered by YaBB
  « MIDI-OX User Forum - Problems with COM Scripting (Python) »
Welcome, Guest. Please Login or Register.
May 29th, 2025, 3:29pm


Home Home Help Help Search Search Members Members Login Login Register Register


   MIDI-OX User Forum
   MIDI-OX
   Scripting Questions
(Moderator: Jamie OConnell)
   Problems with COM Scripting (Python)
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Problems with COM Scripting (Python)  (Read 4914 times)
NeoAlus
New Member
*



MIDI-OX Rules!

   


Posts: 8
Problems with COM Scripting (Python)
« on: Sep 22nd, 2002, 4:16am »
Quote Quote Modify Modify

I have found two problems with accessing the COM interface from Python.  
 
The first is that for some reason the event callback (OnMidiInput) sems to be called sporadically and obviously not frequently enough to receive all of the MIDI data which is being generated. (Watching for a certain event, I find it once in about 1/1000th of the time. Sometimes 4 or so in a row.)
 
The second problem is that calls to OutputMidiMsg() don't appear to send any data to MIDI-OX unless I set DivertMidiData to 1. (which means I'd have to script all the MIDI-routing I'm already doing in MIDI-OX)
 
I'm not sure if these problems only occur when accessing the COM API from Python or if they are more common.
 
 
-NeoAlus
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: Problems with COM Scripting (Python)
« Reply #1 on: Sep 22nd, 2002, 3:03pm »
Quote Quote Modify Modify

OnMidiInput() should be called for each event in the stream.  To verify this you can create a test loop that does nothing but send each item received in OnMidiInput() back to MIDI-OX using OutputMidiMsg().  You should see all data in the output monitor with 'COM' in the input device field.
 
There is a supplied example which does this:  
MOXPythonDemo.py
« Last Edit: Sep 22nd, 2002, 3:06pm by Jamie OConnell » IP Logged

--Jamie
Music is its own reward.

cappy2112
Member
**



MIDI-OX Rules!

   
Email

Gender: male
Posts: 14
Re: Problems with COM Scripting (Python)
« Reply #2 on: Mar 21st, 2005, 12:10pm »
Quote Quote Modify Modify

on Sep 22nd, 2002, 3:03pm, Jamie OConnell wrote:
OnMidiInput() should be called for each event in the stream.  To verify this you can create a test loop that does nothing but send each item received in OnMidiInput() back to MIDI-OX using OutputMidiMsg().  You should see all data in the output monitor with 'COM' in the input device field.
 
There is a supplied example which does this:  
MOXPythonDemo.py

 
 
Jamie
In the MOXPythonDemo.py file, you have this comment
# Python Native example.  This uses Python Win32 COM to generate a Sink
# This must be run under PythonWin.exe environment (or matbe IDLE), not Python.exe
# or Pythonw.exe -- there are known problems running Win32UI module.
 
I've run python scripts (not related to Midiox) which use  win32ui, win32con win32com, using Python.exe. I'm wondering why your comment states that the MOXPythonDemo.py file has to be run from PythonWin.exe.
 
 This was written about 2 years ago and several revs of Python have been released since then.
IP Logged
Jamie OConnell
Administrator
*****






   
WWW Email

Gender: male
Posts: 2027
Re: Problems with COM Scripting (Python)
« Reply #3 on: Mar 22nd, 2005, 8:30pm »
Quote Quote Modify Modify

Quote:
This was written about 2 years ago and several revs of Python have been released since then.  

 
Exactly.  It could be well out of date.  Let me know if it is.
IP Logged

--Jamie
Music is its own reward.

cappy2112
Member
**



MIDI-OX Rules!

   
Email

Gender: male
Posts: 14
Re: Problems with COM Scripting (Python)
« Reply #4 on: May 21st, 2006, 11:33pm »
Quote Quote Modify Modify


Can I use any of the DLL's from Midiox thru Python (either with or without COM) to send/receive sysex?
 
Ideally, I'd like to supply just a python script (and any necessary Midiox dlls) to be able to send/receive sysex, without the Midiox GUI from showing.
 
Can this be done ?
if so, how ?
 
thanks
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »


MIDI-OX User Forum » Powered by YaBB 1 Gold - SP 1.3.1!
YaBB © 2000-2003. All Rights Reserved.