Page 1 of 1

[Lua] WAV loop sampler for N163

Posted: Thu Oct 29, 2015 6:36 pm
by HertzDevil
A Lua script that converts looped WAV files into N163 FTI instruments. You provide the loop point and oscillation count of the WAV sample; the script does the rest of the job, and produces a normalized FTI that would cycle through the N163 waves at the proper rate if played at the speed that matches the original sample rate. Invoking the script with no arguments displays the script information. Requires Lua 5.3. Licensed under the MIT License.

Since the instrument's wave sequence does not vary with frequency, a single sample might only give satisfactory results for frequencies about an octave within the source frequency provided by the original sample rate. This applies mostly to samples containing regions, such as those from Soundfont files; convert each at its designated sample rate by either creating an external batch script or modifying calls to generatewaves().

In case new forum users do not know, I have used this script personally for various covers. I mentioned there will be sample frequency detection, but eventually discarded that because using the sample's loop point is a lot more reliable.

The script does not support stereo samples. There is no plan to, as it is extremely unlikely for one who knows how to obtain the loop point and oscillation count from a WAV file in an audio editor to not know how to downmix the file to mono in the same editor anyway. Support for non-looping WAV samples might be added in a later time; these are possible, but are fixed at a single playback frequency, and require very specific conditions to even play properly.

Re: [Lua] WAV loop sampler for N163

Posted: Thu Oct 29, 2015 8:39 pm
by iYamWhatIYam
This is fantastic. Although I'm not overly familiar with N163, it can produce some very rich, deep sound, right? If so, I may create some cool SNES sample-like instruments.

Thanks for this tool.

Re: [Lua] WAV loop sampler for N163

Posted: Thu Oct 29, 2015 9:13 pm
by MiniMacro
I cannot figure out how to use this.
But it's still cool!

Re: [Lua] WAV loop sampler for N163

Posted: Tue Aug 16, 2016 12:24 am
by beachbum811
It's not coming out right.
This is the .wav sample:
The site won't let me upload .wav's, change back the extention after downloading.
(30.59 KiB) Downloaded 190 times

This is what I typed into cmd:
lua wavegen.lua wave.wav 16 10 16
This is the resulting fti:
I put it in an ftm for simplicity
(1.07 KiB) Downloaded 304 times

What am I doing wrong?

Re: [Lua] WAV loop sampler for N163

Posted: Sun Nov 19, 2017 4:52 pm
by maymonadir
I don't know how to use that