[jmsl] start playback, but not at the "start"
jmsl at music.columbia.edu
jmsl at music.columbia.edu
Mon Jul 14 19:46:08 EDT 2008
Thanks Nick, that's great.
Yes, I think a startAtOffset(double offset) method would be handy. I can
post my final solution if/when I get it done, if you like. And yes, I'll
calculate some short delay for elements that don't match the desired start
point.
I actually can probably make use of Player because I'm going to be dealing
with an arbitrary number of MusicShapes, and a fixed number of
"performers", which may play single MusicShapes each, but may also play
doublings, transpositions, and so on, of the "raw" material stored by the
MusicShapes. That is, I could wind up with a whole ensemble playing a
single MusicShape in unison, which seems like the Player's gig. Also, this
is going to be a kind of sequencer, so being able to start at a given
point, and play all "tracks" (which I'm imagining right now as being
Players) from that start point, right through to the end (could be
sequences of many MusicShapes), will be necessary, and should be relatively
easy to implement using Players. At least that's how it seems from scanning
the documentation.
But I think I'm getting the basic idea now, so thanks for your input!
cheers,
J.
On Mon, 14 Jul 2008 18:21:13 -0400, jmsl at music.columbia.edu wrote:
> Hello J
>
> Yours could be a nice general purpose tool: starting at some time point
> into the MusicShape. yes you'd iterate and accumulate until the total
> duration so far is >= your desired duration. Note that the desired skip
> duration may not fall on the boundary of an element (like jumping
> starting 3.5 seconds into a MusicShape whose durations are all 1.0). So
> for that situation you'd probably want to use a startdelay of .5 seconds
> and then start playing with the element that would have fallen on the
> 4th second. Either that or add a first element whose duration is 0.5 and
> all other parameters are 0 to keep it quiet.
>
> Your design is good. I think you might be able to skip the Player
> entirely since you can launch a MusicShape directly. Players are
> helpful if you want to perform a number of MusicShapes with the same
> instrument, in some sequence (either sequential or using a Behavior,
> since Players are SequentialCollections)
>
> So without the Player, your description becomes:
> ...have a source MusicShape, then to locate the desired start point in
> the MusicShape, create a new MusicShape with only objects falling >= the
> start point, then hand the new music shape the right instrument with
> newMusicShape.setInstrument(sourceMusicShape.getInstrument()), adjust
> for the "between durations" offset with
> newMusicShape.setStartDelay(littleDelay), and finally
> newMusicShape.launch(JMSL.now()).
>
> This is not wildly better than your design, but I wanted to point it out
> since it may clean up some ideas about Player, MusicShape, and
> Instruments.
>
> Thanks
> Nick
>
> jmsl at music.columbia.edu wrote:
>> Okay, I was wondering whether I might need to make a new MusicShape with
>> only the desired elements. I suppose this actually might be kind of
> good,
>> since anything done during playback could be kept separate from the
> actual
>> "object" of the original MusicShape. Anyway, this is definitely what
> I'll
>> be needing to do. And I guess I would "skip the first accumulated 5
>> seconds" just by iterating over the elements and summing their
> durations,
>> yes? (I've always thought in terms of "ED" and "Duration", from
> Max-land,
>> but I'll get used to this...)
>>
>> I suppose a possible design pattern for this might be to have a Player
> and
>> a MusicShape, then to locate the desired start point in the MusicShape,
>> create a new MusicShape with only objects falling >= the start point,
> add()
>> that MusicShape to the Player, then launch. Sound about right? I suppose
> I
>> could also calculate the actual offset of the first element beyond the
>> desired start time, and add that to the playback start - i.e.
>> Player.launch(JMSL.now() + offset). Yes?
>>
>> Thanks for your time.
>>
>> J.
>>
>>
>>
>> On Mon, 14 Jul 2008 15:04:10 -0400, jmsl at music.columbia.edu wrote:
>>
>>> Hello J
>>>
>>> Welcome to the JMSL user base. I am glad to hear you are diving into
>>> JMSL and coming up with interesting scheduling questions so soon!
>>>
>>> You are right; a good way to schedule a bunch of MusicShapes in various
>>> sequences is to put them in a SequentialCollection and provide a
>>> Behavior for it. Behavior returns an index but there is no reasons why
>>> it could not look up a MusicShape by name for example, find a match and
>>> then return the index of the matching MusicShape. But maybe I am
>>> getting ahead of myself, by what means do you want to choose which one
>>> executes?
>>>
>>> A MusicShape cannot be launched in the middle of its elements. You
>>> could build a nice auxiliary class that did so however, by creating a
>>> MusicShape on the fly. (ie, if you want it to start 5 seconds into the
>>> MusicShape, skip the first accumulated 5 seconds' worth of elements and
>>> copy the rest into the MusicShape you actually launch. Make up for the
>>> portion of the duration between elements with a startDelay)
>>>
>>> Does this help?
>>>
>>> TimePoint is used by JMSL's transcriber. It's not relevant to this
>>> discussion
>>>
>>> Thanks,
>>> Nick Didkovsky
>>>
>>> jmsl at music.columbia.edu wrote:
>>>
>>>> hmmm... Okay, so I figured out that I could make a Behavior-based
>>>> object that chooses the desired MusicShape by index. But of course
>>>> this implies that I know the index of the MusicShape.
>>>>
>>>> I'm wondering about TimePoint, but it seems pretty "thin", in terms of
>>>> methods... By the description it sounds as though it should have some
>>>> method like getIndexes(), and maybe getMusicShape(), but it only
>>>> offers toString(). So I'm really not sure how I'd make use of it.
>>>>
>>>> I'll keep poking away at the docs, but if anybody can help get me out
>>>> of the woods - just by pointing me in the right direction - I'd
>>>> appreciate it.
>>>>
>>>> cheers,
>>>>
>>>> J.
>>>>
>>>>
>>>> On 14-Jul-08, at 9:06 AM, jmsl at music.columbia.edu wrote:
>>>>
>>>>
>>>>> Hi All,
>>>>>
>>>>> I'm new to JMSL and just wondering how to start playback from a given
>>>>> point in time.
>>>>> I have a Player with n MusicShapes, but I'd like to be able to start
>>>>> playback from an arbitrary point along those n sequences - is this
>>>>> possible? Can I, for example, start from an arbitrary point using a
>>>>> timestamp? Just like a basic play cursor in a sequencer.
>>>>>
>>>>> thanks,
>>>>>
>>>>> J.
>>>>> _______________________________________________
>>>>> jmsl mailing list
>>>>> jmsl at music.columbia.edu
>>>>> http://music.columbia.edu/mailman/listinfo/jmsl
>>>>>
>>>> _______________________________________________
>>>> jmsl mailing list
>>>> jmsl at music.columbia.edu
>>>> http://music.columbia.edu/mailman/listinfo/jmsl
>>>>
>>> _______________________________________________
>>> jmsl mailing list
>>> jmsl at music.columbia.edu
>>> http://music.columbia.edu/mailman/listinfo/jmsl
>>>
>>
>> _______________________________________________
>> jmsl mailing list
>> jmsl at music.columbia.edu
>> http://music.columbia.edu/mailman/listinfo/jmsl
>>
> _______________________________________________
> jmsl mailing list
> jmsl at music.columbia.edu
> http://music.columbia.edu/mailman/listinfo/jmsl
More information about the jmsl
mailing list