AnnihilationRob
Max Output Level: -90 dBFS
- Total Posts : 9
- Joined: 9/21/2012
- Status: offline
Is my math wrong or is cakewalk's?
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.
|
rontarrant
Max Output Level: -78 dBFS
- Total Posts : 643
- Joined: 6/21/2010
- Location: Ottawa, Ontario
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 7:12 PM
(permalink)
When you were subtracting, you forgot to carry the tune?
|
Mystic38
Max Output Level: -59 dBFS
- Total Posts : 1622
- Joined: 8/30/2010
- Location: Mystic, CT
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 7:22 PM
(permalink)
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.
HPE-580T with i7-950, 8G, 1.5T, ATI6850, Win7/64, Motu 828 III Hybrid, Motu Midi Express, Sonar Platinum, Komplete 9, Ableton Live 9 & Push 2, Melodyne Editor and other stuff, KRK VXT8 Monitors Virus Ti2 Polar, Fantom G6, Yamaha S70XS, Novation Nova, Novation Nova II, Korg MS2000, Waldorf Micro Q, NI Maschine Studio, TC-VoiceLive Rack, 2012 Gibson Les Paul Standard, 2001 Gibson Les Paul DC, 1999 Fender Am Hardtail Strat, Fender Blues Jr, Orange TH30/PPC212, Tak EF360GF, one mic, no talent.
|
drewfx1
Max Output Level: -9.5 dBFS
- Total Posts : 6585
- Joined: 8/4/2008
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 7:30 PM
(permalink)
Perhaps a question to ask yourself is, "How many samples would 01:01:001 be?".
 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
|
AnnihilationRob
Max Output Level: -90 dBFS
- Total Posts : 9
- Joined: 9/21/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 7:57 PM
(permalink)
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?
|
Guitarpima
Max Output Level: -34 dBFS
- Total Posts : 4125
- Joined: 11/19/2005
- Location: Terra 3
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 9:13 PM
(permalink)
This thread is making my brain hurt. Good luck figuring this out.
Notation, the original DAW. Everything else is just rote. We are who we are and no more than another. Humans, you people are crazy. Win 7 x64 X2 Intel DX58SO, Intel i7 920 2.66ghz 12gb DDR3 ASUS ATI EAH5750 650w PSU 4x WD HDs 320gb DVD, DVD RW Eleven Rack, KRK Rokit 8s and 10s sub
|
drewfx1
Max Output Level: -9.5 dBFS
- Total Posts : 6585
- Joined: 8/4/2008
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 9:48 PM
(permalink)
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.
 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
