• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: built-in (DLS) equivalent of QTMA instruments?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: built-in (DLS) equivalent of QTMA instruments?


  • Subject: Re: built-in (DLS) equivalent of QTMA instruments?
  • From: Keith Hamel <email@hidden>
  • Date: Mon, 14 Apr 2008 09:46:50 -0700

Jerry:

Use MusicDeviceStartNote and MusicDeviceStopNote -- these are alternative APIs (to MusicDeviceMIDIEvent) for playing notes and while they will not necessarily work with all audio/MIDI devices, they will work with the DLS and seem to be fine with most audio units I have tried using them with. 

The last argument to MusicDeviceStartNote is a reference to a MusicDeviceNoteParam which can hold fractional pitches (and fractional velocities if you want them).

This will work much better than pitch bend which operates on all notes in the channel rather than on individual notes.

(assuming instance variables graph and synthnode are set up...)

- (void)startNote:(Byte*)message ofSize:(int)size withFraction:(float)frac
{
     AudioUnit synthUnit;
int channel = message[0] & 0x0F;
Boolean isRunning = NO;
MusicDeviceNoteParams noteInfo;
ComponentResult err;
NoteInstanceID midiPitch = message[1];
noteInfo.argCount = 2;
noteInfo.mPitch = midiPitch + frac;
noteInfo.mVelocity = (float)message[2];
.....

AUGraphIsRunning(graph, &isRunning);
if (isRunning) {
AUGraphGetNodeInfo (graph, synthNode, NULL, NULL, NULL, &synthUnit);    
MusicDeviceInstrumentID instrumentID = [self currentInstrumentOnChannel:channel];
err = MusicDeviceStartNote(synthUnit, instrumentID, channel, &midiPitch, 0, &noteInfo);
}
.....

}

Yours, Keith Hamel


 _______________________________________________
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

  • Follow-Ups:
    • Re: built-in (DLS) equivalent of QTMA instruments?
      • From: Joe Strout <email@hidden>
References: 
 >built-in (DLS) equivalent of QTMA instruments? (From: Joe Strout <email@hidden>)
 >Re: built-in (DLS) equivalent of QTMA instruments? (From: William Stewart <email@hidden>)
 >Re: built-in (DLS) equivalent of QTMA instruments? (From: Joe Strout <email@hidden>)
 >Re: built-in (DLS) equivalent of QTMA instruments? (From: Jeremy Sagan <email@hidden>)
 >Re: built-in (DLS) equivalent of QTMA instruments? (From: Joe Strout <email@hidden>)
 >Re: built-in (DLS) equivalent of QTMA instruments? (From: Jeremy Sagan <email@hidden>)

  • Prev by Date: Re: built-in (DLS) equivalent of QTMA instruments?
  • Next by Date: Re: built-in (DLS) equivalent of QTMA instruments?
  • Previous by thread: Re: built-in (DLS) equivalent of QTMA instruments?
  • Next by thread: Re: built-in (DLS) equivalent of QTMA instruments?
  • Index(es):
    • Date
    • Thread