Exporting loops and Session Data.xml hacking

edited October 2012 in General

Hi Michael, great product - I love it!

I want to have fun with my loops after I've created them, so I copy out the loop session in iTunes.

I can then do something like making a looptastic set from all the loops to play around with them. However, if the loop had an offset on the start, you can't just loop the aiff file because it isn't offset correctly.

Looking in Session Data.xml, I see 'loopStartTime'. What are the units of this? I'm thinking I can write a script to chop up the aiff file and re-write it so that it is compensating for the Loopy offset.

Out of curiosity, I see the 'scale' key is sometimes 1, but very often 1.0166666507720947. Why is this?!

All the best

Ed

Comments

  • Hey Ed,

    Hmm...Really? I swear I seem to remember that Loopy'll re-save the loop with the new offset applied when you adjust it. Are you certain that's not happening?

    The 'loopStartTime' units are in seconds, though. 'scale' is relative to the very first clock tempo, so if you change the tempo of a session then record a track, that track'll have a scale != 1.

  • edited October 2012

    Scale I get, thanks.

    loopStartTime I'm confused. If the units are seconds, then the values I have are longer than my sample lengths (perhaps possible if the dial was moved through more than 360 degress?). However, working backwards based on correcting the sample I have, I'd have put them at 1/100ths of a second.

    In my example, I have a kick loop that has a strong kick on the 1 and light kick on the 4.5th beat, so it is a distinctive waveform. I didn't record it this way - I rotated it to get it like this.

    So, my dial waveform has the strong kick on the 1 where I'd expect it. However the exported file has the strong kick around 831ms. The loopStartOffset is 83.1

    If I open an audio editor, and play the file, looped, starting at 831ms it sounds the same as playing in Loopy.

    Any ideas?

  • edited October 2012

    I ran this little script to split the tracks based on 100ths of a second:

    <br /> #! /usr/bin/perl</p> <pre><code> use XML::XPath; use XML::XPath::XMLParser; my $xp = XML::XPath->new(filename => 'Session Data.xml'); my $nodeset = $xp->find('//array/dict/key[text()="loopStartTime"]/following::real[last()]/text()'); my $trackNum = 0; foreach my $node ($nodeset->get_nodelist) { my $loopStartTime = XML::XPath::XMLParser::as_string($node); if ($loopStartTime ne '-1') { my $chopMarker = $loopStartTime/100; print `sox --clobber 'Media/Track $trackNum.aiff' out%1n.aiff trim 0 $chopMarker : newfile`; print `sox out2.aiff out1.aiff Track$trackNum.aiff`; } $trackNum++; }

    It worked for my drum track, but other tracks said that the offset was after the end of the file!

  • Hm, that's weird. I'll have a look again, see why it's not saving it with the offset adjusted.

  • Oh, it just occurs to me, the loop start time is in seconds, but it's relative to the master timeline, so it probably won't help you much... I don't have the spare brainpower right now to figure out how you can offset the tracks manually, but I consider it a bug that it's not doing so automatically, so I'll take a look.

  • Cheers Michael. Whilst you're there, check this:

    <br /> <dict><br /> <key>effects</key><br /> <dict/><br /> <key>loopStartTime</key><br /> <real>31.908138708607503</real><br /> <key>pan</key><br /> <real>0.0</real><br /> <key>scale</key><br /> <real>1</real><br /> <key>synchronize</key><br /> <true/><br /> <key>volume</key><br /> <real>1.0041245222091675</real><br /> </dict><br /> <dict><br /> <key>effects</key><br /> <dict/><br /> <key>loopStartTime</key><br /> <real>0.0</real><br /> <key>pan</key><br /> <real>0.0</real><br /> <key>scale</key><br /> <real>1</real><br /> <key>synchronize</key><br /> <false/><br /> <key>volume</key><br /> <real>1</real><br /> </dict><br />

    I recorded Track0 and didn't touch the offset, but I guess that makes sense if it's 31.9 seconds into the master timeline.

    I then did share track, audiocopy and import track into track1.

    The loopStartTime of the pasted track is 0 perhaps not surprising.

    BUT if you play the two loops simultaneously, they are out of sync by milliseconds. I would have expected audiocopy from one track/audiopaste to new track to result in two tracks that were perfectly in sync.

    Don't you love a good bug report ;)

    PS looking forward to AudioBus!

Sign In or Register to comment.