[jmsl] Re: double-banging some notes in a score
jmsl at music.columbia.edu
jmsl at music.columbia.edu
Mon Dec 3 17:50:46 EST 2007
Hi Spencer
It sounds like you are reusing measure 0 of the score, right? And you
are relaunching the score to play that measure every time you move one
measure of new material into it, correct?
If so you need to schedule the launch() with a proper timestamp instead
of calling launch(JMSL.now()).
For example if you were using a MusicJpb to copy new material every 4
seconds, its repeat() method might look something like
public double repeat(double playTime) {
clearMeasure();
copyMaterial();
currentChunkScore.getControlPanel().launch(*playTime*,0,0,false);
return playTime + ABSOLUTE_DURATION_OF_ONE_MEASURE_IN_SECONDS;
}
Does this help or am I off the mark?
Thanks
Nick Didkovsky
Spencer Russell wrote:
> I'm working on a piece that generates a score in realtime one measure
> at a time for a performer to play live, but when I play the score(with
> a JSyn instrument to test), it plays some of the notes at the end of
> the measure early (while it's also playing notes in the beginning of
> the measure) and then when it gets to the end of the measure, it plays
> them again (correctly). I'm first generating the measure in a
> temporary track (I'm storing a large number of these measures and
> accessing them randomly, so it seemed like track was a good
> container), and then copying the notes in the track to a score that
> shows the performer what's coming next. Then the notes are moved to
> another score that's actually the current one, and then they're
> played.
>
> Here's the general outline of what I'm doing:
>
> First I'm generating a rhythm, and adding the notes to a Track using
> insertNote(new Note(null, duration, chord, 1, duration))
>
> where chord represents an array index for an array of chords.
>
> then I'm scanning through the notes one by one and setting their
> pitches based on the notes in the chord whose index I stored earlier
> (I know it's hacky).
>
> So at this point I should have a track with a bunch of notes in it.
>
> Then I'm copying those notes to a Score (a subclass called
> AlgoChunkScore. I've also subclassed Track into AlgoChunk)
> using the following method:
> public void generateFromAlgoChunk(AlgoChunk sourceChunk)
> {
> Debug.print("Cloning...");
> for(int i = 0; i < sourceChunk.size(); i++)
> {
> Debug.print("Note " + i + ":");
> Debug.print(" Pitch: " + sourceChunk.getNote(i).getPitchData());
> Debug.print(" Duration: " + sourceChunk.getNote(i).getDurationData());
> //addNote(Note.cloneNote(sourceChunk.getNote(i)));
> addNote(sourceChunk.getNote(i).getDurationData(),
> sourceChunk.getNote(i).getPitchData(), 1.0, 0.125);
> }
> }
>
> So this puts the notes from the track into my preview Score, and next
> time around I move them into my current score, and refill the other
> stuff.
>
> I'm playing the score with
> currentChunkScore.getControlPanel().launch(JMSL.now(),0,0,false);
>
>
> Is there anything obviously wrong with what I'm doing?
>
> Thanks,
> spencer
>
More information about the jmsl
mailing list