TIC-80
TIC-80 copied to clipboard
Add `sustain=true|false` argument to export music command
Feature request: add a sustain
boolean flag to the export music
command, which is passed to the API music() sustain argument.
Current behaviour is that the sustain setting is taken from the editor: https://github.com/nesbox/TIC-80/blob/main/src/studio/studio.c#L357
This is opaque as the sustain button is small and can be easily missed, and it is not obvious that the export function will use this setting. Therefore I suggest adding the sustain flag to the export music command, and when it is omitted it will fall back to existing behaviour, which is using the editor sustain setting.
Q: why not add all the other music() arguments? A: the other arguments are: frame, row, loop, tempo, speed. For frame/row, there is a simple workaround: edit the output file. For loop, I can see the usefulness of specifying number of loops, but again there is a simple workaround: copy/paste the output. For tempo/speed, they are highly visible in the editor so I don't see the need to also add them to export music.
It would also be good if this info was added to the wiki https://github.com/nesbox/TIC-80/wiki/export although in its current structure I'm not sure what's the best way to add it. Perhaps if we format the page into a table and add a Notes column, we can add the sustain information there for the export music row.
I added this to the wiki https://github.com/nesbox/TIC-80/wiki/export#export-music
I preferred to add a section about it and a link to this section in the music
parameter line, but feel free to change it if you want.
Mmh… what I wrote to the wiki is about the sustain setting, but if I understand well that's true for all other settings, right ? I'll write something more general if you confirm.
the other settings are different; tempo and speed are saved as part of the music, but sustain is only from the editor, or the music() API call
Ok, thanks!