waveform lookup tables for Theremin.UNO

Posted: 7/9/2014 2:27:24 PM
achimbloch

Joined: 7/9/2014

Hi,

I'm pretty new to the Theremin world, and currently building a Theremin.UNO (based on Arduino UNO).

I'd like to know how I can create and upload a custom lookup table? I think it's 2048 values long, going from -2048 to 2047, but I don't know how it should be formatted (ie, comma separated values?) and how to upload it into the Theremin, so it would be very helpful if someone has a hint on it! :)

Thanks in advance,

Achim

Posted: 7/9/2014 7:01:27 PM
Thierry

From: Colmar, France

Joined: 12/31/2007

The wave table file is one of four files which have to be compiled and loaded together into the arduino.

So, first, you need a computer on which you install the free arduino development environment (IDE). It's with this environment that you open the 4 files Open_Theremin_UNO.ino, OPTinDefs.h, mcpDac.h and theremin_sintable.c which have to be in one folder on your hard disk.

Than you use the integrated functions of the arduino IDE to compile these files and to upload them into your arduino. All that is already written on the OpenTheremin website because without that, the arduino will not know what to do with the theremin circuit around.

After you made sure that your OpenTheremin is working correctly with the unmodified software, you can start experimenting with different waveforms. Either you follow the links on the OpenTheremin website to download other wavetable files or you create your own ones, having the same structure:

At the beginning you must have these 5 lines:

/* Theremin WAVE Table - 1024 entries full table, amplitude -2048..2048*/

#include <avr/pgmspace.h>

const int16_t sine_table[1024] PROGMEM = {\ 

Then, there have to be 1024 lines with one single value between -2048 and 2047 each, ended by a comma and a new line, i.e. for a triangle signal :

0,
8,
16,
24,
... and so on up to 2047 then down to -2048 and back up to 0, not more and not less than exactly 1024 values

And a last line (line 1030):

};

Then save it in the same directory, for example as triangle_table.c

Now you edit the following line in Open_Theremin_UNO.ino:

#include "theremin_sintable.c" into #include "triangle_table.c"

Run the compile/verify/upload procedure again to load the modified software with the new wave table into your OpenTheremin and you are done.

Posted: 7/10/2014 11:42:55 AM
Thierry

From: Colmar, France

Joined: 12/31/2007

Here are still the corresponding links :

The download and installation of the Arduino IDE, the download of the open theremin UNO software, and the transfer of the compiled program into the Arduino require "normal" computer skills and a little understanding of embedded microprocessors.

Modification of the software (the wave table is part of the software and has to be compiled with it) needs at least basic skills in C/C++ programming.

If you feel overstrained with that, you may contact me for ordering a readily programmed Arduino UNO with the standard or modified software.

Posted: 7/10/2014 12:04:00 PM
achimbloch

Joined: 7/9/2014

Thanks a lot Thierry! :)

You must be logged in to post a reply. Please log in or register for a new account.