Re: DLS Synth problem
Re: DLS Synth problem
- Subject: Re: DLS Synth problem
- From: William Stewart <email@hidden>
- Date: Tue, 17 Nov 2009 14:45:04 -0800
Just a correction here
On Nov 17, 2009, at 10:09 AM, Douglas Scott wrote:
I am having a little bit of problem with your pseudo-code, but I
would say first off that you
should compare your code to the existing playsequence example. You
cannot send events
directly to the DLS synth.
You can send events directly to the DLS Synth - there is even an
example about how to do that (PlaySoftMIDI)
But, you do have to create a way for the synth's output to be played
(or written to a file or whatever you want to do with it) - the most
common / easiest way to deal with this is to create an AUGraph with a
synth in it, connect it to an output audio unit so that you can play it.
You can use a sequence object (MusicPlayer.h) when you want to read in
something like a MIDI file (or create events on a timeline manually)
and play them back
So, to your code below - this isn't C code, so its a little hard to
read (and also because I'm not familiar with the syntax, I am quite
concerned that the way you are calling the C functions is the problem.
A paramErr means there is something fundamentally wrong with the way
you are calling a function, so that is some concern.
It needs to be associated with a Sequence node and an audio output
node. Is there a specific reason you need to build your graph from
scratch in this fashion?
-DS
On Nov 17, 2009, at 4:33 AM, Op de Coul, Manuel wrote:
Hi,
I'm trying to make a connection to the Apple DLS Synth so I
can send midi data to it. I have seen examples how to do this,
like the sources of SimpleSynth and I've read Apple's
CoreAudio documentation. I'm writing portable software and I'm not
really familiar with Macs, but I have used the midi api and
successfully created language bindings to it.
The problem might be caused by an error in the binding code,
although I've checked it thoroughly.
Using OSX 10.5.8, X11 2.4, GCC 4.4, GTK 2.18.
The call to AUGraphAddNode returns a status code of -50 all the time.
Does someone know what kind of error this number indicates?
This is basically what I'm doing:
procedure Open_DLS_Synth is
Stat : OSStatus;
Desc : aliased ComponentDescription;
Graph : aliased AUGraph;
SynthNode, OutputNode : aliased AUNode;
begin
Stat := NewAUGraph(Graph'Unchecked_Access);
if Stat /= 0 then
raise No_Success;
end if;
Desc.ComponentType := kAudioUnitType_MusicDevice; --
"aumu"
Desc.ComponentSubType := kAudioUnitSubType_DLSSynth; --
"dls "
Desc.ComponentManufacturer := kAudioUnitManufacturer_Apple; --
"appl"
Desc.ComponentFlags := 0;
Desc.ComponentFlagsMask := 0;
Stat := AUGraphAddNode(Graph, Desc'Unchecked_Access,
SynthNode'Unchecked_Access);
If you disentangle this to a C call, what does it look like?
Put_Line(OSStatus'Image(Stat));
-- This prints -50
if Stat /= 0 then
raise No_Success;
-- So exception raised here
end if;
Desc.ComponentType := kAudioUnitType_Output;
-- "auou"
Desc.ComponentSubType := kAudioUnitSubType_DefaultOutput;
-- "def "
Stat := AUGraphAddNode(Graph, Desc'Unchecked_Access,
OutputNode'Unchecked_Access);
if Stat /= 0 then
raise No_Success;
end if;
Stat := AUGraphOpen(Graph);
if Stat /= 0 then
raise No_Success;
end if;
Stat := AUGraphConnectNodeInput(Graph, SynthNode, 0,
OutputNode, 0);
if Stat /= 0 then
raise No_Success;
end if;
Stat := AUGraphInitialize(Graph);
if Stat /= 0 then
raise No_Success;
end if;
Stat := AUGraphStart(Graph);
if Stat /= 0 then
raise No_Success;
end if;
end Open_DLS_Synth;
Another question, when starting the graph, does this automatically
create a midi endpoint
to the DLS synth? The documentation is not very clear about it.
Thanks in advance,
Manuel _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden