New Tool (2.7) Additional File Formats Tool

Fantastic work, had a big pile of rex’s sitting here that I hope to put to good use now. I’ve tried some, but I do seem to get some weird pulse wave at the end of each slice, about 20-21 samples long… here’s an example rex

*edit - I know it’s a bit more niche, but I’d love to be able to load my old yamaha A3000 patches. I’m sure you just want a break now but if there’s anything I can do to help, give me a holler :)

Thumbs up for the SFZ import!
I do have the idea that it somehow translate certain regions incorrect (i notice overlaps where regions really didn’t overlapped).
Could that somehow be related to a Hex to decimal confusion?

If you find bug fixing boring here is another idea for the 256 sample slot limitation (i already experienced i had to fumble with SFZ libraries to kick out loads of velocity layers in order to be able to import it):
expand the routine to allow someone to import a library to multiple instruments (import each key (all velocity ranges) to a separate instrument).
This has a few advantages:not only all samples are loaded, after the import: each instrument can then be more easily dedicated to a track and with linking through the midi in option, that allows for nice track dedicated drumkit solutions.
If you want a big fat SFZ kit to play around with i can offer you a download to it.

Tested out 1.1, it’s working perfectly on my akp library! You are amazing.

vV, I agree - the inclusion of the SFZ import format is very cool!

Slightly off-topic, do you know of any batch converters that will convert SF2 to SFZ so I can import them natively to Renoise?

Awesome tool, but the SFZ importer doesn’t seem to be able to handle spaces in sample file names. :unsure:

Would it be possible to read .ASD files and extract transients out of that to an instrument map drumkit? :)

Known issue, I’m still working on this. Have to manually work around this at the moment. Sorry!

If any other tool coders can think of a simple way around this please reply to this thread.

To coders: SFZ import is in file ‘instruments/rgc-sfz.lua’. The file is read and the parse table is created on lines 80 to 107. I have to split on spaces to handle the other parameters. I try to work around this for samples on lines 118-121.

Well, anythings possible! I’ve had a look but they seem encrypted or compressed from first looks. Currently a low priority.

Sometimes the solution is pretty easy. Not really neat, but it works.

  
for line in io.lines(filename) do  
 -- strip comments to end of line  
 if line:find("//") then  
 line = line:sub(1, line:find("//")-1)  
 end  
  
 -- remove redundant CR on unix systems  
 local cr_replaced = 0  
 line, cr_replaced = line:gsub(string.char(13), "")  
  
 if line:find("sample=") then  
 for word in line:gmatch("([^%z=]+)") do  
 -- insert in parse table  
 table.insert(parse_table, word)  
 end  
 else  
 for word in line:gmatch("([^%z =]+)") do  
 -- insert in parse table  
 table.insert(parse_table, word)  
 end  
  
 end  
  
end  
  
  

mxb; I have found and patched a bug in the sfz importer. I’m not sure how to relay this information to you so you can include it.

Within the sfz v2 spec there is a

default_path=

My patch simply finds the default_path and uses it as a base.

Also the current code doesn’t work with spaces in filenames. I patched that as well so it does work with them.

I would like to give you this patch so you can include it, and I’m sure you have a better way to do what I did elegantly than my hacker approach :)

thanks for the Tool!

Here is my hack/patch on line 119 in that file. It’s not perfect, we should search for line ending instead but i couldn’t get sample:gmatch(“$”) to work, and neither did find(“\r\n”) etc.:

  
elseif parse_table[t] == "sample" then  
 local i=1  
 while   
 sample:find(".wav") == nil   
 and sample:find(".aif") == nil   
 and sample:find(".flac") == nil   
 do  
 sample = sample .. parse_table[t+i] .. " "  
 i=i+1  
 end  
 sample = sample:sub(1,-2) --remove " " from end  
  

Also we should add an intelligent detection of if there is only 1 sample found, map it for the entire keyboard. It’s right now only mapping the lowest octave, I think inheriting your local defaults.

Done this sample snippet for Rick first, but thought it may help showing how to properly split a line for parsing SFZ. Insert into TestPad.lua and run it.


-- extra chars = and . inserted to show proper matching  
local line = "\t<region>= sample=303 Bass.Long.wav "<br>
print("Input: " .. line)<br>
<br>
-- trim trailing and ending whitespace chars, %s is a pattern matching group and<br>
-- also gets rid of any tabs<br>
line = line:gsub("^%s*(.-)%s*$", "%1") <br>
print("Trim: " .. line)<br>
<br>
-- get filename starting from last = char till end of line<br>
local sample = line:match("([^=]+)$")<br>
print("Sample: " .. sample)<br>
<br>
-- get extension starting from last . char till end of line, a filename can have<br>
-- multiple . chars<br>
local extension = sample:match("([^.]+)$")<br>
print("Extension: " .. extension)<br>
<br>
-- properly check an extension at end of line<br>
if extension == "wav" then<br>
  print(".wav found")<br>
