Re: [Cs-dev] CsoundReset() and MIDI
Date | 2005-11-01 19:36 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
So why is it that we can run several csound processes in succession, and portMIDI gets initialised correctly in each one of them? I can't see the difference between this and terminating a csound instance with csoundDestroy() and starting another. I have not tested doing this, but I will surely do. Victor > csoundCleanup() should close the devices, and > csoundReset() also unloads the plugin libraries and in the > case of PortMidi, Pm_Terminate() is called as well. > csoundDestroy() basically only differs from reset in that > it also deallocates the CSOUND structure. It may be > possible that PortMidi cannot be initialized more than > once on the Mac, in which case we probably need to write a > native driver (there are already MIDI drivers for ALSA and > Windows MME). > > > ------------------------------------------------------- > This SF.Net email is sponsored by the JBoss Inc. > Get Certified Today * Register for a JBoss Training Course > Free Certification Exam for All Training Attendees Through > End of 2005 Visit > http://www.jboss.com/services/certification for more > information > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-11-01 20:36 |
From | Istvan Varga |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Victor Lazzarini wrote: > So why is it that we can run several csound processes > in succession, and portMIDI gets initialised correctly > in each one of them? I can't see the difference between > this and terminating a csound instance with csoundDestroy() > and starting another. I have not tested doing this, but > I will surely do. If you run multiple performances in succession by starting a new process from the command line each time, then the memory state of the process is not preserved and everything is cleanly reloaded by the operating system. By contrast, reusing the same process by calling the compile/perform/reset cycle repeatedly requires PortMidi to be reentrant and allowing for multiple calls to Pm_Initialize() in the same address space without problems. It is possible that PortMidi cannot be re-initialized on MacOS X (not having access to that platform, I cannot test this), but I have just tested restarting a MIDI performance several times from the Python interpreter on Linux, and it worked fine. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-11-01 20:46 |
From | Istvan Varga |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Istvan Varga wrote: > If you run multiple performances in succession by starting a new > process from the command line each time, then the memory state of > the process is not preserved and everything is cleanly reloaded > by the operating system. By contrast, reusing the same process by > calling the compile/perform/reset cycle repeatedly requires > PortMidi to be reentrant and allowing for multiple calls to > Pm_Initialize() in the same address space without problems. > It is possible that PortMidi cannot be re-initialized on MacOS X > (not having access to that platform, I cannot test this), but > I have just tested restarting a MIDI performance several times > from the Python interpreter on Linux, and it worked fine. Doing another test, it seems that while PortMidi can indeed be restarted without problems on Linux, using multiple instances at the same time does fail in a fatal way. On the other hand, using the native ALSA driver with -+rtmidi=alsa is OK, even if MIDI is used in multiple instances of Csound in the same process at the same time. ------------------------------------------------------- SF.Net email is sponsored by: Tame your development challenges with Apache's Geronimo App Server. Download it for free - -and be entered to win a 42" plasma tv or your very own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2005-11-02 01:43 |
From | schwaahed |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Attachments | None |
Date | 2005-11-02 16:42 |
From | Istvan Varga |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Attachments | miditest1.py miditest2.py |
schwaahed wrote: > Could you post an example of this session? > > I'm just curious. Two simple test files are attached. miditest1.py tests re-opening the MIDI device multiple times, while miditest2.py also reads MIDI input in two separate Csound instances at once. Edit the various settings at the top of the files as needed. |
Date | 2005-11-02 17:38 |
From | Istvan Varga |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Attachments | miditest1.py miditest2.py |
schwaahed wrote: > Could you post an example of this session? > > I'm just curious. Two simple test files are attached. miditest1.py tests re-opening the MIDI device multiple times, while miditest2.py also reads MIDI input in two separate Csound instances at once. Edit the various settings at the top of the files as needed. |
Date | 2005-11-03 20:26 |
From | schwaahed |
Subject | Re: [Cs-dev] CsoundReset() and MIDI |
Attachments | None |