Dark Bit Factory & Gravity

PROGRAMMING => Purebasic => Topic started by: waste on June 03, 2016

Title: intros/demos sound Vumeter
Post by: waste on June 03, 2016
hello ,

i'm looking for a hint to start coding a sound vumeter for my intros , i don't know how to do that , hooks ? or simply adapt timers on sprites display to make vumeter based on music rythm ??

thanks 
Title: Re: intros/demos sound Vumeter
Post by: inc. on June 04, 2016
unfortunately i have the whole code and all libs to create powerful programs that you are looking for.
why unfortunately?
it is very old stuff and only works well with PureBasic version 3.94

You can have it, if you think it is worth

example exe here:
http://www105.zippyshare.com/v/ay8gCgU7/file.html
Title: Re: intros/demos sound Vumeter
Post by: emook on June 04, 2016
First all, what is the source of music? MP3? MODs? XMs? etc?

Title: Re: intros/demos sound Vumeter
Post by: waste on June 06, 2016
usually it's xm or s3m, but for my future projects i will use Protrekkr so i will be .ptp files,

with the userlib ptkreplay we can obtain song position precisely,  i think we can use these functionnalities  to make the vumeter bars  Ptk_GetPosition(), Ptk_GetRow()

but it's  the way how to do this,

inc. => yes this is what i would like to do,  may b pb 3.94 functions can be adapted to 5.42 ....if you can show me source code,  i can try
Title: Re: intros/demos sound Vumeter
Post by: inc. on June 06, 2016
Quote from: waste

inc. => yes this is what i would like to do,  may b pb 3.94 functions can be adapted to 5.42 ....if you can show me source code,  i can try
i'm not sure. the libs are not open source. maybe someone can translate em into pb5+

 :updance:
Title: Re: intros/demos sound Vumeter
Post by: waste on June 22, 2016
hi,

i found a way to render a wave spectrum, but with fmod lib ... do you know if it's possible to  :

- play a module with Ptk in order to catch pattern position
- use the fmod lib to catch channel where sound is played
- render spectrum

