Csound Csound-dev Csound-tekno Search About

[Cs-dev] CsoundVST broken as VST plugin

Date2005-03-01 03:54
From"Michael Gogins"
Subject[Cs-dev] CsoundVST broken as VST plugin
Due to recent changes by Istvan Varga in the MIDI system for Csound 5, 
CsoundVST no longer functions as a VST plugin.

The basic cause is the assumption that all MIDI I/O will be performed by a 
dynamically loadable module. This is not the case in CsoundVST. The MIDI 
driver functions already exist in CsoundVST and are plugged into Csound at 
run time.

Istvan, could you please review the CsoundVST code (in 
frontends/CsoundVST/CsoundVST.cpp) and devise a means for plugging a MIDI 
driver into Csound via the Csound API -- not only MIDI driver function 
pointers in ENVIRON->midiParams, but also setting the required flags in 
OPARMS? 




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2005-03-01 11:08
FromIstvan Varga
SubjectRe: [Cs-dev] CsoundVST broken as VST plugin
Michael Gogins wrote:

> Istvan, could you please review the CsoundVST code (in 
> frontends/CsoundVST/CsoundVST.cpp) and devise a means for plugging a 
> MIDI driver into Csound via the Csound API -- not only MIDI driver 
> function pointers in ENVIRON->midiParams, but also setting the required 
> flags in OPARMS?

I do not really understand what flags you are referring to, but here
is how you can set up your own MIDI driver without the (otherwise
recommended) use of a dynamic library:

   1. you need to call csoundPreCompile() and csoundCompile()
      separately, so call csoundPreCompile() first.
   2. use the API to set up MIDI function pointers. You can find
      details about this in InOut/midirecv.c, but here are some
      notes regarding the use of the interface:
        * the device open functions should take a csound instance
          pointer, a void** pointer to a "user data" pointer (you
          can use this to store a handle for the stream, e.g. a
          pointer returned by malloc()), and a string device name
          (this will be whatever was set for -M or -Q).
        * the read/write functions take a csound instance pointer,
          a void* "user data" pointer (see above), a buffer that
          stores MIDI data, and an integer value that is the size
          of the buffer (in bytes) for the read function, and the
          number of bytes to write for the write function.
          The buffer should always contain complete (not truncated)
          messages, and should not make use of the MIDI feature of
          repeating the status byte.
        * the close functions take a csound instance pointer, and
          'void *userData' already explained above. The functions
          should check for userData being NULL which means that
          the stream is already closed.
        * all functions have an integer return value, which is
          expected to be zero on success in the case of the
          open and close calls, and the number of bytes read or
          written in the case of the read/write functions.
          Errors should be reported by returning a negative error
          code.
   3. you can now call csoundCompile(); by appending "-+rtmidi=null"
      to the command line flags (argc/argv) you can make it sure
      that no dynamic libraries will override your functions.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net