Line Time Calculation

I’m currently writing a tool to calculate the lengths of XRNS songs in any given path…

I’ve noticed some differences between versions, specifically in regards to which versions use speed.

I was wondering doc_versions and PlaybackEngineVersions use speed, and which ones use LPB. Is there a chart somewhere I can refer to? :P

I wouldn’t mind getting a response on this soon so I can finish off this tool and upload it for everyone to use ;)

<3

If you look into your Renoise folder, you’ll find a folder schemes with the needed info. The appended number is the doc version.

Old behaviour:

RenoiseSong4.xsd
RenoiseSong9.xsd
RenoiseSong10.xsd

<element name="BeatsPerMin" type="xs:int" default="135" minoccurs="0"></element>  
<element name="TicksPerLine" type="xs:int" default="6" minoccurs="0"></element>  

Default BPM value is different in these, but this can be ignored.

New behaviour:

RenoiseSong14.xsd

<element name="BeatsPerMin" type="xs:float" default="128" minoccurs="0"></element>  
<element name="LinesPerBeat" type="xs:int" default="4" minoccurs="0"></element>  
<element name="TicksPerLine" type="xs:int" default="12" minoccurs="0"></element>  

Thank you BeatSlaughter! :D

Ok… those schemas still dont’ answer my questions about PlaybackEngineVersions … The PlaybackEngineVersion doesn’t seem to refer to the XML document versions… as PlaybackEngineVersion of 4 is what gets saved in a new song in 2.0 … PlaybackEngineVersion of 1 obviously still uses Speed … I have no idea what 2 and 3 do. Perhaps I should just save a blank song and edit that node to see. I guess I’ll just do that for now ;)

PlaybackEngineVersion >= 3: LPB & TPL

This is only changed for old songs when you “upgrade” them in the song settings pane, so old songs saved with new document versions still behave and play back “old”.

Engine Version: Renoise Version which the songs where started on:
0: <= 1.8.0 (sample FX effect command changes)
1: <= 1.9.1 (instrument envelopes sustain behavior changed)
2: <= 2.0.0 “Speed” got replaced by LPB and TPL
3: <= 2.0.0 (sample FX effect command changes)
4: current

Thanks Taktik :)

<?xml version="1.0" encoding="UTF-8"?> 70 12 true

… for some reason this document gives speed of 3 … is this right? Is it because of the TPL? Should I be converting TPL to Speed somehow?

… I should point out that there’s a F103 code 3 patterns in… will this affect the start of the song?

As said above: you just have to look at the “PlaybackEngineVersion”. If it doesnt exist, then assume PlaybackEngineVersion = 1 which → Speed.

And yes, as soon as TPL/Speed is automated you can not rely on the TicksPerLine entry in the global song data, as the automation will override it. Parsing automation (following) is very tricky though if you want it to be 100% correct. You also have to parse pattern stop / delay & BPM automation then…

I’m already parsing F1 and F0 effects… wasn’t even aware there was pattern stop/delay effects :P does some reesurch

So even if the automation exists in the 3rd pattern, it will affect the speed in the first pattern? It’s really no problem for me to compensate for this, I just need to know to be sure :P

Seems I’ll also have to parse pattern breaks ;)

Also, will song groove affect my song time calculation? If so, I’ve gotta figure out how :s

When there is no automation for a parameter in the current pattern:

  • when there is a automation for this parameter in a previous pattern, apply the last automation value of the previous pattern
  • else when there is a automation for this parameter in a following pattern, apply the first automation value of the following pattern
  • else use the documents “default value”

This way we are creating a “continues” automation over the whole sequence.

For global automations like tempo/LPB, the right most one is selected in case there are multiple ones one the same line.