Open undisbeliever opened 3 weeks ago
First feedback here will be with the inversion settings.
It looks like you have things set up in the inversion settings so that waveform cancelation doesn't become a problem in mono. I recommend adding an optional mono
word specification to the bytecode assembly that will allow the mono
flag to be set or not set according to the user's preference, and something similar in MML would also get involved (probably a lowercase m
). It can also be implied to be set if both sides are set.
I also recommend a sound driver setting that will allow left and right channels to be inverted separately (as in like mono/stereo/surround: surround allows all of them, stereo means no separate inversion settings for left/right (treat like mono when handling inversion) but allow panning, and mono also doesn't have panning) to prevent waveform cancelation issues. This would also apply to the echo volume, as that also supports negative values. The main volume (referring to the MVOL DSP registers) is in the same situation, but is never changed from $7F.
I recommend adding an optional
mono
word specification to the bytecode assembly that will allow themono
flag to be set or not set according to the user's preference, and something similar in MML would also get involved (probably a lowercasem
). It can also be implied to be set if both sides are set.
In this context are you talking about a command to set the channel inversion mono flag? or the global stereo/mono flag?
I also recommend a sound driver setting that will allow left and right channels to be inverted separately (as in like mono/stereo/surround: surround allows all of them, stereo means no separate inversion settings for left/right (treat like mono when handling inversion) but allow panning, and mono also doesn't have panning) to prevent waveform cancelation issues. This would also apply to the echo volume, as that also supports negative values. The main volume (referring to the MVOL DSP registers) is in the same situation, but is never changed from $7F.
A surround global flag sounds useful.
I'll need to code golf a way to efficiently detect sign changes in set_stereo_echo_volume
, but it shouldn't be too hard.
I recommend adding an optional
mono
word specification to the bytecode assembly that will allow themono
flag to be set or not set according to the user's preference, and something similar in MML would also get involved (probably a lowercasem
). It can also be implied to be set if both sides are set.In this context are you talking about a command to set the channel inversion mono flag? or the global stereo/mono flag?
I meant the m
bit in the invert
command, so the channel inversion mono flag that you specified.
Updated the syntax of the MML syntax of the invert instruction.
@KungFuFurby should the MML syntax for volume/pan slides use ticks or length? I'm leaning towards ticks as that matches the vibrato, tremolo, panbrello and early-release effects.
I've noticed that PMDMML has a q [l length]
syntax (ie ql16
is set_early_release 6
on a 96 ZenLen) and uses l length
on a few commands that have tick arguments. I could add that to the syntax, use ticks by default and optionally allow a volume slide for a given length (ie, vs+5,l4
).
What are your thoughts on the matter?
Sounds like a good call.
I think I understand most of the logic for the inversion syntaxes... except I'm leaning towards M
being an optional add-on to any of those since it would logically set the m
bit for the invert
command. It also makes for a nice match-up to the bytecode assembly syntax you defined up above.
Updated 22 November 2024
[ ] Tremolo
tremolo amplitude (1-255), quarter-wavelength-in-ticks (1-256)
v~<amplitude>,<quarter_wavelength_in_ticks>
V~<amplitude>,<quarter_wavelength_in_ticks>
channelSoA.volume
set_pan_and_volume
,adjust_volume
orset_volume
[ ] Volume slide
volume_slide_down
volume_slide_up
volume_slide rel (-255 to +255), ticks (1-256)
vs+<1..16>,<ticks>
vs-<1..16>,<ticks>
Vs+<1..255>,<ticks>
Vs-<1..255>,<ticks>
vs
andVs
will simplify the MML parser (asv
commands are swallowed bymerge_pan_or_volume()
)channelSoA.volume
set_pan_and_volume
,adjust_volume
orset_volume
[ ] Panbrello
panbrello
p~<1..128>,<ticks>
[ ] Pan Slide
pan_slide_down
pan_slide_up
ps+<1..128>,<ticks>
,ps-<1..128>,<ticks>
[ ] Invert
lr00000m
l
bit - invert left channel if surround moder
bit - invert right channel if surround modem
bit - invert channel if mono or stereo modeinvert <none|both|left|right|mono> [right] [mono]
I0
- disable inverted channelsI
- invert both channelsIM
- invert channel if mono or stereo mode (not surround)IL
- invert left channel if surroundIR
- invert right channel if surroundILR
- invert left and right channels if surround (not mono) - unsure on syntaxl
andr
bits are ignored in stereo mode