AGSC (File Format): Difference between revisions

imported>Jackoalan
No edit summary
imported>Jackoalan
Line 833: Line 833:
|-
|-
| 0x8
| 0x8
| colspan=2 {{unknown|End of entry}}
| colspan=2 {{unknown|End of ADSR}}
|}
 
===== DLS ADSR =====
 
MusyX can also express more advanced envelopes using a modified [[wikipedia:DLS format|DLS]] representation.
This representation includes scaling coefficients to respond to played note and velocity
(so slamming down a key harder plays longer).
 
The attack and decay members are expressed in ''time-cents''. This may be converted to seconds using:
<code>2<sup>timecents / (1200.0 * 65536.0)</sup></code>
 
The attack and decay scale members are expressed as 0.1% increments in 16.16 fixed-point.
This may be converted to a normalized factor using:
<code>scale / (1000.0 * 65536.0)</code>
 
{| class="wikitable"
! Offset
! Size
! Description
|-
| 0x0
| 4
| '''Attack time'''; in time-cents
|-
| 0x4
| 4
| '''Decay time'''; in time-cents
|-
| 0x8
| 2
| '''Sustain'''; percentage mapped between [0x0,0x1000]
|-
| 0xA
| 2
| '''Release'''; in milliseconds
|-
| 0xC
| 4
| '''Velocity to Attack Scale'''; 0.1% increments as 16.16 fixed-point
|-
| 0x10
| 4
| '''Key to Decay Scale'''; 0.1% increments as 16.16 fixed-point
|-
| 0x14
| colspan=2 {{unknown|End of DLS ADSR}}
|}
|}


Anonymous user