[Lua] WAV loop sampler for N163 - FamiTracker

# FamiTracker

FamiTracker Support Forums

Skip to content

## [Lua] WAV loop sampler for N163

General discussion about tracking, help and support.
Post Reply

- Print view

5 posts • Page 1 of 1

HertzDevil
  Posts: 475
  Joined: Thu Apr 23, 2015 7:39 pm
  Location: Hong Kong SAR
  Contact:
  Contact HertzDevil
  Website Facebook Twitter Skype
  YouTube

### [Lua] WAV loop sampler for N163

- Quote

Post by HertzDevil » Thu Oct 29, 2015 6:36 pm

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.

Attachments
  wavegen.txt
    file extension renamed to .TXT because the forum does not allow .LUA (in fact you might call ">lua wavegen.txt ..." directly instead of renaming it)
    (5.13 KiB) Downloaded 1064 times

refactoring 0cc-famitracker
Top

iYamWhatIYam
  Posts: 432
  Joined: Wed Jul 08, 2015 8:19 pm
  Location: Fort Wayne, IN

### Re: [Lua] WAV loop sampler for N163

- Quote

Post by iYamWhatIYam » Thu Oct 29, 2015 8:39 pm

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.
i am the minestrone bottom | roxanne | she/they, 22
Top

MiniMacro
  Posts: 933
  Joined: Mon Apr 20, 2015 8:47 pm
  Location: Trapped in a 2A03

### Re: [Lua] WAV loop sampler for N163

- Quote

Post by MiniMacro » Thu Oct 29, 2015 9:13 pm

I cannot figure out how to use this.
But it's still cool!
wow this is total BS
mmsound.bandcamp.com
you can see my beautiful music there~
Top

beachbum811
  Posts: 104
  Joined: Thu Jul 28, 2016 2:19 pm

### Re: [Lua] WAV loop sampler for N163

- Quote

Post by beachbum811 » Tue Aug 16, 2016 12:24 am

It's not coming out right.
This is the .wav sample:

wave.txt
  The site won't let me upload .wav's, change back the extention after downloading.
  (30.59 KiB) Downloaded 393 times

This is what I typed into cmd:
lua wavegen.lua wave.wav 16 10 16
This is the resulting fti:

wut.ftm
  I put it in an ftm for simplicity
  (1.07 KiB) Downloaded 537 times

What am I doing wrong?
Hello World!
Behold as I run facefirst into the endless abyss of hate that is the internet!
I do Musescore and Scratch with the same username!
OH and I also use beta 0.5 so...
Top

maymonadir
  Posts: 3
  Joined: Sun Nov 19, 2017 2:05 pm

### Re: [Lua] WAV loop sampler for N163

- Quote

Post by maymonadir » Sun Nov 19, 2017 4:52 pm

I don't know how to use that
Top

Display posts from previous:
Sort by

Post Reply

- Print view

5 posts • Page 1 of 1

Return to “General Talk”

Jump to

- Rules
- Wiki
- FamiTracker
- General Talk
- Bug Reports
- Feature Requests
- Source and development
- Music
- Original Music
- Cover Music
- Other
- Site Issues & Suggestions