'FNum'/Audio.FFT.NumBins/'NUM_FFT_BINS' Local Issue!!

Discussion forum for G-Force users

Moderators: BTT, andy55, b.dwall, juxtiphi

Post Reply
jerohm
Senior Member
Posts: 421
Joined: Fri Jan 09, 2009 5:19 pm

'FNum'/Audio.FFT.NumBins/'NUM_FFT_BINS' Local Issue!!

Post by jerohm »

Paul/Andy -

Code: Select all

/*  fft() study -
       'FNum' can NOT be used to set "NUM_FFT_BINS" (aka Audio.FFT.NumBins)
          from within the Config file... !!! BAD !!!

        You CAN GLOBALLY set (Audio.FFT.NumBins= x) in the Preference files (Which WORKS) 
        but THAT would be globally applied to ALL Configs ... probably NOT what you want!

        With 'FNum'(Audio.FFT.NumBins)= 10, you SHOULD expect (2+8) triangular display peaks
        NOT some nice smooth distribution!!!!

	     "NUM_FFT_BINS" SEEMS to (READ) reference 'Audio.FFT.NumBins' Correctly

        You MAY ask, what is the big deal?  Well 'FNum' values of 1 and 3 may hold
        promise.

 
        *** I guess the NEXT question to ask is whether 'SNum' still works, aye? ***


        Also, there REALLY SHOULD be a way to determine the HIGHEST (and LOWEST) column VALUE contained
        in a vector...  For example you could DIVIDE every element of a given FFT result vector
        by the GREATEST value to normalize [0,1] the sample data.  This would be VERY Handy!
 
        Flowfield: '(Empty)'
*/
 
ConB=1
FNum=10         // Nope! Doesn't WORK!! (nor trying to set 'Audio.FFT.NumBins' within the Config) 
Num=185         // Can NOT use "NUM_FFT_BINS" HERE, WHY doesn't it Work!?!
Stps=2

A0="2-(2/Num)"
A1=".975"
A2="vectorLR(Num-1, 0, 1)"

B0="ID/Num"
B1="(A0*B0) - (A0/2)"           // X Position

B2="select(Id, B2, fft(A2))"    // tricky fft(Id/(Num-1))
C0="col(B2, Id) * s"

X0=" B1"
Y0="(2*C0-A1)"                  // Intensity *2

Pen=1
LWdt=1

Meta="reactive=3 detail=3 density=3 morphable=5"
Vers=400

jerohm
Senior Member
Posts: 421
Joined: Fri Jan 09, 2009 5:19 pm

Post by jerohm »

Code: Select all

 :
 :
A3=1    // Make sure you try with set to '1' and '0'
B2="select(Id, B2, resample(resample(fft(A2), FNum, 1, 0), NUM_FFT_BINS, 1, A3))"    // ;0)
 :
 :
:roll:

Code: Select all

 :
 :
A3=0
B2="select(Id, B2, resample(resample(fft(A2), FNum, 1, 0), NUM_FFT_BINS, 1, A3))"
B3="max(.001, resample(B2,1,1,1))"

C0="col(B2, Id)/B3 * s"
 :
 :
:wink:

jerohm
Senior Member
Posts: 421
Joined: Fri Jan 09, 2009 5:19 pm

Post by jerohm »

" Also, there REALLY SHOULD be a way to determine the HIGHEST (and LOWEST) column VALUE contained
in a vector... For example you could DIVIDE every element of a given FFT result vector
by the GREATEST value to normalize [0,1] the sample data. This would be VERY Handy!
" - jrm 26, Apr 2011

Code: Select all

/* Twinkle - jrm
        Crappy WS, with a purpose
        Excessively Complicated Normalization...
          (go ahead and throw ANY audio at this...)

	scalar="min( vector )"	// Really SHOULD be implemented!
	scalar="max( vector )"	// Really SHOULD be implemented!
*/
Aspc=1
ConB=1
Num="185"    // Global FNum
Stps="Num"   // NUM_S_STEPS

// Stps="NUM_S_STEPS"   // NUM_S_STEPS
// FNUM="Num"           // NUM_FFT_BINS

A0="2*s"
A1="2*Pi*s"
A2="Num-1"

B0="select(Id, B0, fft(A0))"
C0="max(col(B0, Id), select(Id, C0, .0001))"

X0="(B0/C0)*sin(A1+t/2)"
Y0="(B0/C0)*cos(A1+t/2)"

LWdt="(Id == A2) && (C0 > .001)"
Pen=1
Meta="reactive=3 detail=3 density=4 morphable=3"
Vers=400

User avatar
JayPro
Posts: 738
Joined: Sat May 01, 2004 10:51 pm
Location: Huntington Station, Long Island, New York

Post by JayPro »

@Jerohm:

Change the divisor function in X and Y where it reads (B0/C0) to minus. Also, change ConB to zero. Everything else is unchanged.
EDIT: Raise Num to 500.

More noodling to come... ;)
"God is syntax."

jerohm
Senior Member
Posts: 421
Joined: Fri Jan 09, 2009 5:19 pm

Post by jerohm »

Sorry I didn't reply earlier. I post stuff, for those who might care, and I hope to spark a slightly different take on what currently exists. Always feel free to use anything you see fit as a starting point of your own endeavors. - Have Fun!


The purpose of this exercise was to highlight the great deal of acrobatics that was required to determine the greatest column value for a given vector(row). It is a valuable function that really needs to be implemented as a native operation. There are other very minor language functionality modifications that would offer great value and remain total consistent with existing syntax (and philosophy?? :shock: )

Post Reply