Math(s)!

Music trends, latest album reviews...whatever!

Moderators: MattKingUSA, khz

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Math(s)!

Post by RyanH »

I don't have any friends who are into music production, so I thought I would post this here. (Not really Linux-related, but I am using Linux for my recordings.)

I just wanted to share an example of how math (maths, for my right-pondlian brothers and sisters) can play a role in music production. This could be helpful to the young rebel who sits in class and says, "Who gives a fig about math(s)? I just wanna rawk!"

The situation:

I have a song for which I want to use a hold delay effect on the guitar, so I can loop a chord progression and then play a lead over-top of it. The effect starts recording what I play when I tap the switch on the pedal board, and starts to repeat it after whatever amount of time I have set.

The song is 128 beats per minute, in 4/4 time. I want the delay effect to kick in after 4 bars.

The problemo:

How many milliseconds should I set the delay to?

The calculation:

60 seconds ÷ 128 beats = 0.46875 seconds per beat = 467.75 milliseconds per beat

x 16 beats (which is how many beats are in 4 bars using 4/4 time signature) = 7500 milliseconds

So by a beautiful coincidence, the result is a nice, whole number that I can plug into my hold delay to get a precisely repeated guitar riff to play a lead over.

Math(s)!

User avatar
Impostor
Established Member
Posts: 1337
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 346 times

Re: Math(s)!

Post by Impostor »

Could you please redo your calculations in binary? This is a Linux forum after all.

User avatar
Loki Harfagr
Established Member
Posts: 268
Joined: Thu Aug 02, 2018 1:28 pm
Has thanked: 151 times
Been thanked: 53 times

Re: Math(s)!

Post by Loki Harfagr »

Impostor wrote: Thu May 25, 2023 8:23 am

Could you please redo your calculations in binary? This is a Linux forum after all.

Given the Op used BPM and measure that'd be shift 4 bits left and 7 bits right akin to shift 3 bits right,
now use whatever coding language you prefer or have at hand ;)

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

Loki Harfagr wrote: Thu May 25, 2023 1:11 pm
Impostor wrote: Thu May 25, 2023 8:23 am

Could you please redo your calculations in binary? This is a Linux forum after all.

Given the Op used BPM and measure that'd be shift 4 bits left and 7 bits right akin to shift 3 bits right,
now use whatever coding language you prefer or have at hand ;)

Right, exactly. I couldn't have said it any better myself. I really couldn't have! :lol:

User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Math(s)!

Post by bluebell »

RyanH wrote: Thu May 25, 2023 7:44 am

The situation:

I have a song for which I want to use a hold delay effect on the guitar, so I can loop a chord progression and then play a lead over-top of it. The effect starts recording what I play when I tap the switch on the pedal board, and starts to repeat it after whatever amount of time I have set.

The song is 128 beats per minute, in 4/4 time. I want the delay effect to kick in after 4 bars.

The problemo:

How many milliseconds should I set the delay to?

Doesn't matter. Klick the Sync tab and set Subdivide to 1 and Time L and R to 4 x 4 :mrgreen:

a.jpg
a.jpg (75.74 KiB) Viewed 8824 times

This will still work after you changed the tempo of the song.

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
GMaq
Established Member
Posts: 2774
Joined: Fri Sep 25, 2009 1:42 pm
Has thanked: 520 times
Been thanked: 555 times

Re: Math(s)!

Post by GMaq »

Or... use the 'tap' feature that more and more time-based Plugins (and most Pedals) employ if you are a 'right pondlian' with a good sense of rhythm..

@bluebell
Not that I use many Calf Plugins but how do you enable the dark UI?

User avatar
bluebell
Established Member
Posts: 1909
Joined: Sat Sep 15, 2012 11:44 am
Location: Saarland, Germany
Has thanked: 111 times
Been thanked: 116 times

Re: Math(s)!

Post by bluebell »

GMaq wrote: Mon Jun 12, 2023 2:36 pm

Or... use the 'tap' feature that more and more time-based Plugins (and most Pedals) employ if you are a 'right pondlian' with a good sense of rhythm..

@bluebell
Not that I use many Calf Plugins but how do you enable the dark UI?

Start calfjackhost, then click File -> Preferences

Linux – MOTU UltraLite AVB – Qtractor – http://suedwestlicht.saar.de/

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

Oh, forgot to mention that the hold delay is an effect from a 20-or-so-year-old Vox Tonelab LE multi-pedal. :lol: Max delay is 8000 milliseconds. No plugins here - just a small LCD panel. BUT thanks for the tips.

I wonder if I can re-assign my midi keyboard's sustain pedal to trigger this in a plugin so that I can toggle it on and off while I play guitar (like I do with the Vox).

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

cuhnkedrik wrote: Mon Nov 20, 2023 3:10 am

