So what I would do is use a loop with this sub procedure using the last char position as the new start char position on each loop to look for the next audio clip, the next MAudioEvent, and do it again until all the events are captured. 'test the full qualified filename string on a label 'Move the char position to the first char of the clip pathįilePath = FilePath & Mid(Archive.Text, ClipName + X, 1)įilePath = Left(FilePath, Len(FilePath) - 2) 'shorten the string by two chars to remove the "/ at the endįileName = Left(FileName, Len(FileName) - 2) ![]() 'Move the char position to the first char of the clip nameĭo 'read until the string name tag is closed with the "/" charįileName = FileName & Mid(Archive.Text, ClipName + X, 1) 'read the clip length numbers into a stringĬlipLen = ClipLen & Mid(Archive.Text, Length + X, 1)ĬlipLen = Left(ClipLen, Len(ClipLen) - 2) ' Remove the "/ĬlipName = InStr(EventX, Archive.Text, "FNPath") 'find the filename path tag for this eventĬlipName = InStr(ClipName, Archive.Text, "Name") Length = Length + 15 'should be the char position of the first value number StartLoc = Left(StartLoc, Len(StartLoc) - 2) StartLoc = StartLoc & Mid(Archive.Text, Start + X, 1) 'read the start position numbers into a string Start = Start + 14 'should be the char position of the first value number 'for the letters up to the actual values. 'The start and lenght tag positions have to be incremented to account Length = InStr(EventX, Archive.Text, "Length") ' find the Length tag Start = InStr(EventX, Archive.Text, "Start") ' find the start tag Since it's all text and you can ignore the tags you don't need it's pretty easy to do.ĭim EventX As Integer, Start As Integer, Length As Integer, ClipName As Integerĭim FileName As String, FilePath As String, StartLoc As String, ClipLen As StringĮventX = InStr(1, Archive.Text, "MAudioEvent") 'find the first audio clip Once you have those values you can (hopefully) import the files into Reaper on new tracks at the proper positions. File name, File path, combined the two to make a fully qualified filename path, start position and clip length which is in samples. I loaded the XML into a text box in VB and read it from there. ![]() Here's the code in VB which is commented to explain what I did which is parse the first character positions of the tags and then using those as references, extract the values of the tags to display into VB labels so I could verify they're being extracted correctly. Ok, I was able to parse the first audio clip in about 15 minutes in VB code to extract the filename and location, the start time and the clip length.įeel free to do this in a C extension and let me test it. If I were parsing this with VB I'd use the VB InStr(entire_file, "MAudioEvent") to get the char location of that main tag and then sequentially parse the other tags from that character location to get the start time, length and construct the file location from those other two tags. If anyone wants to take this on I will feed you the paramater tags. If you guys can pull this off it would be GREAT. One step at a time starting with just placing the audio at the correct position?Ĭan you parse the following events from an XML from an extension? You can ignore most tags and just focus on the ones needed for a proper basic file import to start with, start time, length of the audio parts and the location of the audio file. If you guys can figure out how to import Steinberg Track Archives it would bring TONS of potential users over. Import Nuendo / Cubase track archives (preliminary) ![]() If extension devs can parse one thing at a time and work on importing projects into Reaper this way it would be a HUGE item on the feature list. ) The track archives are like a proprietary OMF.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |