• 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
Problem sending midi notes from virtual source
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem sending midi notes from virtual source


  • Subject: Problem sending midi notes from virtual source
  • From: Erik Dahl <email@hidden>
  • Date: Thu, 06 Mar 2003 20:47:39 -0500

I'm trying to get coreaudio midi working with java. The following code
makes a virtual source but fails to send any notes. Any ideas where I
have gone wrong? Is there a simple example of this somewhere?

-EAD


import com.apple.audio.midi.*;
import com.apple.audio.util.*;
import com.apple.audio.*;

public class midi {

static midi mymidi;
private MIDIClient client;
private MIDIEndpoint src;

midi() throws CAException {
client = new MIDIClient(new CAFString("EAD Midi Client"), null);
src = client.sourceCreate(new CAFString("EADMIDIJAVA"));
}

public void sendMidi() throws CAException {
MIDIData md = MIDIData.newMIDINoteMessage(1,60,64,4.3f);
long stime = HostTime.getCurrentHostTime();
for(int i=0;i<5;i++) {
long ptime = stime + i;
MIDIPacketList plist = new MIDIPacketList(ptime, md);
src.received(plist);
}
}

public static void main (String[] args) {
try {
mymidi = new midi();
mymidi.sendMidi();
} catch (Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}
_______________________________________________
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.

  • Prev by Date: Re: midiunits?
  • Next by Date: AudioConverter error
  • Previous by thread: Instrument Number, Banks and DLS/Soundfonts
  • Next by thread: AudioConverter error
  • Index(es):
    • Date
    • Thread