thanks for the ideas. it is a consumer path and so it is red. an
interpolator is connected to it that loops through note on msgs 52-76
with velocity set to 100.
i am getting there. i can not see the logs in the console. and in
MIDIMonitor app, I can see the messages. But i am not getting any
softsynth to play (even DLS Synth within MIDIPipe). It appears to be
finding all of the destinations though (except Logic).
Also, the build put the package in a strange place and it does not
appear that Apples templates for QC plugins place the patches in the
right location. Again, I am a green stick with XCODE and Obj-C
m
- (BOOL) startExecution:(id<QCPlugInContext>)context
{
/*
Called by Quartz Composer when rendering of the composition starts:
perform any required setup for the plug-in.
Return NO in case of fatal failure (this will prevent rendering of
the composition to start).
*/
MIDIClientCreate(CFSTR("QC MIDITrigger Client"), NULL, NULL, &client);
MIDIOutputPortCreate(client, CFSTR("QC MIDITrigger Port"),
&outport);
[context logMessage:@"QC MIDITrigger Client set"];
[context logMessage:@"QC MIDITrigger Port set"]; return YES;
}
- (BOOL) execute:(id<QCPlugInContext>)context atTime:
(NSTimeInterval)time withArguments:(NSDictionary*)arguments
{
Byte noteOffMsg[3];
noteOffMsg[0] = kMidiMessage_NoteOn; // & self.systemChannel;
noteOffMsg[1] = lastNote;
noteOffMsg[2] = 0;
Byte noteOnMsg[3];
noteOnMsg[0] = kMidiMessage_NoteOn; // & self.systemChannel;
noteOnMsg[1] = self.inputNote;
noteOnMsg[2] = self.inputVelocity;
MIDIPacket *thePack;
MIDIPacketList thePackList;
MIDITimeStamp nowTime;
nowTime = AudioGetCurrentHostTime();
thePack = MIDIPacketListInit(&thePackList);
// send to all destinations
int i;
int n = MIDIGetNumberOfDestinations();
[context logMessage:@"MIDI destination count %04d", n];
if (n > 0) {
for (i = 0;i < n; i++) {
currentDest = MIDIGetDestination(i);
thePack = MIDIPacketListAdd(&thePackList, sizeof(thePackList),
thePack, nowTime, 3, noteOffMsg);
MIDISend(outport, currentDest, &thePackList);
thePack = MIDIPacketListAdd(&thePackList, sizeof(thePackList),
thePack, nowTime, 3, noteOnMsg);
MIDISend(outport, currentDest, &thePackList);
[context logMessage:@"MIDI Note %04d", self.inputNote];
[context logMessage:@"MIDI Velocity %04d",
self.inputVelocity];
}
}
return YES;
}
On Jan 26, 2008, at 11:37 PM, Christopher Wright wrote:
Has anyone else worked with MIDI in a QC plugin?
We've done a fair amount with midi in QC. Looks like you're doing
things right in a general sense, but I've only given it a once-over.
Things that came to mind: Is your patch's execute method getting
called each frame? Throw some NSLog()'s (or the QC-sanctioned
equivalent, not sure off the top of my head) and see what it's doing
each frame. If it's not a consumer patch (red title bar), it will
only get executed if it's attached to a red one that's enabled
somewhere down the line. Its timemode may also factor into this, if
it's not a red patch (honestly, I'm a bit rusty regarding how red
patches handle timemode compared to green and blue patches).
If that doesn't work out, let me know and I can take a closer peek
to see what's happening.
--
[ christopher wright ]
[EMAIL PROTECTED]
http://kineme.net/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [EMAIL PROTECTED]