Envelopes: How does compatibility works from old to new ?


(Zenon) #1

I’m currently working for the making the new version of Xrn2xmod compatible with Renoise 3.0

I have noticed that the relation between old and new values is somewhat 1066.5% :

Indeed, comparing any old envelope field value (sustain, decay, a node point) I got these values:

[CompatibilityMode]

<envelopesustainpos>24</envelopesustainpos>  
<envelopeloopstart>72</envelopeloopstart>  
<envelopeloopend>120</envelopeloopend>  
...  
<envelopenodes><br>
  <playmode>Linear</playmode><br>
  <length>200</length><br>
  <valuequantum>0.0</valuequantum><br>
  <polarity>Bipolar</polarity><br>
  <points><br>
	<point>0,0.5</point><br>
	<point>48,1.0</point><br>
	<point>96,0.0</point><br>
	<point>199,0.391129047</point><br>
  </points><br>
</envelopenodes>  
  
[ModulationMode]  
  
<sustainpos>128</sustainpos>  
<loopstart>384</loopstart>  
<loopend>768</loopend>  
...  
<nodes><br>
  <playmode>Linear</playmode><br>
  <length>1066</length><br>
  <valuequantum>0.0</valuequantum><br>
  <polarity>Unipolar</polarity><br>
  <points><br>
	<point>0,1.0</point><br>
	<point>128,1.0</point><br>
	<point>256,0.400000006</point><br>
	<point>512,0.400000006</point><br>
	<point>1024,0.0</point><br>
  </points><br>
</nodes>  

Can you confirm that the delta value between the old and new format is 10.665 ?

Also, I have noticed a strange thing when doing the update of an old envelope:

The release value pass from 100 to 19. Is this a bug ?


(vV) #2

Those are not point values but positioning values on the time scale and the time-base model has been synchronized to beats rather than ticks in the old system, this indeed means that positioning is scaled differently when converted.


(Zenon) #3

Ok Vv I see, then my question is:
how the conversion works from the old to new system?
it’s something complicated (meant this is not a good place to discuss about)
or works in the way I wrote above?
also: is the release value converted wrong?


(vV) #4

The old resolution was ticks. Now it is milliseconds. But if you upgrade, the new values will be represented in beats.
1 beat is 256 ticks.
The conversion is done roughly based on the time the current envelope takes. If you change the amount of ticks, the envelopes are also in compatibility mode being automatically transitioned to match the timing as it was

The release indeed seems to be fixed to an average 8 tick conversion which seems incorrect in cases the speed is different from 8 ticks but i’ll rather have one of the devs have a look at/explain that.
(also changing the tick amount in the playback and compatibility settings affects the release in compatibility mode which it shouldn’t)