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

Problem with MusicTrackMoveEvents


  • Subject: Problem with MusicTrackMoveEvents
  • From: "A. Le Flanchec" <email@hidden>
  • Date: Mon, 21 Jun 2004 16:32:31 +0000

Hello !

I'm working on an audio/MIDI sequencer. The audio part is working quite well now, but I have have some problems with the MIDI part.

When I use MusicTrackMoveEvents, I have some very strange results. In the very short example below, I read a SMF, and I try to move the first 4 beats with MusicTrackMoveEvents. It works well the first time I call it. BUT, when I call it a 2nd times, it shouldn't do anything, since all data was moved, right ? In fact, it DOES move the new first note of the track (i.e. first note of 5th beat)...though it is outside of the given range.

Does anyone see what I'm doing wrong there ?

I tried many many many things, but now I'm out of ideas...

Thanks in advance !

Vincent


{
MusicSequence sequenceMIDI;
MusicTrack track;

//File Names Management :
char *filePath ="/Users/liris/test.mid";
char *filePath2 ="/Users/liris/result.mid";

OSStatus result = noErr;

result = NewMusicSequence(&sequenceMIDI);

FSRef fsRef;
result = FSPathMakeRef ((const UInt8*)filePath, &fsRef, 0);
FSSpec fsSpec;
result = PathToFSSpec (filePath, &fsSpec);

FSRef fsRef2;
result = FSPathMakeRef ((const UInt8*)filePath2, &fsRef2, 0);
FSSpec fsSpec2;
result = PathToFSSpec (filePath2, &fsSpec2);

// Working on the sequence :
result = MusicSequenceLoadSMF (sequenceMIDI, &fsSpec);

MusicSequenceGetIndTrack(sequenceMIDI,1, &track);

MusicTrackMoveEvents(track, 0, 4, 8);
MusicTrackMoveEvents(track, 0, 4, 8);
//The second call should have no effect... but it still moves the first note of the sequence. What could I have done wrong ?

MusicSequenceSaveSMF(sequenceMIDI, &fsSpec2 , (UInt16) 480 );
}

_________________________________________________________________
MSN Messenger : discutez en direct avec vos amis ! http://www.msn.fr/msger/default.asp
_______________________________________________
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: Process and Render
  • Next by Date: Re: 'AudioFile-new' is 10.3+ only?
  • Previous by thread: Re: 'AudioFile-new' is 10.3+ only?
  • Next by thread: Overload issues
  • Index(es):
    • Date
    • Thread