• 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: help with MusicTrackCopyInsert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with MusicTrackCopyInsert


  • Subject: Re: help with MusicTrackCopyInsert
  • From: William Stewart <email@hidden>
  • Date: Fri, 27 May 2005 10:52:06 -0700


On 27/05/2005, at 12:30 AM, gary wrote:

 Hi,

Im trying to copy a range of midi events from one track in sequenceA to another in sequenceB
with the code below (minus the error handling), but the contents of the destination track
are always empty - can anyone suggest where im going wrong?
thanks for any help,
Gary


MusicPlayer mplayer;
MusicSequence sequenceA;
MusicSequence sequenceB;
NewMusicPlayer(&mplayer);
NewMusicSequence(&sequenceA);
NewMusicSequence(&sequenceB);
FSPathMakeRef ((const UInt8*)argv[1], &fsRef, 0);
FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL);
MusicSequenceLoadSMF(sequenceA, &fsSpec);
MusicPlayerSetSequence(mplayer, sequenceA);


// source track
MusicTrack strack;
MusicTimeStamp trackLength;
MusicTimeStamp start = 0.0;
UInt32 propsize = sizeof(MusicTimeStamp);
MusicSequenceGetIndTrack(sequenceA, 0, &strack);
MusicTrackGetProperty(strack, kSequenceTrackProperty_TrackLength,&trackLength, &propsize);
CAShow(strack);


   // destination track
   MusicTrack ctrack;
   MusicSequenceNewTrack(sequenceB, &ctrack);
   MusicSequenceGetIndTrack(sequenceB, 0, &ctrack);

You shouldn't need this line as ctrack already has the reference to the track object you want.


MusicTrackCopyInsert(strack, start, trackLength, ctrack, start);

Are you sure that trackLength is valid here?

I'd sprinkle a few more CAShow/printfs' and see what value isn't what you expect it to be (the code looks ok, but I haven't run it)

Bill

   CAShow(ctrack);

result:
SequenceTrack @500F8B0
    NumEvents:1
    0.000: MetaEvent:54
         0:  C0 00 00 00 00                                    .....

SequenceTrack @50A60D0
    NumEvents:0

_______________________________________________
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


--
mailto:email@hidden
tel: +1 408 974 4056
________________________________________________________________________ __
"Much human ingenuity has gone into finding the ultimate Before.
The current state of knowledge can be summarized thus:
In the beginning, there was nothing, which exploded" - Terry Pratchett
________________________________________________________________________ __


_______________________________________________
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


References: 
 >help with MusicTrackCopyInsert (From: gary <email@hidden>)

  • Prev by Date: Re: Notify AU parameter change to host
  • Next by Date: Re: about changing inNumberFrames in renderer callbacks
  • Previous by thread: help with MusicTrackCopyInsert
  • Next by thread: about changing inNumberFrames in renderer callbacks
  • Index(es):
    • Date
    • Thread