Csound Csound-dev Csound-tekno Search About

Re: compiler

Date1998-07-02 22:58
FromMichael Gogins
SubjectRe: compiler
First, let me repeat: I am desperately searching or trying to make,
whichever works, a general-purpose software synthesizer that has the
academic computer goodies that Csound has, inside the standard
Microsoft-world COM interfaces so it works with COM clients, as a DSP
plugin, for writing tracks inside of hard disk recorders/editors, and so on.

To really be viable in the long term, the object must itself accept plugins
for its DSP blocks.

I've made several prototypes of such a system, and I always gave up after
getting some modest instruments to work, because I want to compose, not just
write music software. There is a LOT of work inside Csound and its ilk at
this point. I DON'T want to redo it.

Sooner or later, someone will produce such an object. I'm worried that it
will wedded to MIDI only, that it will be mainly a sample player, etc.
Getting some sharp heads to write the thing from scratch would be best, but
stuffing Csound inside a COM server would be MORE than adequate.

>Yes, I know about regsrv32; what I really meant was, in what categories?
>
>As I understand things so far, ActiveMovie plugins are identified as either
a
>source filter, or a transform filter, or a renderer filter. A source filter
has
>no input pins, a renderer filter has no output pins, and a transform filter
of
>course has both. from my understanding of the DirtectShow documentation, it
is
>the presence or otherwise of these pins which tells the ActiveMovie graph
>manager what sort of object the plugin is. If it has no input pin, it can
never
>be inserted as a transform filter, whereas if it has one or more, it cannot
be
>loaded as a source filter.  Is it therefore possible to make a single
plugin
>appear as either a source or a transform filter to ActiveMovie?

I suspect you may not be recalling that one COM class (e.g, "Csound") can
implement any number of different COM interfaces
(e.g., ActiveMovie plugin interfaces).

What is needed is for Csound to either implement, or better contain and
expose, several different interfaces. It would provide something like:

Csound.WaveInput
Csound.WaveOutput
Csound.WaveTransform

Csound.MidiInput
Csound.MidiOutput
Csound.MidiTransform

I'm just learning about this stuff myself, but I THINK (correct me if I'm
wrong) that once you have this much, you can use the Filter Graph Manager to
hook files, device ports, or whatever to these pins.

>I understand that Csound as an ActiveX control is effectively a full-blown
>application OLE-style (embed in a framework GUI, code, load, run), whereas
>Csound running as a DirectShow/ActiveMovie plugin is an instance of a
(possibly
>infinitely) running Csound orchestra. In ActiveMovie, the only way the user
can
>control a plugin is through the property page. It is certainly possible to
have
>plugins without property pages - this applies to utility plugins such as
tee
>splitters, file parsers, and so on, but I don't see how this could apply to
>Csound as a whole. Unless you do mean that each opcode could be coded as a
>self-sufficient plugin, Csound itself will have to become an ActiveMovie
plugin,
>somehow.


It can either itself implement several different kinds of ActiveMovie
plugin, or it can be a factory for them.

>My suspicion is that {Csound = ActiveX control}, and {Csound = ActiveMovie
>plugin} are separate entities, even if they do share a great deal of common
>code.

Just off the top of my head (C++ style, all returning HRESULT):

Csound.Opcode(long index, VARIANT *pOpcode)
Csound.FunctionTable(long index, VARIANT *pWavetable)
Csound.SetFlag(BSTR Flag, BSTR Value)
Csound.GetFlag(BSTR Flag, BSTR *pValue)
Csound.GetSamplingRateHz(long *pValue)
Csound.SetSamplingRateHz(long Value)
Csound.GetKontrolRatio(long *pValue)
Csound.SetKontrolRatio(long Value)
Csound.GetChannelCount(long *pValue)
Csound.SetChannelCount(long Value)
// As an alternative to the above suggestion....
// Some sort of access to get and set filters... Obviously this is wrong,
but you get the idea.
Csound.EnumerateFilters(long Index, VARIANT *pFilter)
Csound.Play()
Csound.Stop()
Csound.Pause()
Csound.Rewind()
Csound.SetCue(double Time)
Csound.GetCue(double *pTime)
Csound.GetFilterGraphManager(VARIANT *manager)
// Some utility functions for encapsulating setup of filters for writing
soundfiles, reading soundfiles, etc. by name)

Opcode.Initialize(ICsound *csound, VARIANT *pfields)
Opcode.OnAudioSample()
Opcode.OnKontrolSample()
Opcode.Finalize()

FunctionTable.Initialize(BSTR fStatement)
FunctionTable.GetTable(double **data)

CsoundX an ActiveX GUI that knows how to make and control a Csound object.