• 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: MusicPlayer looping madness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MusicPlayer looping madness


  • Subject: Re: MusicPlayer looping madness
  • From: James Maxwell <email@hidden>
  • Date: Sat, 05 Nov 2011 17:03:18 -0700

I just wanted to update this to mention that I did find a way around the problems I was having. 
The confusion was in the fact the the MusicTrack really doesn't think of a loop as a subsection of a longer musical passage; it only really makes sense if you think of the entire track as a loop. So, I set the OffsetTime to the start of my region and the TrackLength to the length of the region and now it works as expected. In fact, I decided to just have my regions looping once, by default, since this is effectively the same as having them not looping at all, and it's simpler to manage because I just change the loop number to something > 1 whenever I want it to actually loop.

J. 


On 2011-11-05, at 1:22 PM, James Maxwell wrote:

I don't know if the list still works -- the web interface is (still) down -- but I'm going to give it a shot.

I'm having some trouble understanding how looping in the MusicPlayer is supposed to work. What I'm trying to do is loop a "region" of MIDI, say from beat 3 to beat 4, n times. For example, if I have a 1-beat region, containing a run of 4 1/16th-notes, starting on beat 3, I'd like to be able to loop that region 3 times. Judging by the name, setting loopDuration to 1 would make the most sense (say my sequence ends on beat 4), as the desired loop is 1 beat long -- i.e., from beat 3 to 4. However, that plays no loops at all. On the other hand, with loopDuration = 3, I do get the loop, but the overall duration of the loop is 3 beats. Similarly, if I try any higher number, the loop length equals the given duration. This ***seems*** intuitive, except for the fact that loopDuration = 1 does nothing at all... 
So, this suggests to me that, rather than looping from "loopDuration" to the end, as the docs state, it's really looping from the start of the sequence up to the loop point. Is that correct? If so, then do I need to somehow offset the track, in order to get the loop to start on the 3rd beat, and end on the next beat? 
Basically, what I'd like to do is wrap Apple's generally counter-intuitive implementation in another method/function that takes a startTime, loopDuration, and numberOfRepetitions. To my mind, that would be much more a reasonable/musical specification for a looping function... Can anyone help explain how looping is actually supposed to work? 


Thanks in advance.

J.



------------------------------------------------------
James B. Maxwell
Composer/Researcher/PhD Candidate
email@hidden




------------------------------------------------------
James B. Maxwell
Composer/Researcher/PhD Candidate
email@hidden





 _______________________________________________
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: 
 >MusicPlayer looping madness (From: James Maxwell <email@hidden>)

  • Prev by Date: Re: How to use REZ to create resource combining x86 and x64?
  • Next by Date: Re: How to use REZ to create resource combining x86 and x64?
  • Previous by thread: MusicPlayer looping madness
  • Next by thread: MusicSequenceSetUserCallback - GC error
  • Index(es):
    • Date
    • Thread