[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] MIDI questions was: [sc-users] MIDIClient.init not working

Hi marije,

Le 18 déc. 08 à 08:10, nescivi a écrit :


On 12/17/08, thelych@xxxxxxxxx <thelych@xxxxxxxxx> wrote:
Hi Marije, and all !

first concerning the OS X issue, currently prDisposeMIDIClient (in
does not call midiCleanUp() (it just dispose the client - leaving a
dangling state for the port pointers and report an error even if the
client was not inited...)

i think it should call directly midiCleanUp() to leave it in a clean
state and not report an error if the client was not inited.
(Or may be report an error only if the func fails to dispose the
client (wich would mean just changing the midiCleanUp
signature ...ect...) but not if there is no MIDIClient)

That all makes sense.

this will also fix the current problem reported in os x.

I think that one needs the line removed, as I suggested in my reply to
that issue.

From what i understand, so there is no prob to remove it from the Linux side too ? Personally i do not know about the MIDI state / impl on Windows so i prefer not to break / remove anything untill i am sure about that.


also currently MIDIClient.disposeClient (on OSX) does not reset its
'initialized' classvar, leaving it as 'true' if it was disposed.
Wich mean if you call MIDIIn.connectAll it won't re-create and re-
connect sc to midi.
To re-connect correctly MIDI seems you have to (after a

MIDIClient.init(numIns, numOuts); // reset the MIDIClient
MIDIIn.connect(inIndex, outIndex); // re-connect MIDIIn ...ect...

Marije, is it the same behaviour for Linux ? If you do not plan to
modify soon the midi code for Linux, we can apply the patch to fix the
os x problem ?

I will not modify the code soon, as I believe Dan committed my patch.
I will maybe make some fixes to sending MIDIOut with the latency
issue, but not before the 28th, when I have some time for it again,
and I still have to find the bug.


On Linux, whenever you reinitialise the client, it automatically frees
the previous client before making a new one inside the primitive code.

on OS X too, so np too.

Anyway, feel free to make any fixes to OSX specific code.

If nobody shout about that, i'll commit the small patch. So anyway MIDI will be functional (with the line in or out)... And if it is ok to remove the _this.disposeClient_ line in _MIDIClient.init_ for all platforms then we can safely do it later : )

Just another point Marije :
in MIDIOut.sc
is that a prob if we change MIDIClient.disposeClient to reset the MIDIClient.initialized classvar to false ? Once you dispose your client, MIDIClient.initialized is still true :|

sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/