• SONAR
  • Is my math wrong or is cakewalk's?
2013/10/28 19:02:16
AnnihilationRob
I decided to try converting MBT time to samples, and my result is a little different from what i'm seeing in Sonar X2.
 
My project is sampled at 44.1k and is in 4/4 time.
According to Sonar, the audio is 7229088 samples long and ends exactly at MBT 95:01:000
There are two tempos. 122 starting at MBT 01:01:000, and 140 and starting at 12:01:000.
 
If I'm correct the math should be:

First tempo segment: (60 * 44100) / (122 / 4) = 86754.09 samples per measure
86754.09 * 11 = 954295.08 samples in the 11 measures at 122
 
Second tempo segment: (60 * 44100) / (140 / 4) = 75600 samples per measure
75600 * 83 = 6274800 samples in the 83 measures at 140
 
Add them together for the total samples: 954295.08 + 6274800 = 7229095.08
 
Why is this off by about 7 samples? Its not significant in terms of music, but it seems like a pretty significant coding error.
2013/10/28 19:12:56
rontarrant
When you were subtracting, you forgot to carry the tune?
2013/10/28 19:22:43
Mystic38
your math is not wrong, but I suspect that your assumptions are.
 
You are assuming that the clock reference in your system is accurate to +/- 0.00 ppm, and that is not the case.
2013/10/28 19:30:30
drewfx1
Perhaps a question to ask yourself is, "How many samples would 01:01:001 be?".
2013/10/28 19:57:13
AnnihilationRob
Ah i figured there would be something deeper I was missing like that. So I would figure since ticks are an MBT measurement, 01:01:001 at 122 bpm would be 22.59 samples long because there are always 960 ticks per beat, but i guess thats wrong. How does this clock reference work?
2013/10/28 21:13:55
Guitarpima
This thread is making my brain hurt. Good luck figuring this out.
2013/10/28 21:48:51
drewfx1
AnnihilationRob
Ah i figured there would be something deeper I was missing like that. So I would figure since ticks are an MBT measurement, 01:01:001 at 122 bpm would be 22.59 samples long because there are always 960 ticks per beat, but i guess thats wrong. How does this clock reference work?




I think you're overthinking it.
7 samples < 1 tick, so I'm guessing what you're seeing is just because it's rounded to the nearest tick.
2013/10/28 21:57:05
AnnihilationRob
The nearest tick in this case according to Sonar is at sample 7229088, 7 samples off. Does anyone know what Mystic means by the clock reference? I thought the only time the internal clock of the audio card or computer came into play was during recording or playback. Seems strange that the actual grid in Sonar would be affected by this.
2013/10/28 22:10:15
mettelus
Ugh... I can envision the next "hot" thread now.
2013/10/28 22:19:05
bapu
Guitarpima
This thread is making my brain hurt. Good luck figuring this out.


This is NOTHING compared to convo with my pal Mooch4056. 
© 2026 APG vNext Commercial Version 5.1

Use My Existing Forum Account

Use My Social Media Account