You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Allow envelopes with delay values of 0 on init (#625)
This allows sounds to start instantly without any fade-in. Using new soundbanks with delay values of 0 will not compile with base decomp, but old decomp-compliant soundbanks will work with this commit.
This commit is contained in:
@@ -684,7 +684,7 @@
|
||||
// envelope commands
|
||||
|
||||
.macro envelope_disable a
|
||||
.byte 0x0, 0x0
|
||||
.byte 0xff, 0xfc
|
||||
.byte \a >> 8, \a & 0xff
|
||||
.endm
|
||||
|
||||
|
||||
@@ -428,8 +428,9 @@ s32 adsr_update(struct Note *note) {
|
||||
adsr->target = adsr->target * adsr->target;
|
||||
adsr->velocity = (adsr->target - adsr->current) / adsr->delay;
|
||||
#else // !(VERSION_EU || VERSION_SH)
|
||||
if (isInit && adsr->delay <= 1) {
|
||||
note->initFullVelocity = TRUE;
|
||||
if (adsr->delay <= 0) {
|
||||
adsr->delay = 1;
|
||||
note->initFullVelocity = isInit;
|
||||
}
|
||||
|
||||
adsr->target = BSWAP16(adsr->envelope[adsr->envIndex].arg);
|
||||
|
||||
@@ -26,10 +26,10 @@ enum ADSRActions {
|
||||
};
|
||||
|
||||
enum ADSRDelays {
|
||||
ADSR_DISABLE = 0,
|
||||
ADSR_HANG = -1,
|
||||
ADSR_GOTO = -2,
|
||||
ADSR_RESTART = -3,
|
||||
ADSR_DISABLE = -4,
|
||||
};
|
||||
|
||||
enum VibratoModes {
|
||||
|
||||
@@ -341,10 +341,10 @@ def validate_bank(json, sample_bank):
|
||||
last_fine = True
|
||||
else:
|
||||
validate_int_in_range(
|
||||
entry[0], 1, 2 ** 16 - 4, "envelope entry's first part"
|
||||
entry[0], 0, 2 ** 15 - 1, "envelope entry's first part"
|
||||
)
|
||||
validate_int_in_range(
|
||||
entry[1], 0, 2 ** 16 - 1, "envelope entry's second part"
|
||||
entry[1], 0, 2 ** 15 - 1, "envelope entry's second part"
|
||||
)
|
||||
last_fine = False
|
||||
validate(
|
||||
@@ -589,7 +589,7 @@ def serialize_ctl(bank, base_ser, is_shindou):
|
||||
env_name_to_addr[name] = ser.size
|
||||
for entry in env:
|
||||
if entry == "stop":
|
||||
entry = [0, 0]
|
||||
entry = [2 ** 16 - 4, 0]
|
||||
elif entry == "hang":
|
||||
entry = [2 ** 16 - 1, 0]
|
||||
elif entry == "restart":
|
||||
|
||||
Reference in New Issue
Block a user