Hi all,
This meditation isn't about gray hair, sagging flesh
or receding libido. :-)
In debugging Nama's new audio editing functions,
I'm noticing that I have more and more code dealing
with time. I am concerned seeing a multiplicity of
method names like adjusted_region_start_time
or unadjusted_mark_time.
I'm wondering if perhaps I can centralize
or at least systematize this functionality.
Nama deals with several kinds of time:
Ecasound time. Positions in seconds or samples from
the perspective of the Ecasound audio engine
WAV time. Displacements in audio files.
Track / Region time. Positions in a track or region
Mark time. Nama currently has only one type of mark:
marks anchored to an absolute project timeline.
I think it also needs marks for positions in a tracks WAV files,
which the user may trim or offset.
Edit / offset-run time. This is what started the entire
issue. To record a fix for a note at time T in a WAV file W,
I use Ecasound's select object to offset all the WAV files
in a project to start at time T. The fix, W', then gets
placed at T using playat.
MIDI time. There are plenty of references on this,
and it's a subject of its own. Nama needs at least to
know enough to work across the various systems for bridging
between ALSA, JACK and MIDI.
So do I need some Big Abstraction(tm), or shall I just
continue to work incrementally?
How do you think about time?
I don't expect a simple answer or an answer at all,
but it can help to formulate the question.
Regards,
Joel
--
Joel Roth
Show replies by date
Hey,
In my own pet project I've abstracted things like samplerate, sample time,
MIDI time and anything else to
one value, which I've lovingly named "beatPercent". Its a single
"float"
variable.
The value itself is the musical "beat" of the event, and the "Percent"
part,
is how far along that beat the event occurs.
Of course depending on samplerate etc etc there may be a (tiny) discrepancy
in this "percent" value, but I can
happily live with that.
Keep in mind that the project only deals with standard 4 / 4 music, and I've
no intrest in weird but wonderful timing
games. I wanted something that would abstract away all jack_nframes, timer
ticks etc and I could easily work with.
I haven't found any big drawbacks yet, but I'm not trying to develop SMPTE
or MTC or anything either, so there may
be issues that I haven't come across yet.
Hope that was of some help, -Harry