Author Topic: intros/demos sound Vumeter  (Read 8949 times)

0 Members and 1 Guest are viewing this topic.

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
intros/demos sound Vumeter
« 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 

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #1 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
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline emook

  • C= 64
  • **
  • Posts: 90
  • Karma: 12
    • View Profile
Re: intros/demos sound Vumeter
« Reply #2 on: June 04, 2016 »
First all, what is the source of music? MP3? MODs? XMs? etc?

----

R Tape loading error, 0:1

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #3 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

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #4 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:
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #5 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
« Last Edit: June 22, 2016 by waste »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #6 on: June 22, 2016 »
hi,
the wave rendering to the music in real time works fine here.
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
« Last Edit: July 01, 2016 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #7 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 ....


Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #8 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
« Last Edit: June 29, 2016 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #9 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

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #10 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.
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #11 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  :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
« Last Edit: June 30, 2016 by waste »

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #12 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.
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #13 on: July 01, 2016 »
please check this binaray.
maybe this is what you like: Oscilloscope.exe
ESC for exit
« Last Edit: July 02, 2016 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #14 on: July 04, 2016 »
 :clap:

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

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #15 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.
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #16 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

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #17 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



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 ?
« Last Edit: July 05, 2016 by inc. »
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage

Offline waste

  • C= 64
  • **
  • Posts: 49
  • Karma: 2
    • View Profile
Re: intros/demos sound Vumeter
« Reply #18 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

Offline inc.

  • Contact me @ skype: a5recordings
  • Amiga 1200
  • ****
  • Posts: 268
  • Karma: 24
  • I SPEAK ENGLISH & GERMAN as good as i can :D
    • View Profile
Re: intros/demos sound Vumeter
« Reply #19 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
currently coding in PureBasic: GLSL Shader Maker & Editor Tool for further Demo coding usage