LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

MML ADSR Envelope defaults

Root / General / [.]

glennxsergeCreated:
Looking at the documentation for MML, the ADSR Envelope has very limited controls, you can set it with @E127,100,30,100 and reset it with @ER, but there is no indication of what the defaults values are. Does anyone know if each instrument has a different default value? Or how I could determine the values? I'm working on an editor that let's you adjust this as a curve, but I'd like the default values to be represented properly so if it's unset, you could still see the values in the curve. If that makes sense.

By default, the MML playback envelope I believe is 127,127,127,127. Each instrument has its own ADSR envelope as well but you can't change it after it's set. The MML playback envelope affects the playback of every note the same, regardless of the instrument's own envelope. Basically don't worry about per-instrument envelopes, you can't do anything about them and they don't really matter.

Are you sure about those defaults? They would produce an essentially, unending note

I think the arguments for decay/release time are upside-down. 127 is shortest and 0 is longest. You should probably check though, it's been a while.

Yeah, the docs don't really specify what metric of time those represent either.... frames maybe? And since sustain is the resting volume of a held note, I guess 127 being full volume makes sense. It must be that 127 is the minimum length of time for ADR, but the maximum volume for S. Sort of confusing, but I guess it makes sense. I guess I should represent those inversely in my curve. I'll test this with the standard piano sample and see if your suggested default values match the reset ASDR envelope. Thanks, slackerSnail.

By default, the MML playback envelope I believe is 127,127,127,127. Each instrument has its own ADSR envelope as well but you can't change it after it's set. The MML playback envelope affects the playback of every note the same, regardless of the instrument's own envelope. Basically don't worry about per-instrument envelopes, you can't do anything about them and they don't really matter.
Ah, I understand the distinction now. Thanks slacker snail. I tried setting it to 127,127,127,127 and that definitely is not the default. I would venture a guess that the local channel ADSR isn't used at all unless explicitly set, and resetting it via @ER is basically disabling it in favor of the intrument's envelope. If only I could query what the value of the instrument in the channel was. Kind of a frustrating design decision.