Page 1 of 1

Make the spectrum bar of the audio trigger widget logarithmic

Posted: Sat Nov 24, 2018 10:29 am
by mitscherdinger
Hi!

Using linear subdivisions of the frequency spectrum doesn't feel natural to me. Are there software related reasons for dealing with it that way? Or did I miss something to switch to a logarithmic view?

Greets!
Mitsch

Re: Make the spectrum bar of the audio trigger widget logarithmic

Posted: Sat Nov 24, 2018 10:59 am
by mcallegari
Please make a proposal.

Re: Make the spectrum bar of the audio trigger widget logarithmic

Posted: Sat Nov 24, 2018 1:05 pm
by mitscherdinger
The audio frequency spectrum goes from ~20 to ~20000 Hz. (At least for humans…) So, I'd normally start with 25 Hz and always double the frequency until the upper limit is reached. Following this rules, the border frequencies would be…

50 - 100 - 200 - 400 - 800 - 1600 - 3200 - 6400 - 12800

to get a 10-band segragation. The trickier part would be, if you still want to let the user decide, how much spectrum bars he wants… Surely, a mathematician can easily solve this, but I'm none of those guys… :)

Re: Make the spectrum bar of the audio trigger widget logarithmic

Posted: Mon Nov 26, 2018 10:16 pm
by andres robles
I do not finish understanding your question.
If what you want is to know if bands really act according to their frequency with accuracy, 100hz activate the band 100hz and 90hz not .... try it ... and check margins and the "Q" of equalizer ..... This clear that in this case is calculated to receive frequencies mainly "low mid-low, midlow-mid, mid high" what is important is not what a human hears, the important thing is to activate "scenes" through frequencies of a sound source .. ... Divide your sound with a "crossover" ......

Re: Make the spectrum bar of the audio trigger widget logarithmic

Posted: Mon Nov 26, 2018 11:52 pm
by janosvitok
If you divide bars logartihmically as andres has shown, you get one bar for each octave. It's more musical and more natural.
If you divide the bars every let's say 1000 Hz, first bar covers ~ 5 octaves, second only one octave, and the rest covers tiny fractions of octave. I don't want to calculate it now,
but you can easily get subtone intervals.

The calculations are easy:
if you want to divide interval A,B in N logarithmic intervals, i.e. A = A_0,... A_N = B, A_N/A_(N+1) = C is constant (the ratio of endpoints is always the same, in Andres example 1:2) then:
C = Nth root of B/A = 10^((log(B) - log(A))/N) (logarithms change multiplication to addition and roots to multiplication)
A_0 = A
A_i = A * C^i or A_i = 10^(log(A) + i * (log(B) - log(A))/N) (either multiply A by C as needed, or do the same with addition and logarithms)


I didn't look at how QLC+ actually divides frequencies, this is just the math :)


Jano

Re: Make the spectrum bar of the audio trigger widget logarithmic

Posted: Tue Nov 27, 2018 12:14 am
by mitscherdinger
andres robles wrote: Mon Nov 26, 2018 10:16 pm If what you want is to know if bands really act according to their frequency with accuracy, 100hz activate the band 100hz and 90hz not
Maybe, but if you want f.e. just three subdivisions to trigger your lights to it just makes a lot more sense to cut it at 200 and 2000 Hz ('cause you will get something like bass, mids and highs, although I'd rather raise the crossover 1/2 an octave to 300 and 3000 for that application) instead of a linear division of the 20000 Hz, where the crossover frequencies would be 6666 and 13222 Hz => two crossovers in the high frequency area…

Haven't had any audio utilization where linear ever beat logarithmic. But that's just my point of view… I have nothing against having both linear AND logarithmic…