• 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
unable to populate MusicTrack
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

unable to populate MusicTrack


  • Subject: unable to populate MusicTrack
  • From: Will Benton <email@hidden>
  • Date: Thu, 27 Nov 2003 02:16:09 -0600

Hello,

Here's a code fragment that I am (incorrectly) assuming should be populating a MusicTrack with note messages. Unfortunately, it isn't, as far as I can tell, doing anything. (The note messages are never added; iterating over the MusicTrack reveals no contents). What am I doing wrong? (I'm using Panther, if that matters.)

---snip---

UInt8 notevals[16] = {
60,64,67,72,67,64,60,55,
60,63,68,72,68,63,60,56
};

MusicSequence mySeq;
MusicTrack myTrack;

MusicPlayer myPlayer;

MusicTimeStamp time = 0.0f;
float duration = (float)(1/16);

int i = 0;

verify_noerr(NewMusicSequence(&mySeq));
verify_noerr(MusicSequenceNewTrack(mySeq, &myTrack));

for (i = 0; i < 64; i++) {
MIDINoteMessage theMsg;

theMsg.channel = 1;
theMsg.note = notevals[i];
theMsg.velocity = 120;
theMsg.reserved = 0;
theMsg.duration = 0.125f;

verify_noerr(MusicTrackNewMIDINoteEvent(myTrack, time, &theMsg));

time = time + 0.125f;
}

verify_noerr(NewMusicPlayer(&myPlayer));
verify_noerr(MusicPlayerSetSequence(myPlayer, mySeq));

---snip---


thanks,
wb

---
Will Benton <email@hidden>
"Wir sind Bettler, das ist wahr"
recently updated (11/1/03) contact info at: http://www.cs.wisc.edu/~willb/willb.vcf
_______________________________________________
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: unable to populate MusicTrack (one solved, one new problem)
      • From: Will Benton <email@hidden>
  • Prev by Date: Adding UserEvent to Track
  • Next by Date: MatrixMixer questions
  • Previous by thread: Adding UserEvent to Track
  • Next by thread: Re: unable to populate MusicTrack (one solved, one new problem)
  • Index(es):
    • Date
    • Thread