Author Topic: MOD data modification.  (Read 178 times)

AndyMK

  • Posts: 212
MOD data modification.
« on: 10 Oct '24 - 12:09 »
Hi, is it possible to modify loaded MOD data? I see that once a MOD is loaded via mem=true, we can safely discard it. Would be nice to get a pointer to the MOD contents so that we can tinker with it and possibly make changes to a song without writing a MOD editor like i am doing at the moment. If the loaded MOD contents remains in the same format as it was loaded, this would be easy to do. Something like BASS_MusicPointer().

Ian @ un4seen

  • Administrator
  • Posts: 26230
Re: MOD data modification.
« Reply #1 on: 10 Oct '24 - 17:02 »
Unfortunately, it isn't possible to access/modify the pattern data (it's no longer in the same format as in the file). But it is possible to change the playback order of the patterns via the BASS_TAG_MUSIC_ORDERS "tag". That gives a pointer to the order list, which you can change. You can get the length of the list (number of orders) from BASS_ChannelGetLength.

If you want to make more elaborate changes, perhaps you could keep a copy of the file in memory for that, and pass it to BASS_MusicLoad again after changes?