|
AnnihilationRob
Max Output Level: -90 dBFS
- Total Posts : 9
- Joined: 9/21/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 9:57 PM
(permalink)
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.
|
mettelus
Max Output Level: -22 dBFS
- Total Posts : 5321
- Joined: 8/5/2005
- Location: Maryland, USA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 10:10 PM
(permalink)
Ugh... I can envision the next "hot" thread now.
ASUS ROG Maximus X Hero (Wi-Fi AC), i7-8700k, 16GB RAM, GTX-1070Ti, Win 10 Pro, Saffire PRO 24 DSP, A-300 PRO, plus numerous gadgets and gizmos that make or manipulate sound in some way.
|
bapu
Max Output Level: 0 dBFS
- Total Posts : 86000
- Joined: 11/25/2006
- Location: Thousand Oaks, CA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 10:19 PM
(permalink)
Guitarpima This thread is making my brain hurt. Good luck figuring this out.
This is NOTHING compared to convo with my pal Mooch4056.
|
konradh
Max Output Level: -42 dBFS
- Total Posts : 3325
- Joined: 1/16/2006
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 10:21 PM
(permalink)
I am curious why anyone would calculate this or care. Is there a use for this information?
Konrad Current album and more: http://www.themightykonrad.com/ Sonar X1d Producer. V-Studio 700. PC: Intel i7 CPU 3.07GHz, 12 GB RAM. Win 7 64-bit. RealGuitar, RealStrat, RealLPC, Ivory II, Vienna Symphonic, Hollywood Strings, Electr6ity, Acoustic Legends, FabFour, Scarbee Rick/J-Bass/P-Bass, Kontakt 5. NI Session Guitar. Boldersounds, Noisefirm. EZ Drummer 2. EZ Mix. Melodyne Assist. Guitar Rig 4. Tyros 2, JV-1080, Kurzweil PC2R, TC Helicon VoiceWorks+. Rode NT2a, EV RE20. Presonus Eureka. Rokit 6s.
|
Andrew Rossa
Max Output Level: -56 dBFS
- Total Posts : 1910
- Joined: 4/14/2006
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 28, 13 10:43 PM
(permalink)
Wow this is intense. I'll defer to the engineers here :)
|
AnnihilationRob
Max Output Level: -90 dBFS
- Total Posts : 9
- Joined: 9/21/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 1:37 AM
(permalink)
Well I am actually developing a little app in c++ and I have a need for this information, and of course i'd like it to be as accurate as possible.
|
lfm
Max Output Level: -53 dBFS
- Total Posts : 2216
- Joined: 1/24/2005
- Location: Sweden
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 2:53 AM
(permalink)
drewfx1 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.
..and twice rounded off, since change of tempo as well as at the end. You won't change tempo in the middle of a quarternote.
|
brundlefly
Max Output Level: 0 dBFS
- Total Posts : 14250
- Joined: 9/14/2007
- Location: Manitou Spgs, Colorado
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 2:55 AM
(permalink)
☄ Helpfulby AnnihilationRob November 01, 13 12:14 AM
Okay, being something of a math geek, I had to play around with this a little. I initially thought I had it on the run as a rounding error due to the binary representation of decimal fractions, but couldn't quite make it work out. At some tempos, I could predict the exact error in what SONAR would show out at measure 1055, for example, but I actually couldn't make sense of the example you gave where 140BPM is 19.6875 samples/tick or a nice even 18900 samples/beat. Nevertheless, I think this is either a function of their not having allocated a enough precision to represent these fractional samples/tick values or they're using some internal reference for time other than sample rate that doesn't resolve evenly into both samples and ticks. In any case, this is an interesting discrepancy but definitely not worth worrying about in the real world.
SONAR Platinum x64, 2x MOTU 2408/PCIe-424 (24-bit, 48kHz) Win10, I7-6700K @ 4.0GHz, 24GB DDR4, 2TB HDD, 32GB SSD Cache, GeForce GTX 750Ti, 2x 24" 16:10 IPS Monitors
|
swamptooth
Max Output Level: -53 dBFS
- Total Posts : 2229
- Joined: 4/16/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 3:38 AM
(permalink)
☄ Helpfulby AnnihilationRob November 01, 13 12:14 AM
good one. x2 shows (in the inspector) 7229089 x3 gives me 7229092. cubase 7 and studio one give me 7229095. Reason 7 gives me 7229096. on second try took x3 and got the same 7229088 as you. even exporting and opening in wavosaur yielded the same numbers.
Arvid H. PetersonSonar X3E Prod / X2A / X1PE | Cubase 9.5.1 | Reason 9.5 | Sibelius7 | Pure DataNative-Instruments Komplete 10 Ultimate and a smattering of other pluginsHome-brewed VSTs Toshiba Satellite S855-S5378 (16GB RAM, modified with 2x 750GB HDDs, Windows 8.1 x64) Samson Graphite 49, M-Audio Oxygen 49, Korg nanoPAD2, Webcam motion tracking programs M-Audio Fast Track UltraMember, ASCAP
|
craigb
Max Output Level: 0 dBFS
- Total Posts : 41704
- Joined: 1/28/2009
- Location: The Pacific Northwestshire
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 4:48 AM
(permalink)
I know Pi to 40 decimal places (really) and even I'm not going to touch this subject.
Time for all of you to head over to Beyond My DAW!
|
cconde
Max Output Level: -90 dBFS
- Total Posts : 45
- Joined: 7/17/2010
- Location: Puerto Rico
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 6:28 AM
(permalink)
As we can see different applications give slightly different results, but all of the differences are in the order of ppm (parts per million). There are two main sources of error : pc clock and computational errors. Since it is not practical to try to control the pc clock's error (it is the smallest by the way in this case, ppb), just control the computational errors by using double precision variables and careful rounding. Then just live happy to see differences that are more linked to programmers computational methods.
Windows 8.1 Pro x64 - Intel i7-3770k - DZ77-RE-75k 32GB Sonar from 7 to X3d Producer x64 Full TH2 and Guitar Rig 5 EZ Drummer x64 Edirol FA-66 and UA-25EX Two Digitech GSP1101 + Control Set Line 6 HD500, Boss ME70, Boss BR-900, RP2000 Peavey JSX Bogner Uberkab 4x12 Zoom R16, Boss BR-900CD, Boss MicroBR Many Pedals (DS-1, Jekyll and Hyde, AW-3, Tone Driver, Vox, Whammy, Metal Master, Choruses, Delays, Compressors, etc.) Many Ibanez, Fenders, Schecters, and Custom Carvins.
|
Sanderxpander
Max Output Level: -36.5 dBFS
- Total Posts : 3873
- Joined: 9/30/2013
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 7:48 AM
(permalink)
Seems strange, and I wonder if it causes "problems" with sound coherence. A few samples isn't much but when you're stacking frequencies and trying to phase align bass parts etc, it could come in to play. Cubase, Studio One and Reason all seem "a lot" closer to the "correct" calculation. I'd be interested to see what the engineers have to say about it. 64-bit double precision engine doesn't really help much if your sample timing accuracy is off.
|
cconde
Max Output Level: -90 dBFS
- Total Posts : 45
- Joined: 7/17/2010
- Location: Puerto Rico
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 8:56 AM
(permalink)
Samples must be the same regardless of the software being used, assuming that raw data is the same. Therefore, no sound differences should be present if playback is done following every single data point. On the other hand, how the different applications load the raw data might also be a difference (considering the start and ending bits, data stacks, etc.). Data transformation to other variables will depend on calculation method, data precision, and rounding procedures. Since errors are in the parts per million order of magnitude it is definitely not a big deal. Our ears and brain will not catch them up. In addition, there are ways to synchronize the bars with external triggers to maintain the timing accuracy at its best, these techniques also minimize long time errors.
Windows 8.1 Pro x64 - Intel i7-3770k - DZ77-RE-75k 32GB Sonar from 7 to X3d Producer x64 Full TH2 and Guitar Rig 5 EZ Drummer x64 Edirol FA-66 and UA-25EX Two Digitech GSP1101 + Control Set Line 6 HD500, Boss ME70, Boss BR-900, RP2000 Peavey JSX Bogner Uberkab 4x12 Zoom R16, Boss BR-900CD, Boss MicroBR Many Pedals (DS-1, Jekyll and Hyde, AW-3, Tone Driver, Vox, Whammy, Metal Master, Choruses, Delays, Compressors, etc.) Many Ibanez, Fenders, Schecters, and Custom Carvins.
|
Sanderxpander
Max Output Level: -36.5 dBFS
- Total Posts : 3873
- Joined: 9/30/2013
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 9:02 AM
(permalink)
Samples should be the same regardless of the software being used. The problem arises when you have multiple samples playing at the same time and the sample timing accuracy is off by variable amounts. If the "timing shift" is uniform across all tracks it's not really an issue. But if one track seems to be 7 samples longer after a couple of bars, and another isn't, this could theoretically cause issues. I realize these are very very small deviations, and I definitely would not be able to pick this up as a fault. But when we're talking stacking frequencies, phase aligning, loudness maximizing, inter-sample peaks etc., this can become an issue. Hence, I'm interested in what the engineers have to say. There could be an entirely logical explanation.
|
swamptooth
Max Output Level: -53 dBFS
- Total Posts : 2229
- Joined: 4/16/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 12:38 AM
(permalink)
☄ Helpfulby AnnihilationRob November 01, 13 12:15 AM
this seems to be a looping artifact in sonar. the basic way that i tested the idea was setting up a project with the 122 and 140 bpms and pulling in a loop, dragging it to bar 95 and bouncing. if you take a look in the media browser, you can click on a loop and see its number of samples, which changes on load and tempo and sample rate and then whether you loop or unloop it. i think that there is an inherent difference between the way reason, cubase and studio one handle "loops" - they basically make repeated copies of the data, which is a bit different from sonar's method. what i think is happening is as was suggested above - the clock ticks are dropping 7 samples - because if you look at the clip in m:b:t time reference it shows a length of 375:959. if it was dropping 7 samples per bar i think it would be an issue. i'm having flashbacks of looking at this about 3 years ago...
Arvid H. PetersonSonar X3E Prod / X2A / X1PE | Cubase 9.5.1 | Reason 9.5 | Sibelius7 | Pure DataNative-Instruments Komplete 10 Ultimate and a smattering of other pluginsHome-brewed VSTs Toshiba Satellite S855-S5378 (16GB RAM, modified with 2x 750GB HDDs, Windows 8.1 x64) Samson Graphite 49, M-Audio Oxygen 49, Korg nanoPAD2, Webcam motion tracking programs M-Audio Fast Track UltraMember, ASCAP
|
mettelus
Max Output Level: -22 dBFS
- Total Posts : 5321
- Joined: 8/5/2005
- Location: Maryland, USA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 1:41 PM
(permalink)
☄ Helpfulby Mystic38 October 29, 13 6:46 PM
Somehow I knew I was going to cave and chime in when I first saw this thread... A great way to spin up engineers is simple, and applies here (others have already referred to this in the thread)... when you conduct a measurement, there is always an associated measurement error (+/- X), which is based on whatever ruler is used. As you combine measurements, you get a stack tolerance (combined +/- value). Interestingly, measurement error is taught at a VERY junior level, but when I ask senior engineers "What is your stack tolerance?" No answer. Many engineering issues are associated with this. Always consider the error of your rulers in any precision measurement. This application is engineering, not simply math.
ASUS ROG Maximus X Hero (Wi-Fi AC), i7-8700k, 16GB RAM, GTX-1070Ti, Win 10 Pro, Saffire PRO 24 DSP, A-300 PRO, plus numerous gadgets and gizmos that make or manipulate sound in some way.
|
drewfx1
Max Output Level: -9.5 dBFS
- Total Posts : 6585
- Joined: 8/4/2008
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 2:07 PM
(permalink)
It looks to me that for your tempo of 140 Sonar might be actually using ~140.000158, based on my calculations. Depending on the tempo entered at 12:01:000, I get sample counts of varying "correctness" at 95:01:000 (and beyond). For instance, if I put in a tempo of 146, I get a "perfect" answer according to the calculated value. 140.000158
 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
