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.
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>
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)?
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?