Length of a Sample

Started by Really Weird Person, December 27, 2013, 04:23:35

Previous topic - Next topic

Really Weird Person

I have a question which you might or might not be able to answer.  I was informed that waveforms' lengths are measured in samples (e.g., a waveform with a length of 6,909,120). With a tempo of 125 beats per minute at 6 ticks per row (standard speed for modules), what is the duration of 1 of those samples (in seconds)? With that, I can find out precisely how many rows each waveform uses. I know that each row is 3/25 (.12) of a second in length. Therefore, I would simply multiply the length of a single sample by the number of samples in the waveform to obtain the length of the waveform in seconds. That would then be divided by .12 to obtain the number of rows that the waveform uses. That would then be divided by 64 to obtain the number of patterns required for the waveform. That seems more precise than converting the file's length (measured in hours, minutes, and seconds by Windows) to seconds and then dividing the number of seconds by 7.68 (the length of a single pattern).

Saga Musix

Since the sample rate is already the samples per second, you can use the rule of three: 1 / sample rate gives you the duration of a single sampling point (neglecting any rounding errors).

These formulas will help you converting that into ticks and rows (again, neglecting any rounding errors, so there will be discrepancies if you apply this to your 1248571982758214 hour long songs).
» No support, bug reports, feature requests via private messages - they will not be answered. Use the forums and the issue tracker so that everyone can benefit from your post.

Really Weird Person

Thank you for the reply. I also asked another audio application developer and he, too, informed me of the 1 / sample rate expression for finding the length of a single sample. Your expansion is also appreciated.