Author Topic: MP3 and MIDI tracks  (Read 78 times)

dilmar

  • Posts: 13
MP3 and MIDI tracks
« on: 16 Feb '21 - 23:01 »

hi, do you know how to enable and disable tracks in Bass and BassMidi? ???

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: MP3 and MIDI tracks
« Reply #1 on: 17 Feb '21 - 14:36 »
Please clarify what you mean by "enable and disable". If you mean muting, you can set a stream's BASS_ATTRIB_VOL value to 0 via BASS_ChannelSetAttribute for that. You can then set it back to 1.0 (or whatever level you want) to unmute.

Code: [Select]
BASS_ChannelSetAttribute(handle, BASS_ATTRIB_VOL, 0); // mute
...
BASS_ChannelSetAttribute(handle, BASS_ATTRIB_VOL, 1); // unmute

dilmar

  • Posts: 13
Re: MP3 and MIDI tracks
« Reply #2 on: 17 Feb '21 - 17:30 »
Hi Jan, by tracks I mean the instruments (flute, guitar, bass, .....)

Ian @ un4seen

  • Administrator
  • Posts: 23404
Re: MP3 and MIDI tracks
« Reply #3 on: 18 Feb '21 - 15:59 »
It isn't possible to mute individual instruments in MP3 files but you can mute them in MIDI files with the MIDI_EVENT_MIXLEVEL event. You would first need to know which MIDI channel the instrument is in, and then you can mute/unmute it like this:

Code: [Select]
BASS_MIDI_StreamEvent(handle, midichan, MIDI_EVENT_MIXLEVEL, 0); // mute
...
BASS_MIDI_StreamEvent(handle, midichan, MIDI_EVENT_MIXLEVEL, 100); // unmute

Please see the BASS_MIDI_StreamEvent documentation for details.

dilmar

  • Posts: 13
Re: MP3 and MIDI tracks
« Reply #4 on: 18 Feb '21 - 17:02 »
thank you Jan.   ;D