• Welcome to Theos PowerBasic Museum 2017.

News:

Attachments are only available to registered users.
Please register using your full, real name.

Main Menu

BassBox

Started by Patrice Terrier, October 08, 2007, 10:57:44 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Patrice Terrier

--Petr

Quotebut it would be handy to get how high the "tone" is

This can be done already (see plug001)

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#196
Nothing new in this patch, except that the CHM help file has been updated and completed.

There is just the "programming section" that has not been written yet, however other chapters are almost done.

Of course being not a native english speaking guy, I may have done some typos, so please be kind enough to report them to me, when you encounter them ;)

See below BassPatch43.zip

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Petr Schreiber

Hi Patrice,

thanks, I will study plugin 001 more as I thought it is silent/loud based.

Thanks for new version, maybe CHM file could be launched from Bassbox using [F1] key too ?


Thanks,
Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Charles Pegge

Petr, this is how I used the FFT Audto spectrun data in 005. I adapted it from Patrice's 006.
I found that nearly all the activity was in the first 64 or so elements - (does mp3 ignore the higher frequency harmonics ? )


         '// FFT MAGIC!
         '// BBP.FFTsize returns a pointer to an area of memory containing an array of 256 singles.
         '// This is then mapped to the fft() array where it can be accessed.
         DIM fft(BBP.FFTsize) AS SINGLE AT BBP.FFTdata
'....
         ' frequency spectrum
         LOCAL v AS SINGLE
         glpushmatrix 'for audio spectrum
         gltranslatef -6.4, 2.5, -dist*3
         DO
          IF i>=64 THEN EXIT DO
          gltranslatef 0.2,0,0
          v=fft(i)*32
          glcolor3f v*.5,0,v*2
          glcalllist 3 ' stick
          INCR i
         LOOP
         glpopmatrix ' for audio spectrum


Kent Sarikaya

Another great update release. Thanks guys. Really impressive!

Petr Schreiber

Hi Charles,

thanks a lot for sample code.
Regarding MP3s ... I am not sure but I think that cutting off the high frequences makes them what they are liked for - smaller size.


Thanks,
Petr
AMD Sempron 3400+ | 1GB RAM @ 533MHz | GeForce 6200 / GeForce 9500GT | 32bit Windows XP SP3

psch.thinbasic.com

Patrice Terrier

#201
Petr

Yes audio compressor are cutting off most of the high frequencies, because anyway they are not audible by a human hear.

This is for the same reason that I have limited the equalizer range between 80Hz and 14Khz.

You can mix altogether FFT (plug006, 007, 008) and PEAK level detection (Plug001, 004)

When you get the PEAK Level info, it is the highest left or right channel audio level beeing played at this specific time.

In Plug001, the higher the peak level is, the faster the octaedre is moving and pulsating.


Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#202
I have completed the CHM help file, and added the "F1" key as Petr suggested.

See below attached BassPatch44.zip

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#203
New visual plugin: "Boomer"

See below attached BassPatch45.zip

...
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Kent Sarikaya

Patrice, thanks phenomenal work you are doing. The F1 help is great. The new plugin is cool. I like seeing speakers thump :)

Patrice Terrier

#205
QuoteResizing to larger an back to smallest for several times leaves artefacts in the right-upper corner and the left-bottom corner.

Here is the workaround to solve the XP artefacts problem reported by Hans and Charles .

There are two changes thay must be done in zSkin.inc

'// Create new Main form region on the fly
SUB zCreateFormRegion(BYVAL TransColor AS LONG)
...
    IF hRgn1 THEN
       IF IsWindowVisible(zMainWindow(0)) THEN bRedraw = %TRUE ELSE bRedraw = %FALSE
       CALL SetWindowRgn(zMainWindow(0), hRgn1, bRedraw)
    END IF
   
END SUB


'// Paint our custom background there
SUB zMoveBackground(BYVAL rwX AS LONG, BYVAL rwY AS LONG)
...

'      // Paint GROUPBOX with respect of the z-order
       'IF Vista() THEN CALL PaintGroupBox(hMain, graphics)
       IF NOT zComposited() THEN CALL PaintGroupBox(hMain, graphics)

       CALL GdipDeleteGraphics(graphics)
    END IF

    '// %BACK_PaintBitmap
    hDCBack& = CreateCompatibleDC(hDC)
    CALL SelectObject(hDCBack&, zGetBackBitmap(hMain))
    CALL BitBlt(hDCBack&, 0, 0, rc.nRight, rc.nBottom, hDC, 0, 0, %SRCCOPY)
    CALL DeleteDC(hDCBack&)

'   // Paint caption text
    CALL zGetCaptionXY(x, y)
    CALL zDrawTextToDC(hDC, (zGetCTLText(hMain)), x, y, gColorCaption, SK_CAPTIONFONT(), SK_CAPTIONFONTHEIGHT(), -1, 0)

    CALL DeleteDC(hIC)
END SUB


Please let me know if that solves the problem?

See below the attached zSkin.inc

Thanks

...

Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Charles Pegge

Yes Patrice, that has fixed it. You found the solution so quickly!

Patrice Terrier

QuoteYes Patrice, that has fixed it. You found the solution so quickly!

Thanks for the feedback.

I was able to fix it quick, because I have spent so many years doing low level graphic programming, and I thought myself when I wrote the WinLIFT Skin Engine in the last decade of the twentieth century ::)
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Patrice Terrier

#208
HAL is the first BassBox plugin using multi-texture.

See all details in Plug010.bas


SUB MakeMutipleTexture (BYVAL tp AS BBPTEXTURE PTR, BYVAL N AS LONG)
    LOCAL mtCount, K, nRet, xSize, ySize AS LONG
    DIM mt(1 TO N) AS BBPTEXTURE AT tp
    mtCount = UBOUND(mt()) - LBOUND(mt()) + 1
    IF mtCount THEN
       DIM Texture(1 TO mtCount) AS LONG
       CALL glDeleteTextures(mtCount, Texture(1))
       CALL glGenTextures(mtCount, Texture(1)): nRet = glGetError()
       IF nRet = 0 THEN
          FOR K = 1 TO mtCount
              REDIM PixelArray(0) AS BYTE
              IF BBP_CreateGLTextureFromFile(mt(K).FullName, xSize, ySize, PixelArray(), mt(K).Square) THEN
                 mt(k).Texture = Texture(K)
                 CALL glBindTexture(%GL_TEXTURE_2D, Texture(K)): nRet = glGetError
                 IF nRet = 0 THEN
                    CALL glTexParameteri(%GL_TEXTURE_2D, %GL_TEXTURE_MAG_FILTER, %GL_LINEAR)
                    CALL glTexParameteri(%GL_TEXTURE_2D, %GL_TEXTURE_MIN_FILTER, %GL_LINEAR)
                    CALL glTexImage2D(%GL_TEXTURE_2D, 0, 4, xSize&, ySize&, 0, %GL_RGBA, %GL_UNSIGNED_BYTE, PixelArray(0))
                 END IF
              END IF
          NEXT
       END IF
    END IF
END SUB
 

HAL combine audio FFT, peak level, and pulse detection altogether.

Enjoy

See below attached BassPatch46.zip
Patrice Terrier
GDImage (advanced graphic addon)
http://www.zapsolution.com

Kent Sarikaya

Patrice that is just Sooooo Cooooooooooooooool !!!!!

Please guys make sure to get the Hal audio file too that Patrice put up... really clever mix of audio and effects. Thanks very very cool.
I feel like I have my own HAL!!