elseif extension == "aif" then<br>
  print(".aif found")<br>
elseif extension == "aiff" then<br>
  print(".aiff found")<br>
elseif extension == "flac" then<br>
  print(".flac found")<br>
end<br>
<br>```

<br>
</region>

So, let me get this: does it load only rex or rx2 too?

rex v1 only not rx2 but you can convert rex2 to wav using reaper batch tool. i processed over 12,000 rex files last night this way and it went perfect.

[quote=“Beatslaughter, post:50, topic:32438”]
Done this sample snippet for Rick first, but thought it may help showing how to properly split a line for parsing SFZ. Insert into TestPad.lua and run it.


-- extra chars = and . inserted to show proper matching  
local line = "\t<region>= sample=303 Bass.Long.wav "<br>
print("Input: " .. line)<br>
<br>
-- trim trailing and ending whitespace chars, %s is a pattern matching group and<br>
-- also gets rid of any tabs<br>
line = line:gsub("^%s*(.-)%s*$", "%1") <br>
print("Trim: " .. line)<br>
<br>
-- get filename starting from last = char till end of line<br>
local sample = line:match("([^=]+)$")<br>
print("Sample: " .. sample)<br>
<br>
-- get extension starting from last . char till end of line, a filename can have<br>
-- multiple . chars<br>
local extension = sample:match("([^.]+)$")<br>
print("Extension: " .. extension)<br>
<br>
-- properly check an extension at end of line<br>
if extension == "wav" then<br>
  print(".wav found")<br>
elseif extension == "aif" then<br>
  print(".aif found")<br>
elseif extension == "aiff" then<br>
  print(".aiff found")<br>
elseif extension == "flac" then<br>
  print(".flac found")<br>
end<br>
<br>```

<br>[/quote]<br>
<br>
Thanks man. Where do I find docs on this lua stuff? Specifically I cannot locate docs on :find when I tried...</region>

Great, great tool! It seems to have some problems locating Logic/Garageband EXS instrument samples though, and some EXS files it doesn’t read. Is there something to be done here? Also can loop points be read from those files (or are they encoded in samples)?

What a lovely tool.

akp’s come with finetune settings for each sample, right? Would be great if the finetuning was imported too.

Is this ever going to get an update? Or would it be too much work now the xrni’s got such a big update?

I don’t use this much, but when I want to convert some instruments it comes in real handy.

Really missing this tool. :confused:

Really missing this tool. :confused:

Yeah, that’s the big downside of the tools. I mean, in the beginning I was quite enthusiastic, the idea was great to extend Renoise with user-written tools. However, I soon realized that the API changes substantially with every update, and backwards compatibility is not of high importance. The result is simply that the set of available tools changes all the time. Some of the best tools are not available for the newest version of Renoise, because developers don’t feel like releasing new versions of their tools every year. And I can understand them. In some cases the work to update the tool is just too much. This is probably also why we don’t see “big” tools anymore lately, because why would you put an essential amount of work into a tool, which won’t work anymore in a year, unless you put another essential amount of work into it again?

I’m not sure if any of these formats are actually built into V3. I can see and load a Roland MV0 as an instrument but

it’s just one long audio file with the data block at the beginning and a sequence of individual audio segments.

some strange noise issues are present but, that might be because I loaded a whole project file and maybe

should try loading an individual patch file. have to test that more. may also re install V2.8 to try.

given the new standalone sampler plug-in is on the cards, it might be a good idea to have the reading

of various formats working as well as possible. the ability to do that could be in the main Renoise app itself

as doing it on the plug-in could cause too many tiresome troubleshooting days. but that’s not a bad thing

because people will then be directed to the main application to do the actual translating work. either way

it would be a draw to have a creditable format support.

I just did a bunch of tests on a Roland MV0. I eventually saved out a patch.

there is a high level of underlying noise throughout the Audio sections.

I tested this on Renoise 2.8. Renoise 3 imports as well, but I think 2.8

with this script could separate out the individual samples into an instrument.

the digital noise could be data which is part of a capability to time stretch in the Roland MV unit.

when they are saved as WAV to disk then transferred over USB, they seem to be fine.