arbitrary wavetables

Using Nyquist scripts in Audacity.
Post and download new plug-ins.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Mac OS X
GNU/Linux and Unix-like
Post Reply
Posts: 217
Joined: Sun Jun 13, 2010 12:37 pm
Operating System: Please select

arbitrary wavetables

Post by DERF » Mon Feb 12, 2018 9:27 am

My question concerns the wavetables other than *sine-table*, *saw-table* and tri-table*.In the case of a creation of a wavetable by the user, the principle is it the following one:
1. Take in a sample (a sound of trumpet for exemple) a quite small fragment (a period of the sound wave).

Code: Select all

(setf a-snd (s-read "demo-snd.aiff" :srate 22050.0))
 (setf "trumpet-table" (list (extract 0.110204 0.13932 (cue a-snd)) 24.84822 T))
In this example the file "demo-snd.aiff" is a recording of a trumpet.

2. Apply it to the second sample (a sound of clarinet for exemple):

Code: Select all

(abs-env ("clsound" dur *trumpet-table* bias))
Is it exact?

Thank you for your help.

Site Admin
Posts: 47287
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: arbitrary wavetables

Post by steve » Mon Feb 12, 2018 10:51 am

The "Latest version" of "High Quality (no alias) Tone generator" has examples of generating tones from custom wavetables.

Example: In the "square-wav" function, a waveform "wave" is built (line 35) using "build-harmonic", and then converted to a wavetable and used to generate the tone in line 36.

(Line 37 just applies a bit of filtering to reduce overshoot of the waveform to make it look more "square",
Line 38 trims the start so that the tone starts cleanly.
Line 39 Normalizes and amplifies to the required peak level.)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply