Support

If you have a problem or need to report a bug please email : support@dsprobotics.com

There are 3 sections to this support area:

DOWNLOADS: access to product manuals, support files and drivers

HELP & INFORMATION: tutorials and example files for learning or finding pre-made modules for your projects

USER FORUMS: meet with other users and exchange ideas, you can also get help and assistance here

NEW REGISTRATIONS - please contact us if you wish to register on the forum

Users are reminded of the forum rules they sign up to which prohibits any activity that violates any laws including posting material covered by copyright

different starttime for host sequence and ticker bug!?

For general discussion related FlowStone

Re: different starttime for host sequence and ticker bug!?

Postby billv » Tue Oct 07, 2014 6:45 pm

Nubeat7 wrote:does anyone know another way to get the time difference between 2 ruby events?

This one might be of use....checks time difference between methods...
Code: Select all
class Timer
def self.time(&block)
  start_time = Time.now
  result = block.call
  end_time = Time.now
  @time_taken = end_time - start_time
  result
end

def self.elapsedTime
  return @time_taken
end

end

Timer.time { output 0, "Hello, World" }
output 1,Timer.elapsedTime
billv
 
Posts: 1157
Joined: Tue Aug 31, 2010 3:34 pm
Location: Australia

Re: different starttime for host sequence and ticker bug!?

Postby tulamide » Tue Oct 07, 2014 6:59 pm

Exo wrote:Works in the VST here.

Often when it start is says 1 millisecond and then the next is often a lot shorter than the others, but the sync is definitely not stable there is often a few milliseconds difference, but some time the difference is quite a lot.

for instance at BPM 30 time in milliseconds averages 2010.000 milliseconds , occasionally it is 1900.000 milliseconds
and the first is usually 1899.000 or thereabouts. So not stable at all.

I would be wondering if there isn't a difference! The not stable thing there is the measurement. That's because of the Time method itself and the fact that 2 events happening at the same time will get processed one after the other by the method. The Time methods works with the schematic clock, which counts in 1/100 steps or 100 Hz.

With these conditions it's impossible to measure exactly to a millisecond. It will even be imprecise in the 100th.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: different starttime for host sequence and ticker bug!?

Postby tulamide » Tue Oct 07, 2014 7:57 pm

@Nubeat7

There's a shorter way to wrap the numbers. Instead of calling a method after having added 1 do this:

Code: Select all
#Not needed anymore
#@count += 1
#@count = wrap(@count,1,5)

#Better way
@count = (@count % 4) + 1


Just replace 4 with the number of steps (8 for 8th notes, 16 for 16th notes, etc.)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: different starttime for host sequence and ticker bug!?

Postby Nubeat7 » Tue Oct 07, 2014 10:11 pm

damn, the time difference between the ticks doesn't work here as vst, tested it in cubase, FL, live and renoise....

about the unstable times, tulamide could be right because when you test it in FL there is (should be) no difference between the notes and the ticks, so they would get triggered at the same time but if you simply test it without notes (so no trigger at input 1) it should just show the time between each trigger from the counter which should be accurate when using asio drivers if we trust FS user guide!

wondering why it doesn't work on my machine.... :roll:
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: different starttime for host sequence and ticker bug!?

Postby Nubeat7 » Tue Oct 07, 2014 10:24 pm

ok i tested it now on my other computer with asio 4 all driver, and there it works :o

maybe its my presonus firewire interface which mess it up on the other machine!?

tested it in renoise and like exo said if i just run the ticker there is a difference between each tick - it varies between 470 and 515 ms while it should be 500 at 120 bpm..

but if i also set a note on each beat it constantly shows 1000, 0 or 2000 ms which shows me that it is tight! and there are no gaps between note and ticker...

the strange thing is when just one of both counts it shows different times with each tick!?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: different starttime for host sequence and ticker bug!?

Postby Nubeat7 » Tue Oct 07, 2014 10:37 pm

anyway now that the time works, the schematic could be simplyfied, and only triggers needed to be sent instead of counting, with this schematic if you run the original test wit 4 notes on each beat, setting the songposition to start and press play it measure the time between tick and note correct, its between 0 and 1 ms constantly (tested in renoise)