.chm of fmod is empty ...no usage help
attachment fmod + src +  bad taste mp3 test file
Title: Re: intros/demos sound Vumeter
Post by: inc. on June 22, 2016
hi,
the wave rendering to the music in real time works fine here. (http://www.purebasic.fr/german/images/smilies/allright.gif)
but i personally never worked with fmod.
i think i can't help :( but i will have a look.
i used to play around with EQs, using the mp3d lib.
routing each channel to a vu meter
Title: Re: intros/demos sound Vumeter
Post by: waste on June 29, 2016
hello all,

so , v2 for the spectrum , always with fmod for the moment,  i have put the spectrum out of his proper loop and add it in main loop,

i added  FX  with EP_FXlib , rasterbars and starfield ok , but i obtain a POLINK error refering to string chars  when adding scrolltext  ???

precisely when i use EP_SetScrolltext , source code in attachment ,

it's a little weird, i used EP_fx scrolltexts for ages !! first time i see that  ,  try to uncomment the ligne 31 ....

Title: Re: intros/demos sound Vumeter
Post by: inc. on June 29, 2016
i've fixed your Font Scroller but you have another Problem,

the CanvasGadget() and the Box() can't be moved in Z-Order into the background. and your Command: Delay (25) let flicker the box.

copy the code and run it. all is fine but if you uncomment Line 79 you will see

Code: [Select]
IncludeFile "fmodex(short).pbi"

Enumeration
  #Mainform
  #Wave
  #spectrum
  #win
EndEnumeration

Global fmodsystem.i, Channel.i
i.i
j.i
Max.i
Position.i
YCurrentWave.i
YOldWave.i

 
EP_InitFXLib()
InitSprite()

MP_Graphics3D (1024,768,0,1)

CanvasGadget(#spectrum, 240, 150, 540, 400)

FMOD_System_Create(@fmodsystem)

FMOD_System_Init(fmodsystem, 32, #FMOD_INIT_NORMAL, 0)
File.s = "Gunther.mp3"

Dim WaveArray.f(1024)
FMOD_System_CreateStream(fmodsystem, @File, #FMOD_SOFTWARE, 0, @sound)
FMOD_System_PlaySound(fmodsystem, #FMOD_CHANNEL_FREE, sound, 0, @channel)


EP_Init2DStars(200,7,1.3,0,0,1024,768)
EP_2DStarsColor(1,RGB(255,0,0))
EP_FastRasterBar(0,RGB(40,140,250),50)
EP_FastRasterBar(1,RGB(135,135,135),50)

;////////////////////////////////////
;- SINUS FONT
;////////////////////////////////////
    EP_CatchFont32(bmpfont,?font, ?endfont)
    EP_SetScrollText(bmpfont,"  yep ! .............that's all good !! ")     
    EP_Create32Scroll(bmpfont, 0, 0,240, 0,1030)
    EP_SetScroll32Speed(bmpfont, 5)
    EP_SetSinScroll32(bmpfont, 2, 2, 30, -1)

;----MainLoop---------------------------------------------------------------


Repeat
 
  event=WindowEvent()         
 
    MP_RenderBegin()
 
 FMOD_Channel_GetWaveData(Channel, WaveArray(), 1024, 0)
   
 StartDrawing(CanvasOutput(#spectrum))
       
  DrawingMode(#PB_2DDrawing_AllChannels)

  Box(0, 0, 1026, 500,RGB(0, 0, 0))
   
   
  DrawingMode(#PB_2DDrawing_Transparent)
    For i=1 To 1024
      YOldWave=(WaveArray(i-1)+1)*250
      YCurrentWave=(WaveArray(i)+1)*250
      LineXY(i-1,YOldWave,i,YCurrentWave,RGB(0,200,50))
      LineXY(i-1,YOldWave+1,i,YCurrentWave+1,RGB(0,90,50))
      LineXY(i-1,YOldWave-1,i,YCurrentWave-1,RGB(0,110,50))
    Next
   
    StopDrawing()
    ;Delay(25)
         
         
EP_2DStarsDraw()
EP_2DStarsDegree(b.f) ; RANDOM DEGREE
b.f - 0.1

 EP_DisplayRasterBar(0,30)
 EP_DisplayRasterBar(1,740)
 EP_Move32Scroll(0)

 MP_Render2D ()     
 MP_RenderSprite ()
 MP_RenderEnd()
 MP_Flip ()
 
 
 Until GetAsyncKeyState_(#VK_ESCAPE)

         
      FMOD_Channel_Stop(Channel)
      FMOD_System_Release(fmodsystem)
      End
     
 DataSection
  font:
  IncludeBinary "2.bmp"
  endfont:
EndDataSection
Title: Re: intros/demos sound Vumeter
Post by: waste on June 30, 2016
thanks to take some time,  unfortunely it 's the same for me , always POLINK error when line  EP_SetScrollText(bmpfont,"...") is uncommented .....

if i put a comment before , code runs but music is not played ...

pb version ?? i use 5.42 x86 LTS actually, haven't tested with 5.24 LTS
Title: Re: intros/demos sound Vumeter
Post by: inc. on June 30, 2016
Mp3d lib and the FX lib is only working with PB V5.30
I've tested with PB v5.42 and above: not working here

The EP FX commands comes from EPYX's FX lib and is older than the mp3d lib. I don't think that Epyx will fix it up? But never say never.  I send him a message and ask. Maybe he is motivated to correct the whole FX lib for newer PB V's. :)
return to PB v5.30 and all works fine.
Title: Re: intros/demos sound Vumeter
Post by: waste on June 30, 2016
after a lot of fails ,  i managed to fix the problem

all is working for me now with pb 5.42 LTS x86 , win 8.1 Entreprise (64b) and the new version of MP3D

http://www.flasharts.de/mpz/mp33_beta/dx9/pb540_32/MP3D_Library.zip (http://www.flasharts.de/mpz/mp33_beta/dx9/pb540_32/MP3D_Library.zip)  :clap:

fmod is quite difficult to use ,

now i will find a way to catch channells output with Bass.dll and render a spectrum with it  from a playing module with protrekkr  :P
Title: Re: intros/demos sound Vumeter
Post by: inc. on June 30, 2016
Congrats :D
I  still use v5.30.
I make some tests with mp3d + EQ.  If it's working. You can have the code.
Title: Re: intros/demos sound Vumeter
Post by: inc. on July 01, 2016
please check this binaray.
maybe this is what you like: Oscilloscope.exe
ESC for exit
Title: Re: intros/demos sound Vumeter
Post by: waste on July 04, 2016
 :clap:

this is perfect !  so in this case , it 's with EQ from MP3D  ?
Title: Re: intros/demos sound Vumeter
Post by: inc. on July 04, 2016
:clap:

this is perfect !  so in this case , it 's with EQ from MP3D  ?

It is purebasic code. The EQ Bars are progressbars. But it only works with v2m music. I must  dig deeper if it would work with mp3  too.  If you wanna use v2m sounds Then this code should work in your Project.
Title: Re: intros/demos sound Vumeter
Post by: waste on July 04, 2016
first try with v2m files , but why is there  no sound played !!  :'( the .v2m file exists into the project folder, i have values in the debug window  and the .inc v2m player works perfectly ....



Code: [Select]
DataSection
  sound:
  IncludeBinary "spark.v2m"
EndDataSection

MP_CatchV2M(?sound)

left.f
right.f

MP_PlayV2M(0)
IsPlaying=1
Repeat
 
 
 
   Debug MP_GetChannelVUV2M(channel, @left, @right)

 
 Until GetAsyncKeyState_(#VK_ESCAPE)
 
 MP_StopV2M(0)


 
 End
Title: Re: intros/demos sound Vumeter
Post by: inc. on July 04, 2016
it expect a window but there aren't any :D

and remember: MP3D Lib does not support *.v2m sound verion 1.0
it only support: *.v2m verion1.5

loading v1.0 will crash. in this case you have to convert v1 to v1.5 with conv2m.exe

(https://abload.de/img/neu-2lzu9r.png)

Code: [Select]
;
; a cheap v2m player used MP3D lib from
; http://www.flasharts.de/mpz/mp33_beta/dx9/pb540_32/MP3D_Library.zip
;
; by inc. 2016
; PureBasic v5.30
;

Enumeration
  #Info
  #PeekLeft
  #PeekRight
  #Btn_Open
  #MainVULeft
  #MainVURight
EndEnumeration

DataSection
  rocket_sauce_v2m_start:
    ;{ size : 7315 bytes
    Data.q $00004A6600000080,$3F00000000000001,$01460804040005AB,$234B240124490000,$2302237024702371
    Data.q $237123702470234C,$23712370244B2401,$2371234C23012470,$244B230223702470,$2401247023702470
    Data.q $237024702371234B,$23702470234C2302,$2370244B23022371,$234B240124702371,$2302237024702371
    Data.q $237123702470234C,$23712370244B2401,$2371234C23012470,$244B230223702470,$2401247023702470
    Data.q $237024702371234B,$23702470234C2302,$2370244B23022371,$234B240124702371,$2302237024702371
    Data.q $237123702470234C,$23712370244B2401,$2371234C23012470,$244B230223702470,$2401247023702470
    Data.q $237024702371234B,$23702470234C2302,$2370244B23022371,$234B240124702371,$2302237024702371
    Data.q $237123702470234C,$23712370244B2401,$2371234C23012470,$244B230223702470,$2401247023702470
    Data.q $237024702371234B,$23702470234C2302,$2370244B23022371,$2401240148272371,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000002700000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $00F4000C00000000,$9C649C649C640000,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64,$9C649C649C649C64
    Data.q $9C649C649C649C64,$9C649C649C649C64,$0000000000000001,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$4801499E000001E0,$4901480248272302,$4802480248262401
    Data.q $4801490149262401,$4901480248272302,$4802480248262401,$4802480149262302,$4901490148272302
    Data.q $4802480248262401,$4802480149262401,$4901490148272302,$4702480248272301,$4802480149262402
    Data.q $4801490148272302,$4901480248272401,$4802480248262401,$4801490149262302,$4901480249262302
    Data.q $4802480248262401,$4801490149262302,$4901490148272302,$4802480248262401,$4802480149262302
    Data.q $4901490148272302,$4802480248262401,$4802480149262401,$4901490148272302,$4802480248272301
    Data.q $4802480149262401,$4801490247272302,$4901480248272302,$4802490148272301,$4802480149262302
    Data.q $4901480248272302,$4901480248262401,$4801490149262302,$4901480248272302,$4802480248262401
    Data.q $4802480149262401,$4901490148272302,$4802480248262401,$4802480149262401,$4901490148272302
    Data.q $4803470248272301,$4802480149262401,$4801490148272302,$4801480248272302,$4802480248262402
    Data.q $4801490149262302,$4901480248272401,$4802480248262401,$4801490149262302,$4901480249262302
    Data.q $4802480248262401,$4802480149262302,$4901490148272302,$4802480248262401,$4802480149262401
    Data.q $4901490148272302,$4802480248272301,$0000000449262401,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$000C003300000000,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9
    Data.q $000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C,$000C000000FB00F9,$000C00F600F2000C
    Data.q $000C000000FB00F9,$000C00F600F2000C,$C63AC63A00FB00F9,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A,$C63AC63AC63AC63A
    Data.q $C63AC63AC63AC63A,$C63AC63AC63AC63A,$00000001C63AC63A,$0000000001000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000006000000000,$2304240423042395,$2304240324042304
    Data.q $2404230423042404,$2404230423042403,$2305230423042379,$2304230424042304,$2404230424032404
    Data.q $2404230423042403,$2304240423042304,$2304230424042403,$2404230423042404,$2404230423042403
    Data.q $0001000100010000,$0001000100010001,$0001000100010001,$0001000100010001,$0001000100010013
    Data.q $0001000100010001,$0001000100010001,$0001000100010001,$0001000100010001,$0001000100010001
    Data.q $0001000100010001,$0001000100010001,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000037
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$817F817F817F817F,$817F817F817F817F,$817F817F817F817F,$817F817F817F817F
    Data.q $817F817F817F817F,$817F817F817F817F,$817F817F817F817F,$817F817F817F817F,$817F817F817F817F
    Data.q $817F817F817F817F,$817F817F817F817F,$817F817F817F817F,$0200000000000001,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$23712301000000F0,$2470237123702470
    Data.q $244B237123272326,$2470237123702401,$2426242624702370,$24702302234C2370,$2370247023712370
    Data.q $234B247024262327,$2371237024702302,$2327232723702470,$23712376244B2470,$2370237123702470
    Data.q $244B237124252427,$2470237123702401,$2426242623712370,$24702302244B2370,$2370247024702370
    Data.q $234B247024262327,$2371237024702302,$2327232723702470,$23712301244B2470,$2470237123702470
    Data.q $244B237123262426,$2470237124702301,$2426242623712370,$24702302234C2370,$2370247023712370
    Data.q $234B247024262327,$2371237024702302,$2327232723702470,$00000000244B2470,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000001200000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000003500000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$EA16EA1600000000,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16
    Data.q $EA16EA16EA16EA16,$EA16EA16EA16EA16,$EA16EA16EA16EA16,$00000001EA16EA16,$0000000003000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$DB02DC7600000020
    Data.q $DC02DCC14D02DB96,$DB02DCC14D02DC95,$DC02DBC24D01DC96,$000000124D02DC95,$0000000302000000
    Data.q $0000000302000000,$0000000302000000,$0000000002000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$00FE004B00000000,$00FE000C000200F4,$00FE000C000200F4,$00FE000C000200F4
    Data.q $EE12EE12000200F4,$EE12EE12EE12EE12,$EE12EE12EE12EE12,$EE12EE12EE12EE12,$00000001EE12EE12
    Data.q $0000000005000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $480025590000002C,$4700253049002431,$4800259D48002576,$490025CD48002530,$480026C34800259B
    Data.q $480025CD4900249D,$0000000400000006,$0000000200000004,$0000000400000003,$0000001200000008
    Data.q $0000000300000004,$0000000000000008,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$000100FF0001002A,$000100FF000100FF,$000100FF000100FF
    Data.q $000100FF000100FF,$000100FF000100FF,$B947B947000100FF,$B947B947B947B947,$B947B947B947B947
    Data.q $B947B947B947B947,$B947B947B947B947,$B947B947B947B947,$0600000000000001,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000,$0000000000000000
    Data.q $0000000000000000,$0000000000000000,$3F20702A00000017,$00400000423E5064,$14205A0201000079
    Data.q $1C00000307004040,$F100000088000000,$C60000015A000000,$8F0000022C000001,$4000034041000002
    Data.q $0049400005000040,$0100485D5F00007A,$004001635E000063,$2C4000680D407A25,$03004040005D0400
    Data.q $01014B02024A0001,$0000007A00024000,$0100000004000000,$1E20204056407D1B,$205A020100006138
    Data.q $2568000610404014,$7F003B7F07254C0A,$401349090752092B,$027E3F4040000240,$40000062124B4000
    Data.q $3A005342017E2040,$0400002000400000,$001A000039400032,$0040010104191F40,$0000400001013200
    Data.q $020000000000007E,$4000002000000048,$0000400000202040,$01404014205A0201,$0A327F01257F0005
    Data.q $157A093B7F07157F,$7E40404400024040,$00047E40404A0002,$03007E037E184040,$0000200040015E68
    Data.q $40005A0040000000,$4000010140404040,$0040000101000000,$0000000000007E00,$0000200000000002
    Data.q $0040000020204040,$404014205A020100,$04410A327F010501,$63002469003B4C07,$20403900033F4021
    Data.q $047F20493900037F,$007F000040405D00,$7F22014000004000,$00002B40002F0040,$0101011F4B40012E
    Data.q $400001016B00425A,$00000000017F0000,$4955007F00000000,$4000002020404040,$1100652C02010001
    Data.q $7F01257F00060138,$093B6A07047F0932,$044040137F0A0A7F,$4000007E00404000,$20404000007E2040
    Data.q $017E19027E1A017E,$003D00487E060040,$4040404000002D40,$0000004000010140,$017E000040000101
    Data.q $0000000000000000,$2040400000200000,$0201000140000020,$0004015500323B12,$01410A327F01257F
    Data.q $40000140403B4707,$20404000007E0040,$017E20404000007E,$0040000040005F3F,$404040405A000020
    Data.q $0140404040400000,$0101000000400001,$0000007E00004000,$0200003B0E000000,$0020204040402076
    Data.q $205A020100004000,$257F000302404014,$40403B7F07043E01,$01017D0040400003,$405F01037D202D40
    Data.q $593C035F43027D72,$400A007D20044001,$4040400000404040,$00005B0000044040,$7000001B0000037D
    Data.q $5817000000000001,$2F21007D20000001,$0100016132485250,$0A02674014204502,$7F0A327F01254B00
    Data.q $0B107F0B3B7F070A,$00340B2F460B1551,$00550C6D0A1E380B,$0008000000010000,$5F58414844210000
    Data.q $6B5F4849776B2120,$5F48413472622120,$41416621206E4855,$48416A2120736B5F,$574F212073706D5F
    Data.q $4421205F52457621,$456C21205F584148,$21205F59497A2159,$000020675F414164
    Data.b $00,$00,$00
    rocket_sauce_v2m_end:
 ;}
EndDataSection

Define MainVULeft.f, MainVURight.f

OpenWindow(0, 0, 0, 200, 60, "v2m player by inc", #PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_Invisible)
SetWindowColor(0, RGB(137, 137, 137))

TextGadget(#Info, 25, 40, 150, 20, "Rocket Sauce is playing", #SS_CENTER|#SS_CENTERIMAGE)
SetGadgetColor(#Info, #PB_Gadget_BackColor, RGB(137, 137, 137))

TextGadget(#PeekLeft, 7, 0, 8, 16, "L", #SS_CENTER|#SS_CENTERIMAGE)
SetGadgetColor(#PeekLeft, #PB_Gadget_BackColor, RGB(137, 137, 137))
TextGadget(#PeekRight, 184, 0, 8, 16, "R", #SS_CENTER|#SS_CENTERIMAGE)
SetGadgetColor(#PeekRight, #PB_Gadget_BackColor, RGB(137, 137, 137))

ProgressBarGadget(#MainVULeft, 7, 20, 8, 40, 0, 100, #PB_ProgressBar_Smooth|#PB_ProgressBar_Vertical)   ; MainVU Left
ProgressBarGadget(#MainVURight, 185, 20, 8, 40, 0, 100, #PB_ProgressBar_Smooth|#PB_ProgressBar_Vertical); MainVU Right

TextGadget(#Btn_Open, 40, 10, 120, 20, "open a new v2m Song", #SS_CENTER|#SS_CENTERIMAGE|#SS_NOTIFY)
SetGadgetColor(#Btn_Open, #PB_Gadget_BackColor, RGB(72, 72, 72))
SetGadgetColor(#Btn_Open, #PB_Gadget_FrontColor, RGB(229, 229, 229))

MP_CatchV2M(?rocket_sauce_v2m_start)  ;LOAD SONG from MEMORY
MP_PlayV2M(0)        ;0 START SOUND FROM THE BEGINNING

HideWindow(0, #False)

Repeat
  Event = WindowEvent()
  EventType = EventType()
  EventGadget = EventGadget()
;////////////////////////////////////
;-OPEN NEW V2M SONG
;////////////////////////////////////
Select Event
  Case #PB_Event_Gadget
    If EventGadget = #Btn_Open
       MP_StopV2M(0) ;Stop
       MP_FreeV2M()   ;Unload current song from mem
   
      NewSoundFile$ = OpenFileRequester("Choose a .v2m file", "", "V2M files|*.v2m",0)
       MP_LoadV2M(NewSoundFile$)
       MP_PlayV2M(0) ;0 STARTs SONG At THE BEGINNING
       SetGadgetText(#Info, " " + GetFilePart(NewSoundFile$))
   EndIf
EndSelect     
;//////////////////////////////////////     
; LOOP FUNCTION V2M SOUND
;//////////////////////////////////////
  If MP_IsPlayingV2M()
     IsPlaying=1 ;CHECKiNG SONG IS PLAYING
     Else
      EndOfTrackReached=1 ;IF SONG REACHED ITS END
      ;RESTART PLAYBACK
       Delay(1000)   ;WAIT 1000 ms. AND START OVER FROM THE BEGINNING
       ;SetGadgetText(#Info, "replay v2m now")
        MP_PlayV2M(0) ;0 STARTs SONG At THE BEGINNING
  EndIf
;////////////////////////////////////     
; DISPLAY MAIN VU LEFT n RIGHT
;////////////////////////////////////
  MP_GetMainVUV2M(@MainVULeft,@MainVURight)
  SetGadgetState(#MainVULeft,MainVURight*250) ; MainVU Left  --> *100 = 0 dB / the Song is a bit quiet. i used *250 to see a better music level
  SetGadgetState(#MainVURight,MainVURight*250); MainVU Right --> *100 = 0 dB / the Song is a bit quiet. i used *250 to see a better music level
 
  Debug MP_GetChannelVUV2M(channel, @MainVULeft.f, @MainVURight.f)
 
  Select Event
    Case #PB_Event_CloseWindow
      End
  EndSelect
 
 Until GetAsyncKeyState_(#VK_ESCAPE):End

btw. do you need the EQ code ?
Title: Re: intros/demos sound Vumeter
Post by: waste on July 05, 2016
yes if you could send me the code or the routine wher EQ and progress bars are used it would help !

 i didn't know for the .v2m version, that's why PureBasic crashed , i will convert modules so
Title: Re: intros/demos sound Vumeter
Post by: inc. on July 05, 2016
You can see in the code, how i used VU output. It is quite the Same.
Will post the code today
Title: Re: intros/demos sound Vumeter
Post by: inc. on July 05, 2016
Here comes the package.

first, install the PureCOLOR-500-Installer.exe, is needed to customize the EQ Bars.
For more options then, press F1 and check the external Lib Helpfile

If you need more transparency for the EQ i can add a Alpha Layer.
Title: Re: intros/demos sound Vumeter
Post by: ~Ar-S~ on July 20, 2016
here is a pretty good exemple from Dobro to  make a good spectrum with Fmodex Dll.
i use it to make my (pretty good) webradio player.
http://ldvmultimedia.com/telecharger_ars_stream_radio.php (http://ldvmultimedia.com/telecharger_ars_stream_radio.php)

EnJoY

Code: [Select]
;***********************************************
;Titre  :*test_fmodex
;Auteur  : Dobro
;Date  :24/10/2013
;Heure  :17:22:14
;Version Purebasic :  PureBasic 5.20 LTS (Windows - x86)
; Libairies necessaire : Fmodex.pbi
;***********************************************


Enumeration
#window
#image
EndEnumeration


XIncludeFile "E:\MULTIMEDIA\PUREBASIC\5.20\_Fmodex_5_20\fmodex.pbi"


Declare    Oscillo(sound)


; **************** initialisation Sprite des 512 niveaux************
Global Dim Arr.F(512) ; tableau pour les 512 niveaux
If InitSprite() = 0
MessageRequester("Erreur", "Impossible d'ouvrir l'écran & l'environnement nécessaire aux sprites !", 0)
End
EndIf
Structure sprite
x.l
y.l
EndStructure
Global Dim sprite.sprite(512)
; creation de la fenetre d'affichage des niveau

If OpenWindow(#window, pos_x, pos_y, 300, 55, "Pure Radio", #PB_Window_SystemMenu)

If OpenWindowedScreen(WindowID(#window), 4, 4,290,50,0,0,0 )
ClearScreen(RGB($0,$0,$0))
FlipBuffers()

For i=1 To 512 Step 4
CreateSprite(i,2,32):CreateImage(#image,2,32,32)
sprite(i)\x=i
sprite(i)\y=50
StartDrawing ( ImageOutput (#image))
DrawingMode ( #PB_2DDrawing_Gradient )
;
BackColor($0000FF)
GradientColor(0.4, $00FFFF)
GradientColor(0.6, $FFFF00)
FrontColor($FF0000)
LinearGradient(0, 0, 2, 32)

Box(0, 0, 2, 32)
StopDrawing ()

StartDrawing ( SpriteOutput (i))
DrawImage(ImageID(#image),0,0)
StopDrawing()

Next i

EndIf
EndIf
; *******************************************



url$="http://50.7.98.106:8398/"

; ************init ****************************
FMOD_System_Create(@fmodsystem)
FMOD_System_Init(fmodsystem, 32, 0, 0)
; ***************************************


FMOD_System_CreateStream(fmodsystem, @url$, #FMOD_CREATESTREAM, 0, @sound)

FMOD_System_PlaySound(fmodsystem, 0, sound, 0, @channel) ; joue l'url



;str.s = OpenFileRequester("Choose a soundfile", "c:", "*.*|*.*", 0)
If str.s<>"" ; on charge le fichier
;FMOD_System_CreateStream(fmodsystem, @str, #FMOD_SOFTWARE, 0, @sound) ; creer le stream
;FMOD_Sound_GetLength(sound, @longueur, #FMOD_TIMEUNIT_MS) ; recupe la taille du son dans longueur
; FMOD_System_PlaySound(fmodsystem, 0, sound, 0, @channel) ; joue
EndIf

Repeat
Evenement.l= WaitWindowEvent(2)


FMOD_Channel_GetSpectrum(channel, Arr(), 512, 0, 0 ) ; recuperere les 512 niveaux des frequences
Oscillo(sound) ; le graph au centre ecran graphique


Select EventWindow()
;-evenement window


EndSelect

FlipBuffers()
ClearScreen(0)
Until Evenement = #PB_Event_CloseWindow

Procedure Oscillo(sound)
Static compteur.F,compteur2.F
compteur.F=compteur.F+1
compteur2.F=compteur2.F+10
largeur=290 :hauteur=50


If state=0 And play=1
For spr=1 To 512 Step 4
variation=25* Sin(compteur2*#PI/180)
sprite(spr)\x=spr
sprite(spr)\y= variation* Sin(spr*#PI/180)
DisplaySprite(spr,sprite(spr)\x+compteur.F,sprite(spr)\y)
sprite(spr)\y=50 ; remet le sprite en bas
If sprite(spr)\x+compteur.F>512
compteur.F=0
sprite(spr)\x=0
EndIf

Next spr

Else
For spr=1 To 512 Step 4
sprite(spr)\y=sprite(spr)\y-Arr(spr)*32*spr
DisplaySprite(spr,sprite(spr)\x,sprite(spr)\y)
sprite(spr)\y=50 ; remet le sprite en bas
Next spr
EndIf

EndProcedure


Title: Re: intros/demos sound Vumeter
Post by: waste on July 26, 2016
hi ars , thanks and hello (jmg49 on french pb board)

i used either fmodex and mp3d lib from inc. example , i will stay on mp3d with v2m support and EQ visualization

fmod doesn't play .v2m file format .... so .exe size is bigger 

it does the work,

thanks to all,

(http://i68.tinypic.com/29zczed.png)
Title: Re: intros/demos sound Vumeter
Post by: ~Ar-S~ on August 03, 2016
Please Add d3dx9_43.dll to your zip
Title: Re: intros/demos sound Vumeter
Post by: inc. on August 03, 2016
Just simple install directx9c. This Demos require DX9.
Title: Re: intros/demos sound Vumeter
Post by: waste on August 04, 2016

done !
Title: Re: intros/demos sound Vumeter
Post by: inc. on February 28, 2017
Just a quick Reply.

i found a sourcecode and some nice effects you may be interest for a VU Meter:
see attachment
Title: Re: intros/demos sound Vumeter
Post by: waste on February 28, 2017

line effect with reflection is great !

thanks

bass lib is used in this case, good for learning