calculate length of a pattern in seconds

Post Reply
User avatar
Keres
Posts: 466
Joined: Mon Mar 21, 2016 9:41 am
Location: N. Tulsa Ok.
Contact:

calculate length of a pattern in seconds

Post by Keres »

calculate length of a pattern in seconds.

if you are working in weird numbers and loads of time changes, a good way to figure out the actual length in seconds of a pattern as it is placed in the song layout is to put a 30 (stop song) command at the bottom and sample it in 16bit mono with the start and stop options enabled. once you have the sample of the pattern you can edit the sample and see at the bottom "base C5; 16bit; 44100 Hz; 592kb; 6.87s" if you need more detail than that you can hit the burger menu... misc... resample (new length) and it will display the number of samples of that 16bit 44k mono file... now you can divide by 44100 and get the real seconds... 6.8750113378684805 and you see that sunvox does not lie. remember to remove the 30 command ;)

i put this here as a pep talk to newbies and oldtimers because i catch myself clearing out the whole tune from the start of the sequence to negative time just to get the time estimation of a simple pattern. don't like... u know you do it. would be cool if the devs made an option to calculate the time in decimal of second and samples in the Pattern Properties, like a shortcut ;)

:friends: :friends: :friends:
User avatar
AutumnCheney
Posts: 503
Joined: Sun Dec 29, 2019 8:16 am
Location: tahlequah, ok, usa
Contact:

Re: calculate length of a pattern in seconds

Post by AutumnCheney »

actually, there's a simpler way than resampling

from the manual:
TPL (Speed) - Ticks Per Line. Tick is the smallest time interval in SunVox. Tick length in milliseconds = 60000 / BPM / 24.
so we can use the formula

Code: Select all

( 2.5 / bpm ) * tpl * pattern length in lines = length in seconds
(2.5 comes from 60000/(24 * 1000))

for example, if the bpm is 120, the tpl is 6 and the pattern is 32 lines, the formula works out to 4 seconds, which you can confirm by creating said project + pattern
my website: https://acheney.xyz

it features my music, sunvox content, and social media links!
User avatar
Keres
Posts: 466
Joined: Mon Mar 21, 2016 9:41 am
Location: N. Tulsa Ok.
Contact:

Re: calculate length of a pattern in seconds

Post by Keres »

That is IF you are using a steady tempo. what if every line has a random BPM?
User avatar
AutumnCheney
Posts: 503
Joined: Sun Dec 29, 2019 8:16 am
Location: tahlequah, ok, usa
Contact:

Re: calculate length of a pattern in seconds

Post by AutumnCheney »

that's true, but theoretically you could calculate the length of every bpm change and add them together

i think a bpm change every line would sound like a mess, the most i go is once every measure (prove me wrong!)
my website: https://acheney.xyz

it features my music, sunvox content, and social media links!
User avatar
Keres
Posts: 466
Joined: Mon Mar 21, 2016 9:41 am
Location: N. Tulsa Ok.
Contact:

Re: calculate length of a pattern in seconds

Post by Keres »

yeah, you are right... i'm prolly just making an oldschool sounding washed up mess.
Attachments
o9_37.sunvox.zip
(16.4 KiB) Downloaded 109 times
User avatar
AutumnCheney
Posts: 503
Joined: Sun Dec 29, 2019 8:16 am
Location: tahlequah, ok, usa
Contact:

Re: calculate length of a pattern in seconds

Post by AutumnCheney »

Keres wrote: Wed Nov 30, 2022 6:54 am yeah, you are right... i'm prolly just making an oldschool sounding washed up mess.
actually kind of cool, throw a randomly modulated loop module onto this and you'll have gantz graf
my website: https://acheney.xyz

it features my music, sunvox content, and social media links!
Post Reply