Hi,

First, I'd like to thank everyone involved for developing the
portmedia libraries. I have found these libraries very useful, and I
appreciate the effort you all put in to the portmedia project.

I am trying to create a playRange(seq, ticks_from,ticks_to) function,
similar to the seq_play(seq) function in allegroplay.cpp. The function
will take in a range of the SMF's ticks, relative to tick 0 at the
beginning of the file, and play from the beginning of ticks_from all
of the way through the end of ticks_to. For right now, I am extending
allegroplay.cpp, which is making this easy to try out. (thanks to
whoever prepared the xcode project file). I should mention that my
driver will not be calling playRange at "pretty" music intervals (eg
playRange(seq,233,475)), else I'd just use cut() to cut the sequence
inside some range of beats. Therefore, tick, not beat or second,
precision is necessary for my playRange().

My first idea was to use Alg_seq's cut(double start, double len, bool
all) method. If I could cut away the range I don't need from a
sequence, I could play the resulting range with
seq_play(the_having_been_just_cut_seq). Right? However, cut() only
lets me specify in terms of beats (as a double) or seconds, the unit
being settable on the object. If I want a sequence with the first tick
of a MIDI file at 480 PPQ and 60 BPM am I to
call:seq->cut(0.0020833333, 0.004166666, false)? See? I think I want a
tick-based function. I tried a few other things, but a stumbling block
was that get_dur() returns 0 for me.

I did not see very many public functions in Allegro (which I have to
say is designed pretty nicely!) that use "ticks". I assume these
classes were designed to favor musical intervals over ticks. This
would make sense, and what I am trying may be very well against the
intended usage of the allegro/portsmf classes.

Any advice on if I should subclass / use the fractional beat unit /
not be using portsmf, etc. is 100% welcomed! I hope everything here is
understandable; I'm happy to elaborate on anything.

THANK YOU!

Jerzy Gangi
Computer Music Department, Peabody Conservatory
Johns Hopkins University
_______________________________________________
media_api mailing list
[email protected]
http://lists.create.ucsb.edu/mailman/listinfo/media_api

Reply via email to