newMetaEvent(double i, CAMemoryObject meta);
newMetaEvent(double i, CAMemoryObject meta);
- Subject: newMetaEvent(double i, CAMemoryObject meta);
- From: Craig Bakalian <email@hidden>
- Date: Sun, 22 Sep 2002 05:00:32 -0400
Hi,
I used to create a metaEvent (Tempo Change) like this in
javax.sound.midi ->
public void createTempoEvent(int temp, long tick){
try{
int tempo = temp;
byte[] tempoByte = new byte[3];
byte[] tempoByteFinal = new byte[3];
long tempoMidi = (long)(60000000/tempo);
for (int i = 2; i> -1; i --){
tempoByte[i] =
(byte)Math.floor(tempoMidi/Math.pow(256.0, i));
tempoMidi = tempoMidi - (long)(tempoByte[i] *
Math.pow(256.0, i));
}
tempoByteFinal[0] = tempoByte[2];
tempoByteFinal[1] = tempoByte[1];
tempoByteFinal[2] = tempoByte[0];
MetaMessage meta = new MetaMessage();
meta.setMessage(0x51, tempoByteFinal, 3);
MidiEvent metaEvent = new MidiEvent(meta, tick);
metas.add(metaEvent);
}catch (Exception e){
e.printStackTrace();
}
}
Now that I have grown up and I am using core audio, I need to convert
my tempoByteFinal to a CAMemoryObject.
Can I do this by simply inserting into the above code at the
appropriate area->
CAMemoryObject obj = new CAMemoryObject(3, true);
obj.CopyFromArray(0, tempoByeFinal, 0, 3);
And, will the MusicTrack.newExtendedTempEvent(double, double) become a
metaEvent in Standard Midi File Format. What does the
newExtendedTempEvent become when a sequence is exported to a SMF?
Craig Bakalian
_______________________________________________
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.