|
shmuelyosef
Max Output Level: -87 dBFS
- Total Posts : 178
- Joined: 5/15/2006
- Location: Palo Alto, CA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 5:33 PM
(permalink)
☄ Helpfulby Mystic38 October 29, 13 6:46 PM
Your total sample count is off by about 1 ppm (part per million). This is about 2.5 seconds per month. Most quartz timepieces are not this good. It might be a little better if you used a high-priced master clock, which claim to be sample accurate over 5-10 minutes. Probably best to take a pass on this problem.
- Sonar Platinum 64-bit; Reaper; Ableton Live 9; Samplitude - PugetSystems Serenity Mini: WIN 10-PRO 64-bit; Intel Quad i7-4670 turbo to 3.8GHz; 16GB RAM; ASUS Gryphon Z89 - Antec P180 case. - Focusrite Saffire Pro 40 - DSI OB-6 (love child of a Prophet and an Oberheim) - NORD Electro 3HP - Roland XP-10 - Customized Fender-Rhodes Dyno Stage 73
|
lawp
Max Output Level: -67 dBFS
- Total Posts : 1154
- Joined: 6/28/2012
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 6:04 PM
(permalink)
is this inevitable rounding /approximation in the code cumulative? if I do more processing do I become more approximate?
|
shmuelyosef
Max Output Level: -87 dBFS
- Total Posts : 178
- Joined: 5/15/2006
- Location: Palo Alto, CA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 7:14 PM
(permalink)
swamptooth this seems to be a looping artifact in sonar. the basic way that i tested the idea was setting up a project with the 122 and 140 bpms and pulling in a loop, dragging it to bar 95 and bouncing. if you take a look in the media browser, you can click on a loop and see its number of samples, which changes on load and tempo and sample rate and then whether you loop or unloop it. i think that there is an inherent difference between the way reason, cubase and studio one handle "loops" - they basically make repeated copies of the data, which is a bit different from sonar's method. what i think is happening is as was suggested above - the clock ticks are dropping 7 samples - because if you look at the clip in m:b:t time reference it shows a length of 375:959. if it was dropping 7 samples per bar i think it would be an issue. i'm having flashbacks of looking at this about 3 years ago...
When you do a Groove Clip in Cakewalk and extend it to multiple copies, do they actually re-sample with interpolation for each subsequent copy, in order to maintain a constant clock rate? It would be rare that a clip would be an exact integral multiple of the basic sample period...correct? Or does Cakewalk merely treat the bpm input value as a suggestion and then adjust so that each measure has an exact number of samples without jitter of the position of the first sample? How, exactly, do cubase and studio handle this? Do they just accept the jitter from measure to measure, and eat the phase issues that are introduced?
- Sonar Platinum 64-bit; Reaper; Ableton Live 9; Samplitude - PugetSystems Serenity Mini: WIN 10-PRO 64-bit; Intel Quad i7-4670 turbo to 3.8GHz; 16GB RAM; ASUS Gryphon Z89 - Antec P180 case. - Focusrite Saffire Pro 40 - DSI OB-6 (love child of a Prophet and an Oberheim) - NORD Electro 3HP - Roland XP-10 - Customized Fender-Rhodes Dyno Stage 73
|
shmuelyosef
Max Output Level: -87 dBFS
- Total Posts : 178
- Joined: 5/15/2006
- Location: Palo Alto, CA
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 7:17 PM
(permalink)
Sanderxpander Samples should be the same regardless of the software being used. The problem arises when you have multiple samples playing at the same time and the sample timing accuracy is off by variable amounts. If the "timing shift" is uniform across all tracks it's not really an issue. But if one track seems to be 7 samples longer after a couple of bars, and another isn't, this could theoretically cause issues. I realize these are very very small deviations, and I definitely would not be able to pick this up as a fault. But when we're talking stacking frequencies, phase aligning, loudness maximizing, inter-sample peaks etc., this can become an issue. Hence, I'm interested in what the engineers have to say. There could be an entirely logical explanation.
At 20kHz, 1 ppm is 8 degrees of phase shift...probably negligible
- Sonar Platinum 64-bit; Reaper; Ableton Live 9; Samplitude - PugetSystems Serenity Mini: WIN 10-PRO 64-bit; Intel Quad i7-4670 turbo to 3.8GHz; 16GB RAM; ASUS Gryphon Z89 - Antec P180 case. - Focusrite Saffire Pro 40 - DSI OB-6 (love child of a Prophet and an Oberheim) - NORD Electro 3HP - Roland XP-10 - Customized Fender-Rhodes Dyno Stage 73
|
fitzj
Max Output Level: -61 dBFS
- Total Posts : 1487
- Joined: 10/13/2005
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 7:32 PM
(permalink)
Where are the engineers andrew mentioned?
|
drewfx1
Max Output Level: -9.5 dBFS
- Total Posts : 6585
- Joined: 8/4/2008
- Status: offline
Re: Is my math wrong or is cakewalk's?
October 29, 13 8:05 PM
(permalink)
☄ Helpfulby AnnihilationRob November 01, 13 12:16 AM
Did a little more testing with an empty project with an empty midi track: If I take a tempo of 140 (or whatever) and don't bother with tempo changes, and look at a much higher measure#, something like 1000 or more, I find that the time in milliseconds matches the calculated time for the number of samples, not the number of measures/beats/tics. If I calculate the tempo from the sample count @44.1kHz over a long period of time, I can predict correctly the sample count and time in ms. This again leads me to believe the sample count is accurate, but the tempo is not exactly what it appears to be set to. And since the time displayed matches the sample count assuming 44.1kHz, it implies to me that it is not a clock timing issue.
 In order, then, to discover the limit of deepest tones, it is necessary not only to produce very violent agitations in the air but to give these the form of simple pendular vibrations. - Hermann von Helmholtz, predicting the role of the electric bassist in 1877.
|