Re: [genuine] Re: reading Midi from AU
Re: [genuine] Re: reading Midi from AU
- Subject: Re: [genuine] Re: reading Midi from AU
- From: jacques couzteau <email@hidden>
- Date: Sun, 11 Jan 2004 19:11:46 +0100
Am 11.01.2004 um 18:14 schrieb Marc Poirier:
>
This isn't an answer to your question, but do you really want to do
>
this,
>
or could you accomplish what you want by simply making your effect a
>
MusicEffect (component type kAudioUnitType_MusicEffect, build with
>
AUMIDIEffectBase.* and AUMIDIBase.*, etc.)?
What do i need to do?
Simply change the line
#define COMP_TYPE kAudioUnitType_Effect
to
#define COMP_TYPE kAudioUnitType_MusicEffect
and include
#include "AUEffectBase.*"
#include "AUMIDIBase.*"
What does it mean or change when i do that? How do i access midi? is
there samplecode?
thanks
PS: reading midi with my previous approach now works. But I'd hate to
get such an important designdecision wrong. So I'd rathe do it your
way.
>
>
But anyway, as to your C++ problem, I think it's just that you're
>
missing
>
the static keyword before the function prototype in your class
>
definition.
>
>
Marc
>
>
>
>
On Sun, 11 Jan 2004, jacques couzteau wrote:
>
>
> Hello,
>
>
>
> I'm trying to enable my AU (derived from SampleEffectUnit) to read
>
> MIDIInput in order to set parameters. I use the SampleTools-Projects
>
> which implements a MIDIEcho in the file echo.cpp as an Example.
>
>
>
> There A MIDI-in-port is created with the command MIDIInputPortCreate
>
> from CoreMIDI-Framework with the following Line:
>
> MIDIInputPortCreate(client, CFSTR("Input port"), MyReadProc, NULL,
>
> &inPort);
>
>
>
> In this line the Function MyReadProc is passed as a FunctionPointer as
>
> argument to MIDIInputPortCreate.
>
>
>
> I have added MyReadProc to my SampleEffectKernel so it's definition
>
> looks like:
>
> class SampleEffectKernel : public AUKernelBase{
>
> ...
>
> private:
>
> ...
>
> void MyReadProc(const MIDIPacketList *pktlist, void *refCon, void
>
> *connRefCon);
>
> ...
>
>
>
> static void SampleEffectUnit::SampleEffectKernel::MyReadProc(const
>
> MIDIPacketList *pktlist, void *refCon, void *connRefCon)
>
> {
>
> ...
>
> }
>
>
>
> If i use that code in my C++ implementaion of my AU i get compile
>
> problems in the line where i create my MIDIInPort during instanciation
>
> of my SampleEffectKernel
>
>
>
> MIDIInputPortCreate(client, CFSTR("Input port"), MyReadProc, NULL,
>
> &inPort);
>
>
>
> because the use of my MyReadProc doesn't match its definition.
>
>
>
> I believe the compiler thinks i want to pass the
>
> (non-existant)return-value of MyReadProc to MIDIInputPortCreate.
>
> Instead of Passing the function that is supposed to process
>
> MIDI-Input.
>
>
>
> How do i get this to work?
>
>
>
> thank you
>
>
>
> jacques
>
>
>
> ps: I'm new to c++ so i might be missing something obvious.
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.