nullsound: new tool to convert Furnace modules into NSS streams
nsstool.py is the tool that convert Furnace modules into a
precompiled and optimized NSS bytestream that can be played back
at runtime by nullsound.
nsstool.py relies on furtool.py to provide the necessary data
for instruments and samples.
This commit provides the necessary convertion passes to play
the FM, SSG and ADPCM notes from a Furnace module, with their
associated instrument definition.
Other commits should follow to support more Furnace features
(note volumes, more effects...)
nullsound: new NSS opcodes for SSG channels support
NSS playback now supports using SSG channels.
The sound produced for SSG notes is configured from an
instrument macro.
SSG macros define changes of SSG settings (e.g. volume) over
time, each change happening on a playback tick period.
This commit provides initial support for SSG: macro, note on,
note off.
nullsound: Do not use ar for packing nullsound files
the nullsound library is a collection of files packaged into an
ar archive to ease linking of music ROMs.
However it looks like passing the library as a linker input as if
it was a simple .rel object is not supported by SDCC, and it can
break sdld parsing. This is now happening on the MSYS2 environment.
In order to keep nullsound as a standalone file and fix sdld linking,
make nullsound.lib a simple concatenation of all .rel objects. This
is correctly parsed by sdld, on all environments (Linux, macOS, MSYS2).
nullsound: fix YM2610 reset before stream playback
FM channels can't be stopped immediately, as their operators can
only be configured to release their note.
Implement the reset by configuring the fastest release possible
and stopping the operator in sequence. This is sufficient to
remove any unpleasant "pop" sound that was appearing while
stopping a NSS stream and playing another one immediately.
Also update the snd_stream_stop to call ym2610_reset so that
all channels are effectively stopped when this function is called.
Currently ADPCM-A and FM opcodes (instrument, note on...) are
two bytes long and they include the action's target channel.
Optimize the space used by defining a 10 new CTX opcodes.
A CTX is a 1 byte opcode that defines the scope of the next
ADPCM-A or FM action.
ADPCM-A and FM have their own context of action. Each time
a ADPCM-A or FM opcode is evaluated, the according context
is incremented by 1, so that the scope of the next opcode
will automatically be the next ADPCM-A or FM channel.
This approach allows efficient NSS stream storage in ROM, and
will be reused when implementing the next NSS opcodes
like e.g. volume, detune...
The original ADPCM-A and FM opcodes are now deprecated and
will be replaced eventually.
vromtool.py automatically packs ADPCM samples into one or more
VROMs, and generates ASM defines to export the samples positions
in VROM to the z80 sound driver.
furtool.py extracts the FM and ADPCM instruments define in a
of a Furnace module, and generate instrument data ready to be
consumed by nullsound NSS stream player. It also extract the
ADPCM samples from the Furnace module in a sample map that
can be consumed by vromtool.py to generate VROMs.