On Fri, 3 Feb 2017 06:01:21 +0100, Ralf Mardorf wrote:
>[weremouse@moonstudio ~]$ bpm2ms | head -9
>(60000ms/120BPM)*4*(1/1)= 2000ms
>(60000ms/120BPM)*4*(3/4)= 1500ms
>(60000ms/120BPM)*4*(1/2)= 1000ms
>(60000ms/120BPM)*4*(1/4)= 500ms
>(60000ms/120BPM)*4*(1/8)= 250ms
>(60000ms/120BPM)*4*(1/12)= ~166.66666666666666666667ms
>(60000ms/120BPM)*4*(1/16)= 125ms
>(60000ms/120BPM)*4*(1/24)= ~83.33333333333333333333ms
>(60000ms/120BPM)*4*(1/32)= 62.5ms

I was thinking in four-four time, it's better to changed "1/1" to "4/4"
and "1/2" to "2/4".

[weremouse@moonstudio ~]$ bpm2ms | head -9
(60000ms/120BPM)*4*(4/4)= 2000ms
(60000ms/120BPM)*4*(3/4)= 1500ms
(60000ms/120BPM)*4*(2/4)= 1000ms
(60000ms/120BPM)*4*(1/4)= 500ms
(60000ms/120BPM)*4*(1/8)= 250ms
(60000ms/120BPM)*4*(1/12)= ~166.66666666666666666667ms
(60000ms/120BPM)*4*(1/16)= 125ms
(60000ms/120BPM)*4*(1/24)= ~83.33333333333333333333ms
(60000ms/120BPM)*4*(1/32)= 62.5ms
[weremouse@moonstudio ~]$ ls -l /usr/local/bin/bpm2ms 
-rwxr-xr-x 1 root root 503 Feb  3 06:17 /usr/local/bin/bpm2ms

The script contains a weak typo protection, I reduced the regex
"[0-9][0-9]" to "[0-9]", so it became weaker, but now it's possible to
use one-digit BPM values.

The improved script is attached.

Attachment: bpm2ms
Description: Binary data

-- 
ubuntu-studio-users mailing list
ubuntu-studio-users@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/ubuntu-studio-users

Reply via email to