Paste your array contents to load them for editing (must be 256 bits separated with commas):
You can input a math function (with x as your argument) and it will be rendered to an array of 256 byte-sized integers. The x values that the function will be calculated for are [-1, 1], in 1/128 increments (x = -1, -0.9921875, ... , 0.9921875-, 1). The results will be scaled so that 1~128 and -1~-127, rounded to integers and capped at [-128, 127].
The parser is Silent Matt's JavaScript Expression Evaluator. You can check out the syntax right here:
You can use these variables and constants in your function.
The parser has several built-in “functions” that are actually operators. The only difference from an outside point of view, is that they cannot be called with multiple arguments and they are evaluated by the simplify method if their arguments are constant.
Besides the “operator” functions, there are several pre-defined functions. You can provide your own, by binding variables to normal JavaScript functions. These are not evaluated by simplify.
Click [and drag] to draw your waveform. A click inside of a column places a square in it. Each column has exactly one square inside of it. The waveform must include a square in each column.
Click to export your drawn waveform to ASCII code you can paste into your array initializer in C.
Waveshaper waveform editor and generator Copyright (C) 2015 Andrej Radović (r.andrej@gmail.com) except for JavaScript Expression Evaluator (Copyright (C) Matthew Crumley)
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.