-
-
Notifications
You must be signed in to change notification settings - Fork 493
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bank parameter does not work for exporting music #2190
Comments
How are you defining currently active? |
According to the code, the function buffer = SAVE_CHUNK(CHUNK_PATTERNS, cart->banks[i].music.patterns, i);
buffer = SAVE_CHUNK(CHUNK_MUSIC, cart->banks[i].music.tracks, i); Where for(s32 i = 0; i < TIC_BANKS; i++) I can't see how this code could only save the current bank, except Are you absolutely sure you have valid music data in the other banks too, not just in one? Hope this helps, |
Here's an example cartridge so you can try it for yourself if I'm missing something here. Consider these commands:
If you run both the commands, they will export the same song, the one on bank 0 (because it's active by default). If you go to music editor, disable bank sync (the red ankh symbol), and change the active bank to 1, the song on bank 1 is exported instead. You can also choose to not disable bank sync: you will still get the song on bank 1 with both the commands, but it will be composed of noise, because the instrument on bank 1 is not defined. |
If it helps any: my investigations led me to the function studioExportMusic: it doesn't take the bank in as an argument, only the track. |
Ah I see, it's not when saving a cartridge, but when exporting a wav. That's a different code path.
Indeed. I can confirm that wav export uses the bank selector of the studio and not the cli argument (line 344). const Music* editor = studio->banks.music[studio->bank.index.music]; Cheers, |
Hmm, this looks simple enough that I could try my hand at fixing this myself. Let's see! |
...not as simple as i thought. I tried passing
instead of
makes no difference :( (I checked, the bank param does have the correct value of 0 or 1 inside the function.) |
okay i found a solution. i'll create a pull request when i have time! |
The
bank
parameter doesn't work for exporting music tracks. Regardless of its value, the music track with the id corresponding to theid
parameter from the currently active bank is exportedThus, it's not possible to export music from other banks when using TIC-80 from the command line.
The text was updated successfully, but these errors were encountered: