13
0

MIDIClock_SlaveTest: simulate input jitter

git-svn-id: svn://localhost/ardour2/branches/3.0@6594 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Hans Baier 2010-01-29 16:24:42 +00:00
parent 706d6e8ff0
commit beb4a36016

View File

@ -23,11 +23,14 @@ MIDIClock_SlaveTest::testStepResponse ()
nframes64_t start_time = 1000000;
start (*parser, start_time);
update_midi_clock (*parser, start_time);
update_midi_clock (*parser, start_time);
for (nframes64_t i = 1; i<= 100 * period_size; i++) {
if (i % nframes64_t(one_ppqn_in_frames) == 0) {
update_midi_clock (*parser, start_time + i);
// simulate jitter
nframes64_t input_delta = nframes64_t(one_ppqn_in_frames + 0.1 * (double(random()) / double (RAND_MAX)) * one_ppqn_in_frames);
if (i % nframes64_t(input_delta) == 0) {
update_midi_clock (*parser, start_time + i);
}
if (i % period_size == 0) {