May I kindly request you to perform the computations using the binary numeral system? This platform primarily serves as a forum dedicated to discussions related to Linux operating systems.

Ok, I'll see what I can do. Prediction: I can't do that. :lol:

User avatar
Loki Harfagr
Established Member
Posts: 268
Joined: Thu Aug 02, 2018 1:28 pm
Has thanked: 151 times
Been thanked: 53 times

Re: Math(s)!

Post by Loki Harfagr »

RyanH wrote: Tue Nov 21, 2023 7:24 am
cuhnkedrik wrote: Mon Nov 20, 2023 3:10 am

May I kindly request you to perform the computations using the binary numeral system? This platform primarily serves as a forum dedicated to discussions related to Linux operating systems.

Ok, I'll see what I can do. Prediction: I can't do that. :lol:

Sure you can, and you could since it was posted a few posts above, shift 3, here you are in simple bash (as an example but really use whatever you prefer):

Code: Select all

 echo $((60000>>3))
User avatar
Impostor
Established Member
Posts: 1337
Joined: Wed Aug 17, 2022 1:55 pm
Has thanked: 138 times
Been thanked: 346 times

Re: Math(s)!

Post by Impostor »

Did I just get plagiarized by a bot?

@bot: go well-order the reals, then come back.

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

Impostor wrote: Tue Nov 21, 2023 1:26 pm

Did I just get plagiarized by a bot?

@bot: go well-order the reals, then come back.

I wondered, too. I saw that this was the only post by that "user," and noted that you had said the same thing, but then couldn't think of why a bot would engage on my post in a less-used corner of an already niche website. I figured maybe it was just someone with a very dry sense of humour who hadn't read the other replies to my post.

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

Loki Harfagr wrote: Tue Nov 21, 2023 9:28 am

Sure you can, and you could since it was posted a few posts above, shift 3, here you are in simple bash (as an example but really use whatever you prefer):

Code: Select all

 echo $((60000>>3))

Haha, I just left that half-hearted reply as I didn't know whether it was a bot and I was being duped, or it was a person leaving their first-ever Linux Musicians post, in which case I didn't want to ignore it. It was the middle of the night and I just wanted to make the situation go away.

As to coding, I could not code my way out of a paper bag. I'm proud that I know which part of the nested quotes to delete to leave only yours to respond to, if that gives you some idea of my skills...

User avatar
RyanH
Established Member
Posts: 206
Joined: Fri Jul 08, 2022 7:58 am
Has thanked: 137 times
Been thanked: 43 times

Re: Math(s)!

Post by RyanH »

Loki Harfagr wrote: Tue Nov 21, 2023 9:28 am

Sure you can, and you could since it was posted a few posts above, shift 3, here you are in simple bash (as an example but really use whatever you prefer):

Code: Select all

 echo $((60000>>3))

Um, ok, I did what you said and have no idea how it worked. As someone who doesn't even know what it means to shift bits, it's like you just taught me how to perform magic. I get that 60,000 represents 60 seconds, but what part of that code snippet dealt with the 128bpm and the 16 beats? Even given that I can reduce my formula to 60,000/8 = 7,500, where would the 8 come from in the code snippet?

(I don't actually expect you to take the time to explain all this to me, but I am impressed)

User avatar
Loki Harfagr
Established Member
Posts: 268
Joined: Thu Aug 02, 2018 1:28 pm
Has thanked: 151 times
Been thanked: 53 times

Re: Math(s)!

Post by Loki Harfagr »

RyanH wrote: Wed Nov 22, 2023 9:11 am
Loki Harfagr wrote: Tue Nov 21, 2023 9:28 am

Sure you can, and you could since it was posted a few posts above, shift 3, here you are in simple bash (as an example but really use whatever you prefer):

Code: Select all

 echo $((60000>>3))

Um, ok, I did what you said and have no idea how it worked. As someone who doesn't even know what it means to shift bits, it's like you just taught me how to perform magic. I get that 60,000 represents 60 seconds, but what part of that code snippet dealt with the 128bpm and the 16 beats? Even given that I can reduce my formula to 60,000/8 = 7,500, where would the 8 come from in the code snippet?

(I don't actually expect you to take the time to explain all this to me, but I am impressed)

That was a kind joke using the fact you had used very specific values with 128 and 16:

Code: Select all

Given the Op used BPM and measure that'd be shift 4 bits left and 7 bits right akin to shift 3 bits right,
now use whatever coding language you prefer or have at hand 

thus rhe "math" behing simply resorted as to multiply by 16, in binary "shift 4 bits left" then divide by 128, in binary "shift 7 bits right", see:
60000 in binary reads 1110101001100000, shifting 4 bits left equals adding 4 noughts to the right: 11101010011000000000
now shift 7 bits right (divide by 128) is like ditching off the 7 last bits: 1110101001100
The result, binary 1110101001100 equals decimal 7500, easy as Pi ;)

Post Reply