Author Topic: Implementing a vu-meter for each channel of a module with BASS  (Read 272 times)

friol

  • Guest
Hello.
I'd like to implement a vu-meter kind of visualization tracking each note or the volume of each mod channel with BASS, but there doesn't seem to be such an option.
Say, if I'm playing an .xm with 16 channels, I'd like to show a vu-meter for each of the 16 channels.
I'm using the C++ library on Windows.
Thanks

Ian @ un4seen

  • Administrator
  • Posts: 25275
You can get the overall level from BASS_ChannelGetLevel(Ex) but unfortunately there isn't currently the option of getting the level of individual channels within a module. One way you could do it is to have multiple instances of the module (multiple BASS_MusicLoad calls), each with all but one of the channels muted (via BASS_ATTRIB_MUSIC_VOL_CHAN settings) and then use BASS_ChannelGetLevel(Ex) on them, but that's obviously not optimal.

If just knowing when notes are played in each channel would suffice then it may be possible to add a new sync type for that. Another way you can achieve that already now is to parse the module (eg. using code from libopenmpt or similar) and then check the parsed pattern data for notes at BASS's current position (you can set a BASS_SYNC_MUSICPOS sync with param=-1 to be notified via callback when the position changes).