also if only the ticker or the only the sequence is runnung in host it just differs with 2 ms up or down the value it should be... which i think is because it sends the actual time - the last time to output and then it sets the new last time so it can differ a little bit

this schematic works also on the other machine! :o and it shows me an offset in cubase from 160 ms between ticker and sequence! (pretty constant) while the ticker starts earlier then the notesequence!

which has nothing to do with the soundcard latency because this is 21 ms for input and 25 ms for output.

Edit: updated schematic using FS the internal time system which makes it all accurate now! thanks tronic
Attachments
ticktest.fsm
(137.59 KiB) Downloaded 800 times
Last edited by Nubeat7 on Wed Oct 08, 2014 8:19 am, edited 1 time in total.
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: different starttime for host sequence and ticker bug!?

Postby tulamide » Tue Oct 07, 2014 11:51 pm

It doesn't work like you described for me. Tested in Reaper:

120 bpm, 4 quarter notes

Running the sequence with 'ticker play' off results in pretty stable 500 ms, where sometimes it's one 1/128th note earlier (484.375) and sometimes one 1/128th note later (515,625). This can't be a result of Reaper's resolution, since ppq is 960. So, it's 15.625 ms difference sometimes.

Running the sequence with 'ticker play' on switches to unstable with values changing so fast that I can't tell the in between numbers, only those that rest for a while. And those are 31.250 (which apparently is 2* 15.625), 46.875 (which is 3* 15.625) and sometimes 62.5 (guess what, 4* 15.625)

At least there is some kind of rule, in the case of Reaper it's exactly 15.625 ms.

EDIT: Forgot to mention that the ticker starts right in time with the sequence.
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

Re: different starttime for host sequence and ticker bug!?

Postby Tronic » Wed Oct 08, 2014 3:14 am

don't use Time.now
use the internal time event

def event i,v,t
case i
when 0
output t - @last
@last = t
when 1
output t - @last
@last = t
end
end

This is more precise bucouse it not call any system function, but i think it is an internal call of class event in C side.
Tronic
 
Posts: 539
Joined: Wed Dec 21, 2011 12:59 pm

Re: different starttime for host sequence and ticker bug!?

Postby Nubeat7 » Wed Oct 08, 2014 8:16 am

thank you very much tronic, thats what i was searching for! :) so when using asio its also the asio clock then!

i updated the last schematic with your suggestion...

@tulamide
could you try the new version with reaper please? if there is a offset between notes and ticks?

the offset in cubase is 156ms (tested with the new version) but if i change the soundcard latency from 20 to 2 ms the offset is 178and when i set the latency of the soundcard to 40 ms the offset is 140ms... :?

btw am i the only one who's using cubase around here?
User avatar
Nubeat7
 
Posts: 1347
Joined: Sat Apr 14, 2012 9:59 am
Location: Vienna

Re: different starttime for host sequence and ticker bug!?

Postby tulamide » Wed Oct 08, 2014 9:12 am

Nubeat7 wrote:@tulamide
could you try the new version with reaper please? if there is a offset between notes and ticks?

the offset in cubase is 156ms (tested with the new version) but if i change the soundcard latency from 20 to 2 ms the offset is 178and when i set the latency of the soundcard to 40 ms the offset is 140ms... :?
The less soundcard latency, the bigger the buffers. That might be the reason (The computer has to do a lot more work when latency is at 2 ms than at 40 ms)

Just tested it. 120bpm, 4 quarter notes, Asio4all @13ms

ticker play without a sequence = 500ms stable.
ticker play with a sequence playing = a different value each time I try (but that value stays stable while playing). Lowest was 6 ms, highest somewhere at 380ms.

There was no delay, although the numbers tell something else. There's a quick value change at the beginning of each tick, and this change happened exactly at note positions.


Nubeat7 wrote:btw am i the only one who's using cubase around here?

600€ for the full version? When Reaper offers the same (and more) for 48€? ;)
"There lies the dog buried" (German saying translated literally)
tulamide
 
Posts: 2714
Joined: Sat Jun 21, 2014 2:48 pm
Location: Germany

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 63 guests