• 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
Java, DLSSynth, DefaultOutput, Midi event playing.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Java, DLSSynth, DefaultOutput, Midi event playing.


  • Subject: Java, DLSSynth, DefaultOutput, Midi event playing.
  • From: email@hidden
  • Date: Mon, 2 Sep 2002 08:32:52 +0200

Hi I think the following code should make some sort of noise when run.
Any suggestions on why it doesn't?

public class BasicMidi {

public static void main (String args[]) {
// insert code here...
try {
AUGraph graph = new AUGraph();

// Open the DLS Synth
ComponentDescription description = new
ComponentDescription();
description.setType(AUConstants.kAudioUnitComponentType);

description.setSubType(AUConstants.kAudioUnitSubType_MusicDevice);

description.setManufacturer(AUConstants.kAudioUnitID_DLSSynth);
AUNode synthNode = graph.newNode(description);;

// Open the output device
description.setType(AUConstants.kAudioUnitComponentType);

description.setSubType(AUConstants.kAudioUnitSubType_Output);

description.setManufacturer(AUConstants.kAudioUnitID_DefaultOutput);
AUNode outputNode = graph.newNode(description);;

// Connect the devices up
graph.connectNodeInput(synthNode, 1, outputNode, 0);
graph.update(true);

// Open and initialize the audio units
graph.open();
graph.initialize();

// Start playing
graph.start();

// send the event to the synth
// use the MusicDeviceMIDIEvent() call.
MusicDevice synthUnit = (MusicDevice)
graph.getNodeInfo_AudioUnit(synthNode);
ExtendedNoteParams noteParameters = new
ExtendedNoteParams(new float[] {0f, 60f, 127f, 0f});
synthUnit.startNote(10, 0, 0, noteParameters);
synthUnit.stopNote(10, 0, 0);
} catch (CAException exception) {
exception.printStackTrace();
System.exit(1);
}
// end of story.
System.out.println("Hello World!");
}
}
_______________________________________________
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.

  • Follow-Ups:
    • Re: Java, DLSSynth, DefaultOutput, Midi event playing.
      • From: Kurt Revis <email@hidden>
  • Prev by Date: Re: Logic 5 for OS X released
  • Next by Date: Re: Java, DLSSynth, DefaultOutput, Midi event playing.
  • Previous by thread: Re: Logic 5 for OS X released
  • Next by thread: Re: Java, DLSSynth, DefaultOutput, Midi event playing.
  • Index(es):
    • Date
    • Thread