Author Topic: How can I visualize the song graphically?  (Read 119 times)

andrys

  • Posts: 3
Hello everybody.
How can I visualize the song graphically? For example:

http://www.nomobile.ru/pics/test/soundline.jpg

andrys

  • Posts: 3
Re: How can I visualize the song graphically?
« Reply #1 on: 7 Dec '17 - 07:56 »
I try to do this:

HSTREAM Channel=BASS_StreamCreateFile(FALSE,"file.wav", 0, 0, BASS_MUSIC_PRESCAN);
QWORD len = BASS_ChannelGetLength(Channel, BASS_POS_BYTE);
double MaxSecond=BASS_ChannelBytes2Seconds(Channel,len);
DWORD level;

 double sec;
 QWORD posByte;

 for(sec=0;sec<MaxSecond;sec++)
 {
    posByte=BASS_ChannelSeconds2Bytes(Channel,sec);
    if (!BASS_ChannelSetPosition(Channel,posByte,BASS_POS_BYTE)) break ;
    level=BASS_ChannelGetLevel(Channel);
  }

but 'level' shows an invalid value ....
The value is always:  65535U (0xFFFF)

Why ?

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: How can I visualize the song graphically?
« Reply #2 on: 7 Dec '17 - 15:44 »
Your example image looks quite similar to what the CUSTLOOP example (included in the BASS package) does, so you could have a look at that code for some ideas. Note it uses the more flexible BASS_ChannelGetLevelEx function rather than BASS_ChannelGetLevel.

andrys

  • Posts: 3
Re: How can I visualize the song graphically?
« Reply #3 on: 7 Dec '17 - 16:33 »
All examples show a graph during playback.
I need to show the graphics without playing the file.
For example: I select the file and it shows its spectrum on the track.
So the Sonar program works, Cubase .. When we put the file on the track, it is displayed in the form of a spektra.

Ian @ un4seen

  • Administrator
  • Posts: 20433
Re: How can I visualize the song graphically?
« Reply #4 on: 8 Dec '17 - 13:41 »
Although the graphic is shown during playback in the CUSTLOOP example, it is actually pre-generated separately on a "decoding channel". Please see the ScanPeaks function code.