Band limited Sawtooth wavetable C++ generator for "Arbitrary Waveform" (and its use)

Status
Not open for further replies.
Band limited Sawtooth wavetable C++ generator for "Arbitrary Waveform" (and its use)

Hi, Teensy has this amazing audio lib, which we all love, but the fact of not having band limited waveforms was not allowing me to put the board in a real project. So, I've been trying to get around this limitation writing my own band limited wave forms. I got the first one, sawtooth, but I'll need some help to get the other ones, but I'll do another post just for that. So, here is how I did it and how you can do it. And please, correct me in anything that might be wrong and make any improvement that you want and share it back.

First we need to generate a wavetable that works with the Arbitrary Wave form. For that, the wavetable must be an array of "int16_t" values, which will give us values from -32767 to 32767. This array, must have 257 values, being the last the same as the first. So, this array should be like:
Code:
 const int16_t sawtoothWavetable[257] = {};

For generating one wavetable I created this c++ code. Where you can choose the table size, its resolution and how many harmonics there will be. It will generate a .h file, which you should put in your Arduino sketch folder.

Code:
//
//  main.cpp
//  Sawtooh wavetable
//
//  Created by Gustavo Silveira on 1/26/17.
//  Copyright © 2017 Gustavo Silveira. All rights reserved.
//  Sawtooth wavetable generator


#include <fstream>
#include <sstream>
#include <iostream>
#include <string>
#include <math.h>

using namespace std;

float scaleBetween(float unscaledNum, float minAllowed, float maxAllowed, float min, float max) { //scaling function
    return (maxAllowed - minAllowed) * (unscaledNum - min) / (max - min) + minAllowed;
}

const int tableSize = 256; // the size of your wavetable
const float PI = 3.141592653589793238462643;
float angularFreq = (2* PI)/tableSize;
float table[tableSize] = {0};
float output;
int16_t scaledOutput;

float maxAmp = 1;
float numberOfHarmonics = 27; //choose how many harmonics your tabke will have

float minValue = 0; //those will be used for normalizing the wavetable
float maxValue = 0;

int16_t resolution = 32767; //how big the biggest value will be. Use "32767" for teensy

int main(int argc, const char * argv[]) {
    
    //open file
    ofstream myFile;
    
    //This is the file the wavetable is going to show up in.
    myFile.open("sawtoothWave257_16bit200h.h");
    
    myFile << "const int16_t sawtoothWaveTable16bit[257] = {";
    
    for (int n=0; n<tableSize; n++) { //creates a Sawtooth wavetable
        
        for(int m=0; m<numberOfHarmonics; m++) {

            table[n] = (table[n] + ( (maxAmp/(m+1) * sin((angularFreq*(m+1))*n)))); //sawtooth formula
        }
        
        if (table[n] > maxValue) { //checks highest value
            maxValue = table[n];
        }
        if (table[n] < minValue) { //checks lowest value
            minValue = table[n];
        }

    }
    
    cout <<"maxValue = ";
    cout << maxValue;
    cout <<" | minValue = ";
    cout << minValue;
    
    
    for (int i=0; i<tableSize; i++) { // normalize the table
        
        output = table[i];
        output = scaleBetween(output, resolution*(-1), resolution, minValue, maxValue);
        output = round(output);
        myFile << output; // writes each scaled value in the table
        myFile << ",";
    }
    
    myFile << "0};"; // the table needs this last value
    //close connection to text file
    
    myFile.close();
    
    return 0;
    
}

Which should look like this:

Code:
const int16_t sawtoothWaveTable16bit[257] = {0, 11872, 21985, 29041, 32523, 32767, 30792, 27938, 25440, 24097, 24105, 25114, 26456, 27444, 27637, 26973, 25741, 24425, 23485, 23178, 23474, 24097, 24663, 24843, 24501, 23725, 22783, 21987, 21570, 21587, 21907, 22278, 22445, 22252, 21705, 20962, 20253, 19783, 19645, 19785, 20034, 20183, 20076, 19674, 19064, 18419, 17923, 17684, 17700, 17856, 17984, 17933, 17632, 17123, 16535, 16026, 15717, 15638, 15718, 15821, 15804, 15581, 15155, 14619, 14110, 13749, 13592, 13605, 13680, 13685, 13522, 13168, 12681, 12179, 11781, 11561, 11512, 11555, 11571, 11457, 11165, 10727, 10239, 9815, 9540, 9434, 9442, 9462, 9385, 9149, 8760, 8291, 7849, 7529, 7369, 7340, 7355, 7307, 7121, 6780, 6336, 5886, 5527, 5317, 5248, 5250, 5224, 5082, 4789, 4375, 3923, 3532, 3275, 3164, 3149, 3137, 3034, 2788, 2408, 1961, 1546, 1244, 1089, 1050, 1045, 977, 777, 434, -0, -434, -777, -977, -1045, -1050, -1089, -1244, -1546, -1961, -2408, -2788, -3034, -3137, -3149, -3164, -3275, -3532, -3923, -4375, -4789, -5082, -5224, -5250, -5248, -5317, -5527, -5886, -6336, -6780, -7121, -7307, -7355, -7340, -7369, -7529, -7849, -8291, -8760, -9149, -9385, -9462, -9442, -9434, -9540, -9815, -10239, -10727, -11165, -11457, -11571, -11555, -11512, -11561, -11781, -12179, -12681, -13168, -13522, -13685, -13680, -13605, -13592, -13749, -14110, -14619, -15155, -15581, -15804, -15821, -15718, -15638, -15717, -16026, -16535, -17123, -17632, -17933, -17984, -17856, -17700, -17684, -17923, -18419, -19064, -19674, -20076, -20183, -20034, -19785, -19645, -19783, -20252, -20962, -21705, -22252, -22445, -22278, -21907, -21587, -21570, -21987, -22783, -23725, -24501, -24843, -24663, -24097, -23474, -23178, -23485, -24425, -25741, -26973, -27637, -27444, -26456, -25114, -24105, -24097, -25440, -27938, -30793, -32767, -32523, -29041, -21985, -11872, 0};

An you can use this table with the arbitrary waveform. But, this is only one table, which will not be enough, you will have aliasing when its harmonics overthrow the nyquist. So, you need several wavetables. So, for that, I created this other c++ code. This will generate a two dimensional array. In this case an array that will contain 45 tables, like:
Code:
const int16_t sawtoothWavetable[45][257] = {{},{}};
Every 3 three notes get a new table. And every new table will calculate the number of harmonics, up to the nyquist, necessary to fulfill the table. To make this code work, you will need to put this "midiFrequencies.h" file with your main.cpp code. So, this is the code:

Code:
//
//  main.cpp
//  Sawtooth wavetable
//
//  Created by Gustavo Silveira on 1/26/17.
//  Copyright © 2017 Gustavo Silveira. All rights reserved.
//  Sawtooth wavetables generator


#include <fstream>
#include <sstream>
#include <iostream>
#include <string>
#include <math.h>

#include "midiFrequencies.h"

using namespace std;

float scaleBetween(float unscaledNum, float minAllowed, float maxAllowed, float min, float max) { //scaling function
    return (maxAllowed - minAllowed) * (unscaledNum - min) / (max - min) + minAllowed;
}

//const int16_t sampleRate = 44100;
const int16_t nyquist = 21000;

const int tableSize = 256; // the size of your wavetable
const int numberOfTables = 45;
//const int notesInTables = nyquist/numberOfTables;
const float PI = 3.141592653589793238462643;
//float phase = PI; //Uncoment this if you want to flip the wave phase
float phase = 0;
float angularFreq = (2* PI)/tableSize;
float table[numberOfTables][tableSize] = {{0},{0}};

float output;
int16_t scaledOutput;

float maxAmp = 1;
int numberOfHarmonics; //those will be calculated in the loop

float minValue = 0; //those will be used for normalizing the scale
float maxValue = 0;

int16_t resolution = 32767; //how big the biggest value will be


int z = 0;

int main(int argc, const char * argv[]) {
    
    
    //open file
    ofstream myFile;
    
    //This is the file the wavetable is going to show up in.
    myFile.open("sawtoothWave[45][257].h");
    
    myFile << "const int16_t sawtoothWavetable[45][257] = {";
    
    for (int t=0; t<numberOfTables; t++) {
        
        numberOfHarmonics = round(nyquist/midiFrequencies[z]); //skips every three notes
        
        for (int n=0; n<tableSize; n++) { //creates a Sawtooth wavetable
            
            for(int m=0; m<numberOfHarmonics; m++) {
                
                table[t][n] = (table[t][n] + ( (maxAmp/(m+1) * sin((angularFreq*(m+1))*n + (phase))))); //sawtooth formula
            }
            
            if (table[t][n] > maxValue) { //checks highest value
                maxValue = table[t][n];
            }
            if (table[t][n] < minValue) { //checks lowest value
                minValue = table[t][n];
            }
            
        }
        z = z+3;
    }
    
    // numberOfHarmonics = nyquist/midiFrequencies[z]; //skips every three notes
    cout <<"maxValue = ";
    cout << maxValue;
    cout <<" | minValue = ";
    cout << minValue;
    
    for (int t=0; t<numberOfTables; t++) {
        myFile << "{";
        
        for (int i=0; i<tableSize; i++) { // normalize the table
            
            output = table[t][i];
            output = scaleBetween(output, resolution*(-1), resolution, minValue, maxValue);
            output = round(output);
            myFile << output; // writes each scaled value in the table
            myFile << ",";
        }
        
        myFile << "0}, \n"; // the table needs this last value
        //close connection to text file
    }
    myFile << "};";
    
    myFile.close();
    
    return 0;
    
}

Which will generate a file like this:

Code:
const int16_t sawtoothWavetable[45][257] = {{-0,28053,27402,27407,27049,26921,26644,26460,26226,26008,25800,25562,25370,25120,24936,24681,24499,24245,24060,23810,23620,23377,23178,22945,22736,22512,22294,22080,21853,21646,21413,21211,20975,20774,20537,20337,20101,19898,19666,19459,19231,19019,18797,18579,18363,18139,17928,17700,17492,17262,17056,16824,16618,16388,16180,15952,15741,15516,15302,15081,14863,14646,14424,14211,13985,13775,13547,13338,13110,12901,12673,12463,12237,12025,11801,11586,11365,11147,10930,10709,10494,10270,10058,9832,9622,9395,9184,8958,8747,8521,8309,8086,7870,7650,7432,7214,6993,6778,6555,6342,6117,5905,5679,5468,5242,5031,4806,4593,4370,4154,3934,3716,3498,3277,3062,2839,2626,2401,2189,1964,1752,1526,1315,1090,877,654,439,218,0,-218,-439,-654,-877,-1090,-1315,-1526,-1752,-1964,-2189,-2401,-2626,-2839,-3062,-3277,-3498,-3716,-3934,-4154,-4370,-4593,-4806,-5031,-5242,-5468,-5679,-5905,-6117,-6342,-6555,-6778,-6993,-7214,-7432,-7650,-7870,-8085,-8309,-8521,-8747,-8958,-9184,-9395,-9622,-9832,-10058,-10270,-10494,-10709,-10930,-11147,-11365,-11586,-11801,-12025,-12237,-12463,-12673,-12901,-13110,-13338,-13547,-13775,-13986,-14211,-14424,-14646,-14863,-15081,-15302,-15516,-15741,-15952,-16180,-16388,-16618,-16824,-17056,-17262,-17492,-17700,-17928,-18139,-18363,-18579,-18797,-19019,-19231,-19459,-19666,-19898,-20101,-20337,-20538,-20774,-20975,-21211,-21413,-21646,-21853,-22080,-22294,-22512,-22736,-22945,-23178,-23377,-23620,-23810,-24061,-24245,-24500,-24681,-24936,-25120,-25370,-25562,-25801,-26008,-26226,-26460,-26645,-26922,-27049,-27407,-27402,-28053,0}, 
{-0,27413,27379,27227,27045,26850,26648,26443,26234,26023,25810,25595,25379,25162,24943,24723,24503,24282,24060,23838,23616,23394,23172,22950,22728,22507,22286,22066,21846,21627,21409,21191,20973,20756,20539,20322,20106,19889,19673,19456,19239,19022,18805,18587,18369,18151,17932,17712,17493,17273,17053,16833,16613,16393,16173,15953,15733,15514,15295,15076,14857,14639,14420,14203,13985,13767,13550,13332,13115,12898,12680,12463,12245,12027,11809,11590,11372,11153,10933,10714,10495,10275,10056,9836,9616,9397,9177,8958,8739,8520,8301,8083,7864,7646,7428,7210,6993,6775,6558,6340,6122,5904,5687,5468,5250,5032,4813,4594,4375,4156,3937,3718,3498,3279,3059,2840,2620,2401,2182,1963,1744,1526,1307,1089,871,653,435,218,0,-218,-435,-653,-871,-1089,-1307,-1526,-1744,-1963,-2182,-2401,-2620,-2840,-3059,-3279,-3498,-3718,-3937,-4156,-4376,-4595,-4813,-5032,-5250,-5469,-5687,-5904,-6122,-6340,-6558,-6775,-6993,-7211,-7428,-7646,-7864,-8083,-8301,-8520,-8739,-8958,-9177,-9397,-9616,-9836,-10056,-10275,-10495,-10714,-10934,-11153,-11372,-11590,-11809,-12027,-12245,-12463,-12680,-12898,-13115,-13332,-13550,-13767,-13985,-14203,-14420,-14639,-14857,-15076,-15295,-15514,-15733,-15953,-16173,-16393,-16613,-16833,-17054,-17273,-17493,-17713,-17932,-18151,-18369,-18588,-18805,-19022,-19239,-19456,-19673,-19890,-20106,-20323,-20539,-20756,-20973,-21191,-21409,-21627,-21846,-22066,-22286,-22507,-22728,-22950,-23171,-23394,-23616,-23838,-24060,-24282,-24503,-24723,-24943,-25162,-25379,-25595,-25810,-26023,-26234,-26443,-26648,-26850,-27045,-27227,-27379,-27413,0}, 
{-0,27907,27706,27204,27079,26970,26638,26404,26276,26018,25751,25593,25379,25107,24916,24727,24466,24247,24066,23825,23587,23401,23180,22933,22734,22529,22284,22069,21873,21637,21408,21213,20989,20752,20550,20338,20100,19887,19684,19450,19227,19026,18800,18569,18365,18149,17915,17704,17496,17263,17043,16839,16613,16385,16180,15961,15730,15520,15308,15077,14859,14652,14425,14201,13994,13774,13545,13335,13121,12891,12675,12466,12239,12017,11809,11587,11360,11150,10934,10705,10491,10279,10052,9832,9623,9400,9174,8965,8747,8519,8306,8093,7865,7647,7437,7213,6989,6780,6560,6333,6121,5907,5679,5462,5251,5026,4804,4594,4373,4148,3936,3720,3493,3277,3065,2840,2619,2409,2187,1962,1751,1534,1307,1092,879,653,434,224,0,-224,-434,-653,-879,-1092,-1307,-1534,-1751,-1962,-2187,-2409,-2619,-2839,-3065,-3277,-3493,-3720,-3936,-4148,-4373,-4594,-4804,-5026,-5251,-5462,-5679,-5907,-6121,-6333,-6560,-6780,-6989,-7213,-7437,-7647,-7865,-8093,-8306,-8519,-8747,-8965,-9174,-9400,-9623,-9832,-10052,-10279,-10491,-10705,-10934,-11150,-11360,-11587,-11809,-12016,-12239,-12466,-12675,-12891,-13121,-13335,-13545,-13774,-13994,-14201,-14425,-14652,-14860,-15077,-15308,-15520,-15730,-15961,-16180,-16385,-16613,-16839,-17044,-17263,-17496,-17704,-17915,-18149,-18365,-18570,-18800,-19026,-19227,-19450,-19684,-19887,-20100,-20338,-20550,-20752,-20989,-21213,-21408,-21637,-21873,-22069,-22284,-22529,-22734,-22933,-23180,-23401,-23587,-23825,-24067,-24247,-24466,-24727,-24916,-25107,-25379,-25593,-25751,-26019,-26277,-26404,-26638,-26970,-27079,-27204,-27706,-27907,0}, 
{-0,28103,27568,27185,27226,26839,26637,26516,26174,26024,25821,25528,25387,25137,24891,24733,24463,24255,24069,23801,23615,23400,23147,22969,22730,22500,22315,22064,21855,21654,21404,21210,20990,20750,20560,20325,20101,19905,19662,19453,19245,19004,18805,18583,18350,18153,17920,17699,17497,17259,17050,16838,16602,16400,16177,15948,15747,15515,15297,15091,14856,14647,14432,14199,13995,13771,13545,13342,13111,12894,12685,12452,12243,12026,11796,11591,11366,11142,10937,10706,10490,10280,10048,9839,9621,9392,9186,8961,8739,8532,8301,8087,7874,7644,7435,7215,6988,6782,6556,6335,6127,5897,5683,5469,5240,5031,4810,4585,4378,4151,3932,3722,3492,3280,3064,2835,2627,2405,2181,1973,1746,1528,1317,1087,876,659,431,223,-0,-223,-431,-659,-876,-1087,-1317,-1528,-1746,-1973,-2181,-2405,-2627,-2835,-3064,-3280,-3492,-3722,-3932,-4151,-4378,-4585,-4810,-5031,-5240,-5469,-5683,-5897,-6127,-6335,-6556,-6782,-6988,-7215,-7435,-7644,-7874,-8087,-8301,-8532,-8739,-8961,-9186,-9392,-9621,-9839,-10048,-10280,-10490,-10706,-10937,-11142,-11366,-11591,-11796,-12026,-12243,-12452,-12685,-12894,-13111,-13342,-13545,-13771,-13995,-14199,-14432,-14647,-14856,-15091,-15297,-15515,-15747,-15948,-16177,-16400,-16602,-16838,-17050,-17259,-17497,-17699,-17920,-18153,-18350,-18583,-18805,-19004,-19245,-19453,-19662,-19905,-20101,-20325,-20560,-20750,-20990,-21210,-21404,-21654,-21855,-22064,-22315,-22500,-22730,-22969,-23147,-23400,-23615,-23800,-24069,-24255,-24463,-24733,-24891,-25137,-25387,-25528,-25822,-26025,-26174,-26516,-26637,-26838,-27226,-27185,-27568,-28103,0}, 
{-0,27831,27835,27270,26963,26936,26753,26399,26172,26058,25832,25530,25330,25178,24934,24661,24474,24298,24045,23794,23611,23416,23161,22927,22744,22534,22281,22060,21874,21652,21404,21193,21001,20771,20529,20326,20127,19890,19656,19457,19250,19011,18785,18587,18372,18133,17914,17716,17494,17256,17044,16843,16615,16382,16174,15968,15737,15508,15304,15092,14859,14636,14432,14216,13982,13764,13560,13338,13106,12893,12687,12461,12231,12022,11813,11583,11357,11151,10937,10706,10485,10279,10061,9830,9612,9406,9184,8954,8741,8533,8307,8079,7869,7658,7430,7206,6998,6783,6553,6333,6125,5907,5677,5460,5253,5030,4802,4588,4379,4154,3927,3717,3505,3277,3053,2845,2629,2400,2180,1972,1753,1524,1308,1100,877,649,436,226,-0,-226,-436,-649,-877,-1100,-1308,-1524,-1753,-1972,-2180,-2400,-2629,-2845,-3053,-3277,-3505,-3717,-3927,-4153,-4379,-4589,-4802,-5030,-5253,-5460,-5677,-5907,-6125,-6333,-6553,-6783,-6998,-7206,-7430,-7658,-7869,-8079,-8307,-8533,-8741,-8954,-9184,-9406,-9613,-9830,-10061,-10279,-10485,-10706,-10937,-11151,-11357,-11583,-11813,-12022,-12231,-12461,-12687,-12893,-13106,-13338,-13560,-13764,-13982,-14216,-14432,-14636,-14859,-15092,-15304,-15508,-15737,-15968,-16174,-16382,-16615,-16843,-17044,-17256,-17494,-17716,-17914,-18133,-18372,-18587,-18785,-19011,-19250,-19457,-19656,-19890,-20127,-20326,-20529,-20771,-21001,-21193,-21404,-21652,-21874,-22060,-22281,-22534,-22744,-22927,-23161,-23416,-23611,-23793,-24045,-24298,-24474,-24661,-24934,-25178,-25330,-25530,-25832,-26058,-26172,-26399,-26753,-26936,-26963,-27270,-27835,-27831,0}, 
{-0,27058,27196,27099,26944,26765,26574,26376,26173,25968,25761,25552,25341,25130,24917,24704,24490,24275,24060,23844,23628,23411,23194,22977,22759,22541,22322,22103,21884,21665,21445,21225,21005,20785,20564,20344,20123,19902,19682,19461,19240,19020,18799,18579,18358,18138,17918,17698,17478,17258,17038,16819,16600,16380,16161,15943,15724,15506,15287,15069,14851,14633,14416,14198,13980,13763,13546,13328,13111,12894,12676,12459,12242,12024,11807,11589,11372,11154,10936,10719,10501,10283,10064,9846,9628,9409,9190,8972,8753,8534,8315,8095,7876,7657,7437,7218,6998,6779,6559,6339,6120,5900,5681,5461,5242,5022,4803,4584,4364,4145,3926,3707,3489,3270,3051,2833,2614,2396,2178,1960,1742,1524,1306,1088,871,653,435,218,-0,-218,-435,-653,-871,-1088,-1306,-1524,-1742,-1960,-2178,-2396,-2614,-2833,-3051,-3270,-3489,-3707,-3926,-4145,-4364,-4584,-4803,-5022,-5242,-5461,-5681,-5900,-6120,-6339,-6559,-6779,-6998,-7218,-7437,-7657,-7876,-8095,-8314,-8534,-8753,-8972,-9190,-9409,-9628,-9846,-10064,-10283,-10501,-10719,-10936,-11154,-11372,-11589,-11807,-12024,-12242,-12459,-12676,-12894,-13111,-13328,-13546,-13763,-13980,-14198,-14416,-14633,-14851,-15069,-15287,-15506,-15724,-15943,-16162,-16380,-16600,-16819,-17038,-17258,-17478,-17698,-17918,-18138,-18358,-18579,-18799,-19020,-19240,-19461,-19682,-19902,-20123,-20344,-20564,-20785,-21005,-21225,-21445,-21664,-21884,-22103,-22322,-22541,-22759,-22977,-23194,-23412,-23628,-23844,-24060,-24275,-24490,-24704,-24917,-25130,-25341,-25552,-25761,-25969,-26174,-26376,-26574,-26765,-26944,-27099,-27196,-27058,0}, 
{-0,28221,27683,27052,27272,26889,26551,26562,26200,25954,25877,25531,25331,25200,24870,24697,24525,24216,24056,23853,23564,23410,23184,22915,22760,22516,22267,22106,21851,21620,21450,21188,20973,20791,20527,20326,20130,19869,19677,19469,19213,19027,18806,18559,18376,18144,17907,17722,17483,17255,17067,16822,16605,16410,16163,15954,15752,15505,15303,15093,14848,14652,14433,14193,14000,13773,13539,13346,13113,12886,12691,12453,12234,12035,11794,11582,11378,11136,10931,10720,10480,10278,10061,9824,9626,9401,9169,8972,8742,8516,8317,8083,7863,7662,7424,7211,7005,6766,6558,6347,6110,5906,5689,5454,5253,5030,4799,4599,4371,4145,3945,3712,3491,3289,3054,2839,2633,2396,2186,1976,1739,1533,1317,1082,881,659,427,227,-0,-227,-427,-659,-881,-1083,-1317,-1533,-1739,-1976,-2186,-2396,-2633,-2839,-3054,-3289,-3491,-3712,-3945,-4145,-4371,-4599,-4799,-5030,-5253,-5454,-5689,-5906,-6110,-6347,-6558,-6766,-7005,-7211,-7424,-7662,-7863,-8083,-8317,-8516,-8742,-8972,-9169,-9401,-9626,-9824,-10061,-10278,-10480,-10720,-10931,-11136,-11378,-11583,-11794,-12035,-12234,-12453,-12691,-12886,-13113,-13346,-13539,-13773,-14000,-14193,-14433,-14652,-14848,-15093,-15303,-15505,-15752,-15954,-16163,-16410,-16605,-16822,-17067,-17255,-17483,-17722,-17907,-18144,-18376,-18560,-18807,-19027,-19213,-19469,-19677,-19869,-20130,-20326,-20527,-20791,-20973,-21188,-21450,-21620,-21850,-22106,-22267,-22516,-22760,-22915,-23184,-23410,-23564,-23853,-24057,-24215,-24525,-24697,-24870,-25200,-25331,-25531,-25878,-25954,-26200,-26562,-26551,-26889,-27272,-27052,-27683,-28221,0}, 
{-0,27394,27880,27643,27137,26715,26526,26469,26350,26085,25751,25482,25320,25187,24988,24710,24428,24212,24051,23876,23641,23369,23123,22932,22759,22553,22302,22045,21827,21643,21453,21225,20971,20734,20533,20347,20137,19896,19650,19431,19238,19041,18815,18570,18337,18131,17938,17727,17491,17250,17031,16833,16632,16408,16168,15937,15729,15531,15319,15086,14849,14629,14428,14224,14001,13765,13535,13325,13125,12912,12681,12446,12226,12023,11818,11596,11361,11132,10922,10719,10506,10277,10043,9823,9618,9412,9191,8957,8729,8518,8314,8101,7872,7640,7420,7214,7007,6786,6553,6326,6114,5909,5696,5468,5236,5016,4809,4602,4381,4149,3922,3709,3504,3291,3063,2832,2612,2405,2197,1977,1745,1518,1305,1100,887,659,428,207,-0,-207,-428,-659,-887,-1100,-1305,-1518,-1745,-1977,-2197,-2405,-2612,-2832,-3063,-3291,-3504,-3709,-3922,-4149,-4381,-4602,-4809,-5016,-5236,-5468,-5696,-5909,-6114,-6326,-6553,-6786,-7007,-7214,-7420,-7640,-7872,-8101,-8314,-8518,-8729,-8957,-9191,-9412,-9618,-9823,-10043,-10277,-10506,-10719,-10922,-11132,-11361,-11596,-11818,-12023,-12226,-12446,-12681,-12912,-13125,-13325,-13535,-13765,-14002,-14224,-14428,-14629,-14849,-15086,-15319,-15531,-15729,-15937,-16168,-16408,-16632,-16833,-17031,-17250,-17491,-17727,-17938,-18131,-18337,-18571,-18815,-19041,-19238,-19431,-19650,-19896,-20137,-20347,-20533,-20734,-20971,-21225,-21453,-21643,-21827,-22045,-22302,-22553,-22759,-22932,-23123,-23369,-23641,-23876,-24051,-24212,-24428,-24710,-24988,-25187,-25320,-25482,-25751,-26085,-26350,-26469,-26526,-26715,-27137,-27643,-27880,-27394,0}, 
{-0,28510,27605,27006,27399,26753,26621,26597,26087,26069,25836,25472,25446,25109,24876,24778,24419,24273,24085,23762,23651,23388,23130,23004,22700,22507,22334,22033,21880,21651,21384,21239,20969,20750,20581,20297,20118,19909,19640,19479,19232,18996,18828,18559,18359,18164,17896,17721,17492,17246,17074,16819,16604,16416,16153,15964,15749,15497,15320,15078,14850,14666,14410,14209,14004,13750,13565,13336,13099,12916,12667,12454,12257,12004,11811,11592,11349,11164,10924,10701,10509,10259,10057,9847,9600,9411,9181,8949,8760,8515,8303,8101,7853,7658,7437,7199,7009,6771,6550,6354,6107,5905,5692,5449,5258,5026,4798,4605,4361,4152,3946,3701,3506,3282,3047,2856,2617,2399,2200,1954,1753,1537,1297,1105,872,647,452,208,0,-208,-452,-647,-872,-1105,-1297,-1537,-1753,-1954,-2200,-2399,-2617,-2856,-3047,-3282,-3506,-3701,-3946,-4152,-4361,-4605,-4798,-5026,-5258,-5449,-5692,-5905,-6107,-6354,-6550,-6771,-7009,-7199,-7437,-7658,-7853,-8101,-8303,-8515,-8760,-8949,-9181,-9411,-9601,-9847,-10057,-10259,-10509,-10701,-10924,-11164,-11349,-11592,-11811,-12004,-12257,-12454,-12667,-12916,-13099,-13336,-13565,-13750,-14004,-14209,-14410,-14666,-14850,-15078,-15320,-15497,-15749,-15964,-16153,-16416,-16604,-16819,-17074,-17246,-17492,-17721,-17896,-18164,-18359,-18559,-18828,-18996,-19232,-19479,-19640,-19909,-20118,-20297,-20581,-20750,-20969,-21239,-21384,-21651,-21880,-22033,-22334,-22507,-22700,-23004,-23130,-23388,-23651,-23762,-24085,-24273,-24419,-24778,-24876,-25109,-25446,-25472,-25836,-26069,-26087,-26597,-26621,-26753,-27399,-27006,-27605,-28510,0}, 
{-0,26360,26837,26854,26754,26607,26436,26252,26060,25862,25660,25455,25248,25040,24830,24619,24407,24194,23981,23768,23554,23339,23125,22910,22694,22479,22263,22048,21832,21615,21399,21183,20966,20750,20533,20316,20100,19883,19666,19449,19232,19014,18797,18580,18362,18145,17928,17710,17493,17275,17057,16840,16622,16404,16186,15969,15751,15533,15315,15097,14879,14661,14443,14225,14007,13788,13570,13352,13134,12915,12697,12479,12260,12042,11824,11605,11387,11168,10950,10731,10512,10294,10075,9857,9638,9419,9200,8982,8763,8544,8325,8106,7888,7669,7450,7231,7012,6793,6574,6355,6136,5917,5698,5479,5260,5041,4822,4603,4384,4165,3945,3726,3507,3288,3069,2850,2631,2411,2192,1973,1754,1534,1315,1096,877,658,439,219,-0,-219,-439,-658,-877,-1096,-1315,-1535,-1754,-1973,-2192,-2411,-2631,-2850,-3069,-3288,-3507,-3726,-3945,-4165,-4384,-4603,-4822,-5041,-5260,-5479,-5698,-5917,-6136,-6355,-6574,-6793,-7012,-7231,-7450,-7669,-7888,-8106,-8325,-8544,-8763,-8982,-9200,-9419,-9638,-9857,-10075,-10294,-10512,-10731,-10950,-11168,-11387,-11605,-11824,-12042,-12260,-12479,-12697,-12915,-13134,-13352,-13570,-13788,-14007,-14225,-14443,-14661,-14879,-15097,-15315,-15533,-15751,-15969,-16187,-16404,-16622,-16840,-17058,-17275,-17493,-17710,-17928,-18145,-18363,-18580,-18797,-19014,-19232,-19449,-19666,-19883,-20100,-20316,-20533,-20750,-20966,-21183,-21399,-21615,-21832,-22048,-22263,-22479,-22694,-22910,-23125,-23339,-23554,-23768,-23982,-24194,-24407,-24619,-24830,-25040,-25248,-25455,-25660,-25862,-26060,-26252,-26436,-26607,-26754,-26854,-26837,-26360,0}, 
{-0,28626,28028,26769,27216,27140,26407,26460,26415,25857,25765,25722,25260,25089,25039,24642,24423,24362,24014,23761,23687,23379,23104,23014,22739,22450,22343,22096,21797,21673,21449,21147,21005,20800,20497,20337,20148,19849,19671,19495,19201,19007,18839,18554,18344,18182,17906,17682,17523,17258,17022,16863,16610,16364,16203,15962,15707,15541,15312,15051,14879,14661,14396,14217,14010,13743,13556,13357,13091,12894,12703,12439,12233,12048,11788,11572,11392,11138,10912,10735,10487,10254,10077,9836,9596,9418,9186,8939,8758,8534,8283,8098,7883,7628,7438,7230,6974,6777,6577,6321,6117,5923,5668,5457,5268,5016,4797,4611,4364,4138,3955,3713,3480,3297,3062,2822,2638,2410,2165,1979,1758,1509,1320,1106,854,660,454,200,0,-200,-454,-660,-854,-1106,-1320,-1509,-1758,-1979,-2165,-2410,-2638,-2822,-3062,-3297,-3480,-3713,-3955,-4138,-4364,-4612,-4797,-5016,-5268,-5457,-5668,-5923,-6117,-6321,-6577,-6777,-6974,-7230,-7438,-7628,-7883,-8098,-8283,-8534,-8758,-8939,-9186,-9418,-9596,-9836,-10077,-10254,-10487,-10735,-10912,-11138,-11392,-11572,-11788,-12048,-12233,-12439,-12703,-12894,-13091,-13357,-13556,-13743,-14010,-14217,-14396,-14662,-14879,-15051,-15312,-15541,-15707,-15962,-16203,-16364,-16610,-16863,-17022,-17258,-17523,-17682,-17906,-18182,-18344,-18554,-18839,-19007,-19201,-19495,-19671,-19849,-20148,-20337,-20497,-20800,-21005,-21147,-21449,-21673,-21797,-22096,-22343,-22449,-22739,-23015,-23104,-23379,-23687,-23761,-24014,-24362,-24423,-24642,-25039,-25089,-25260,-25722,-25765,-25858,-26415,-26460,-26407,-27140,-27216,-26769,-28027,-28626,0}, 
{-0,29293,27187,27191,27452,26494,26983,26272,26251,26117,25616,25757,25221,25190,24951,24602,24605,24152,24108,23822,23554,23475,23078,23019,22708,22491,22355,22001,21924,21603,21419,21240,20924,20827,20503,20342,20129,19846,19727,19407,19260,19021,18767,18626,18314,18174,17916,17687,17523,17224,17085,16813,16606,16421,16136,15994,15713,15523,15318,15050,14900,14616,14439,14215,13964,13804,13520,13353,13113,12880,12707,12427,12265,12012,11795,11608,11336,11175,10913,10710,10508,10246,10083,9815,9624,9408,9158,8990,8719,8538,8308,8071,7895,7624,7450,7208,6984,6798,6531,6361,6109,5898,5700,5440,5271,5011,4812,4601,4350,4178,3914,3725,3502,3261,3085,2818,2638,2403,2174,1989,1724,1549,1304,1087,893,631,460,205,-0,-205,-460,-631,-893,-1087,-1304,-1549,-1724,-1989,-2174,-2403,-2638,-2818,-3085,-3261,-3502,-3725,-3914,-4178,-4350,-4602,-4812,-5011,-5271,-5440,-5700,-5898,-6109,-6361,-6531,-6798,-6984,-7208,-7450,-7624,-7895,-8071,-8308,-8538,-8719,-8990,-9158,-9408,-9625,-9815,-10084,-10246,-10508,-10710,-10913,-11175,-11336,-11608,-11795,-12012,-12265,-12427,-12707,-12880,-13113,-13353,-13520,-13804,-13964,-14215,-14439,-14616,-14900,-15050,-15318,-15523,-15713,-15994,-16136,-16421,-16606,-16813,-17086,-17224,-17523,-17687,-17916,-18174,-18314,-18626,-18767,-19021,-19260,-19407,-19727,-19846,-20129,-20341,-20503,-20827,-20924,-21240,-21419,-21603,-21924,-22001,-22355,-22491,-22708,-23019,-23078,-23476,-23554,-23822,-24108,-24152,-24605,-24602,-24951,-25190,-25221,-25757,-25616,-26117,-26251,-26272,-26983,-26494,-27452,-27192,-27187,-29293,0}, 
{-0,26576,28302,28079,27153,26462,26359,26545,26527,26143,25648,25362,25324,25293,25059,24668,24334,24181,24115,23951,23637,23297,23074,22962,22829,22577,22254,21987,21828,21701,21496,21202,20913,20712,20572,20398,20139,19847,19610,19448,19290,19064,18782,18522,18331,18175,17977,17715,17443,17224,17058,16879,16642,16369,16128,15943,15774,15560,15297,15040,14834,14663,14469,14223,13960,13732,13551,13370,13144,12884,12639,12441,12265,12058,11808,11553,11337,11156,10964,10730,10472,10239,10047,9864,9647,9394,9148,8941,8759,8558,8316,8063,7840,7651,7462,7235,6982,6744,6545,6360,6150,5904,5655,5441,5255,5058,4824,4572,4342,4148,3960,3741,3491,3250,3043,2857,2652,2412,2162,1941,1752,1558,1331,1080,845,646,459,246,-0,-246,-459,-646,-845,-1080,-1331,-1558,-1752,-1941,-2163,-2412,-2652,-2857,-3043,-3249,-3491,-3741,-3960,-4148,-4342,-4572,-4824,-5058,-5255,-5441,-5656,-5904,-6150,-6360,-6545,-6744,-6982,-7235,-7462,-7651,-7840,-8063,-8316,-8558,-8759,-8941,-9148,-9394,-9647,-9864,-10047,-10239,-10472,-10730,-10964,-11156,-11337,-11553,-11808,-12058,-12265,-12441,-12639,-12884,-13144,-13370,-13551,-13733,-13960,-14223,-14469,-14663,-14834,-15040,-15297,-15560,-15774,-15943,-16128,-16369,-16642,-16879,-17058,-17224,-17443,-17715,-17977,-18175,-18331,-18522,-18782,-19064,-19290,-19448,-19610,-19847,-20139,-20398,-20572,-20712,-20913,-21202,-21496,-21701,-21828,-21987,-22254,-22577,-22829,-22962,-23074,-23297,-23637,-23951,-24115,-24181,-24334,-24668,-25059,-25293,-25324,-25362,-25648,-26143,-26527,-26545,-26359,-26462,-27153,-28079,-28302,-26576,0}, 
{-0,25041,26141,26383,26398,26320,26196,26045,25877,25698,25511,25318,25121,24921,24718,24513,24306,24098,23889,23679,23468,23256,23044,22831,22618,22404,22190,21976,21761,21546,21331,21115,20900,20684,20468,20252,20036,19820,19603,19387,19170,18953,18737,18520,18303,18086,17869,17652,17434,17217,17000,16783,16565,16348,16130,15913,15695,15478,15260,15043,14825,14607,14390,14172,13954,13737,13519,13301,13083,12865,12648,12430,12212,11994,11776,11558,11340,11122,10905,10687,10469,10251,10033,9815,9597,9379,9161,8943,8725,8507,8289,8070,7852,7634,7416,7198,6980,6762,6544,6326,6108,5890,5672,5453,5235,5017,4799,4581,4363,4145,3927,3708,3490,3272,3054,2836,2618,2400,2182,1963,1745,1527,1309,1091,873,654,436,218,-0,-218,-436,-654,-873,-1091,-1309,-1527,-1745,-1963,-2182,-2400,-2618,-2836,-3054,-3272,-3490,-3709,-3927,-4145,-4363,-4581,-4799,-5017,-5235,-5454,-5672,-5890,-6108,-6326,-6544,-6762,-6980,-7198,-7416,-7634,-7852,-8070,-8289,-8507,-8725,-8943,-9161,-9379,-9597,-9815,-10033,-10251,-10469,-10687,-10905,-11122,-11340,-11558,-11776,-11994,-12212,-12430,-12648,-12866,-13083,-13301,-13519,-13737,-13954,-14172,-14390,-14608,-14825,-15043,-15260,-15478,-15695,-15913,-16130,-16348,-16565,-16783,-17000,-17217,-17434,-17652,-17869,-18086,-18303,-18520,-18737,-18953,-19170,-19387,-19603,-19819,-20036,-20252,-20468,-20684,-20900,-21115,-21331,-21546,-21761,-21976,-22190,-22404,-22618,-22831,-23044,-23256,-23468,-23679,-23889,-24098,-24306,-24513,-24718,-24921,-25121,-25318,-25511,-25698,-25877,-26045,-26196,-26320,-26398,-26383,-26141,-25041,0}, 
{-0,26551,28426,28444,27574,26611,26109,26138,26362,26377,26034,25505,25088,24935,24951,24907,24657,24253,23878,23669,23600,23523,23311,22970,22621,22384,22267,22169,21977,21675,21345,21092,20943,20827,20649,20373,20059,19796,19623,19494,19323,19068,18767,18498,18307,18165,17998,17761,17472,17199,16993,16839,16675,16451,16173,15899,15680,15515,15353,15140,14872,14598,14369,14194,14031,13827,13570,13297,13059,12875,12709,12513,12266,11995,11751,11556,11388,11199,10960,10693,10443,10240,10068,9883,9653,9390,9136,8924,8748,8567,8345,8087,7829,7610,7428,7250,7036,6783,6524,6297,6110,5932,5726,5479,5218,4985,4791,4614,4414,4174,3913,3673,3474,3296,3102,2868,2609,2363,2157,1978,1789,1561,1304,1054,841,659,474,254,-0,-254,-474,-659,-841,-1054,-1304,-1561,-1789,-1978,-2157,-2363,-2609,-2868,-3102,-3296,-3474,-3673,-3913,-4174,-4414,-4615,-4791,-4985,-5218,-5479,-5726,-5932,-6110,-6297,-6524,-6783,-7036,-7250,-7428,-7610,-7830,-8087,-8345,-8567,-8748,-8924,-9136,-9390,-9653,-9883,-10068,-10240,-10443,-10693,-10960,-11199,-11388,-11557,-11751,-11995,-12266,-12513,-12709,-12875,-13059,-13297,-13570,-13827,-14031,-14194,-14369,-14598,-14872,-15140,-15353,-15516,-15680,-15899,-16173,-16451,-16675,-16839,-16993,-17199,-17472,-17761,-17998,-18165,-18307,-18498,-18767,-19068,-19323,-19494,-19623,-19796,-20059,-20373,-20649,-20827,-20943,-21092,-21345,-21675,-21977,-22169,-22267,-22384,-22621,-22970,-23311,-23523,-23600,-23669,-23878,-24253,-24657,-24907,-24951,-24935,-25088,-25505,-26034,-26377,-26362,-26138,-26109,-26611,-27574,-28444,-28426,-26551,0}, 
{-0,29514,29088,26264,26727,27682,26560,25928,26559,26255,25407,25568,25680,24976,24723,24941,24527,24025,24127,23994,23442,23323,23354,22913,22583,22629,22372,21929,21866,21773,21341,21120,21103,20778,20427,20381,20194,19795,19644,19561,19204,18931,18874,18620,18266,18155,18008,17646,17437,17351,17051,16749,16655,16449,16103,15942,15815,15491,15241,15143,14888,14573,14442,14270,13940,13738,13618,13329,13052,12935,12718,12399,12234,12084,11775,11539,11419,11163,10869,10729,10541,10228,10031,9894,9609,9347,9217,8992,8690,8524,8359,8059,7832,7699,7441,7160,7015,6817,6514,6322,6173,5890,5638,5502,5270,4977,4813,4638,4341,4122,3982,3720,3448,3302,3096,2798,2611,2454,2170,1926,1787,1550,1262,1101,919,623,411,266,0,-266,-411,-623,-919,-1101,-1262,-1550,-1787,-1926,-2170,-2454,-2611,-2798,-3096,-3302,-3448,-3720,-3982,-4122,-4341,-4638,-4813,-4977,-5270,-5502,-5638,-5890,-6173,-6322,-6514,-6817,-7015,-7160,-7441,-7699,-7832,-8059,-8359,-8524,-8690,-8992,-9217,-9347,-9609,-9894,-10031,-10228,-10541,-10729,-10869,-11163,-11419,-11540,-11775,-12084,-12234,-12399,-12718,-12935,-13052,-13329,-13619,-13738,-13940,-14270,-14442,-14573,-14888,-15143,-15241,-15491,-15815,-15942,-16103,-16449,-16655,-16749,-17051,-17351,-17437,-17647,-18008,-18155,-18266,-18620,-18874,-18931,-19204,-19561,-19644,-19795,-20194,-20381,-20427,-20778,-21103,-21120,-21341,-21773,-21866,-21929,-22372,-22629,-22583,-22913,-23354,-23323,-23442,-23994,-24128,-24025,-24527,-24941,-24723,-24976,-25680,-25568,-25407,-26255,-26559,-25928,-26560,-27682,-26727,-26264,-29088,-29515,0}, 
{-0,31883,26439,27093,27926,25954,27389,26098,26191,26340,25337,25987,25111,25158,25095,24409,24775,24063,24093,23927,23402,23617,22995,23017,22789,22364,22481,21921,21934,21665,21310,21356,20842,20847,20549,20247,20238,19762,19758,19439,19177,19124,18680,18667,18333,18104,18013,17598,17574,17229,17028,16903,16515,16480,16128,15949,15796,15432,15386,15028,14868,14690,14349,14290,13931,13786,13584,13266,13194,12834,12702,12480,12182,12096,11739,11617,11377,11099,10999,10645,10531,10274,10015,9900,9551,9444,9172,8931,8802,8459,8356,8071,7847,7702,7368,7266,6970,6763,6603,6277,6176,5870,5679,5503,5188,5085,4771,4594,4403,4099,3993,3673,3509,3302,3010,2901,2576,2424,2201,1922,1807,1479,1338,1101,835,713,383,252,0,-252,-383,-713,-835,-1101,-1338,-1479,-1807,-1922,-2201,-2424,-2576,-2901,-3010,-3302,-3509,-3673,-3993,-4098,-4403,-4594,-4771,-5085,-5188,-5503,-5679,-5871,-6176,-6277,-6603,-6763,-6970,-7266,-7368,-7702,-7847,-8071,-8356,-8459,-8802,-8931,-9172,-9444,-9551,-9900,-10015,-10274,-10531,-10645,-10999,-11099,-11377,-11617,-11739,-12096,-12182,-12480,-12702,-12834,-13194,-13266,-13584,-13786,-13931,-14290,-14349,-14690,-14868,-15028,-15386,-15432,-15796,-15949,-16128,-16480,-16515,-16903,-17028,-17229,-17574,-17598,-18012,-18104,-18333,-18667,-18680,-19124,-19177,-19439,-19758,-19762,-20238,-20247,-20549,-20847,-20842,-21356,-21310,-21665,-21934,-21921,-22481,-22364,-22789,-23017,-22995,-23617,-23402,-23927,-24093,-24063,-24775,-24409,-25095,-25158,-25111,-25987,-25337,-26340,-26191,-26098,-27389,-25954,-27926,-27093,-26439,-31883,0}, 
{-0,32767,24823,29174,25705,28009,25729,27253,25525,26637,25230,26085,24887,25569,24518,25073,24132,24591,23734,24118,23329,23652,22918,23191,22503,22733,22085,22279,21664,21827,21241,21376,20816,20927,20390,20480,19962,20033,19534,19588,19105,19143,18675,18699,18245,18255,17814,17812,17382,17369,16950,16927,16518,16485,16086,16043,15653,15602,15220,15161,14787,14720,14353,14279,13920,13838,13486,13398,13052,12958,12618,12518,12183,12078,11749,11638,11315,11198,10880,10758,10445,10319,10011,9879,9576,9440,9141,9000,8706,8561,8271,8121,7836,7682,7401,7243,6966,6804,6531,6365,6095,5926,5660,5487,5225,5048,4790,4609,4354,4170,3919,3731,3483,3292,3048,2853,2613,2414,2177,1975,1742,1536,1306,1097,871,658,435,219,0,-219,-435,-658,-871,-1097,-1306,-1536,-1742,-1975,-2177,-2414,-2613,-2853,-3048,-3292,-3483,-3731,-3919,-4170,-4354,-4609,-4790,-5048,-5225,-5487,-5660,-5926,-6095,-6365,-6531,-6804,-6966,-7243,-7401,-7682,-7836,-8121,-8271,-8561,-8706,-9000,-9141,-9440,-9576,-9879,-10011,-10319,-10445,-10758,-10880,-11198,-11315,-11638,-11749,-12078,-12183,-12518,-12618,-12958,-13052,-13398,-13486,-13838,-13920,-14279,-14353,-14720,-14787,-15161,-15220,-15602,-15653,-16043,-16086,-16485,-16518,-16927,-16951,-17369,-17382,-17812,-17814,-18255,-18245,-18699,-18675,-19143,-19105,-19588,-19534,-20033,-19962,-20480,-20390,-20927,-20816,-21376,-21241,-21827,-21664,-22279,-22085,-22733,-22503,-23191,-22918,-23652,-23329,-24118,-23734,-24591,-24132,-25073,-24518,-25569,-24887,-26085,-25230,-26637,-25525,-27253,-25729,-28009,-25704,-29174,-24823,-32767,0}, 
{-0,31980,26297,27195,27952,25744,27784,25576,26733,25905,25557,26038,24804,25636,24577,24825,24573,23998,24399,23471,23877,23258,23142,23117,22479,22788,22067,22207,21849,21533,21611,20980,21183,20636,20579,20395,19965,20075,19495,19581,19186,18980,18909,18425,18520,18017,17985,17719,17403,17398,16905,16952,16541,16398,16236,15847,15868,15401,15378,15063,14821,14736,14309,14321,13907,13802,13578,13258,13220,12787,12764,12417,12230,12082,11709,11689,11278,11199,10927,10664,10575,10175,10144,9777,9631,9433,9108,9054,8653,8590,8282,8066,7931,7564,7521,7143,7029,6786,6506,6418,6032,5976,5640,5465,5287,4955,4894,4512,4422,4142,3904,3781,3414,3359,3002,2863,2643,2347,2265,1885,1813,1499,1301,1142,799,738,367,258,-0,-259,-367,-738,-799,-1142,-1301,-1499,-1813,-1885,-2265,-2347,-2643,-2863,-3002,-3359,-3414,-3781,-3904,-4142,-4422,-4512,-4895,-4955,-5287,-5465,-5640,-5976,-6032,-6418,-6506,-6786,-7029,-7143,-7521,-7564,-7931,-8066,-8282,-8590,-8653,-9054,-9108,-9433,-9631,-9777,-10144,-10175,-10575,-10664,-10927,-11199,-11278,-11689,-11709,-12082,-12230,-12417,-12764,-12787,-13220,-13258,-13578,-13802,-13907,-14322,-14309,-14737,-14821,-15063,-15378,-15401,-15868,-15847,-16236,-16398,-16541,-16952,-16906,-17398,-17403,-17719,-17985,-18017,-18520,-18425,-18909,-18980,-19186,-19581,-19495,-20075,-19965,-20395,-20579,-20636,-21183,-20980,-21611,-21533,-21849,-22207,-22067,-22788,-22479,-23117,-23142,-23258,-23877,-23471,-24399,-23999,-24574,-24825,-24577,-25636,-24804,-26038,-25557,-25905,-26733,-25576,-27784,-25744,-27952,-27195,-26297,-31980,0}, 
{-0,29978,29248,24798,28677,26849,25641,27560,25808,25601,26582,25035,25298,25658,24378,24859,24772,23788,24329,23923,23237,23727,23114,22706,23069,22348,22178,22368,21626,21639,21639,20947,21079,20894,20305,20491,20146,19693,19871,19407,19101,19220,18685,18519,18542,17986,17936,17841,17313,17343,17127,16665,16734,16409,16039,16104,15694,15429,15451,14990,14827,14778,14303,14226,14088,13634,13618,13387,12986,12998,12681,12355,12362,11979,11736,11708,11284,11125,11037,10603,10515,10351,9939,9899,9657,9290,9273,8958,8657,8632,8262,8034,7977,7573,7418,7306,6896,6803,6622,6234,6182,5931,5586,5552,5236,4952,4909,4543,4328,4252,3858,3710,3581,3184,3091,2898,2524,2468,2208,1877,1836,1514,1243,1191,824,619,532,140,0,-140,-532,-619,-824,-1191,-1243,-1514,-1836,-1877,-2208,-2468,-2524,-2898,-3091,-3184,-3581,-3710,-3858,-4252,-4328,-4544,-4909,-4952,-5236,-5552,-5586,-5931,-6182,-6234,-6622,-6803,-6896,-7306,-7418,-7573,-7977,-8034,-8262,-8632,-8657,-8958,-9273,-9290,-9657,-9899,-9939,-10351,-10515,-10603,-11037,-11125,-11284,-11708,-11736,-11979,-12362,-12355,-12681,-12998,-12986,-13387,-13618,-13634,-14088,-14226,-14303,-14778,-14827,-14990,-15451,-15429,-15694,-16104,-16039,-16409,-16734,-16665,-17127,-17343,-17313,-17841,-17936,-17986,-18542,-18519,-18685,-19220,-19101,-19407,-19871,-19693,-20146,-20491,-20305,-20894,-21079,-20947,-21639,-21639,-21626,-22368,-22178,-22348,-23069,-22706,-23114,-23727,-23237,-23923,-24329,-23788,-24773,-24859,-24379,-25658,-25298,-25035,-26582,-25601,-25808,-27560,-25641,-26849,-28677,-24798,-29249,-29978,0}, 
{-0,27327,31632,25225,26056,28737,26380,25269,27091,26457,24853,25733,26051,24609,24620,25328,24384,23763,24417,24058,23135,23449,23564,22666,22536,22891,22257,21749,22085,21813,21107,21224,21266,20578,20389,20597,20100,19641,19829,19599,19000,19017,19023,18446,18224,18351,17931,17499,17601,17398,16861,16817,16802,16294,16050,16127,15757,15342,15387,15203,14707,14621,14593,14132,13872,13914,13580,13176,13181,13011,12544,12427,12390,11964,11691,11709,11402,11004,10980,10821,10376,10234,10192,9792,9508,9508,9223,8829,8781,8633,8204,8042,7998,7618,7324,7310,7043,6651,6584,6446,6029,5850,5805,5442,5139,5114,4863,4471,4389,4261,3852,3658,3614,3266,2952,2920,2684,2290,2194,2076,1674,1466,1424,1089,765,726,504,108,-0,-108,-504,-726,-765,-1089,-1424,-1466,-1675,-2076,-2194,-2290,-2684,-2920,-2952,-3266,-3614,-3658,-3852,-4261,-4389,-4471,-4863,-5114,-5139,-5442,-5805,-5850,-6029,-6446,-6584,-6651,-7043,-7310,-7324,-7618,-7998,-8042,-8204,-8633,-8781,-8829,-9223,-9508,-9508,-9792,-10192,-10234,-10376,-10821,-10980,-11004,-11402,-11709,-11691,-11964,-12390,-12427,-12544,-13011,-13181,-13176,-13580,-13914,-13872,-14132,-14593,-14621,-14707,-15203,-15387,-15342,-15757,-16127,-16050,-16294,-16802,-16817,-16861,-17398,-17601,-17499,-17931,-18351,-18224,-18446,-19023,-19017,-19000,-19599,-19829,-19641,-20100,-20597,-20389,-20578,-21266,-21224,-21107,-21813,-22085,-21749,-22257,-22891,-22536,-22666,-23564,-23449,-23135,-24058,-24417,-23763,-24384,-25328,-24620,-24609,-26051,-25733,-24853,-26457,-27091,-25269,-26380,-28737,-26056,-25225,-31632,-27327,0}, 
{-0,24336,32548,27853,24387,26758,28515,26450,24834,26063,26912,25494,24422,25233,25717,24593,23784,24376,24662,23706,23052,23511,23672,22826,22274,22641,22716,21948,21470,21770,21781,21071,20648,20897,20860,20195,19815,20024,19949,19320,18975,19151,19043,18444,18129,18277,18143,17570,17278,17404,17247,16695,16425,16530,16353,15820,15568,15656,15462,14945,14710,14782,14572,14071,13850,13908,13684,13196,12989,13033,12798,12322,12126,12159,11912,11447,11263,11285,11027,10573,10399,10411,10143,9698,9534,9537,9259,8824,8669,8662,8376,7950,7803,7788,7493,7075,6937,6914,6611,6201,6070,6040,5729,5327,5204,5165,4847,4452,4337,4291,3966,3578,3470,3417,3084,2703,2602,2542,2203,1829,1735,1668,1322,955,867,794,441,81,-0,-81,-441,-794,-868,-955,-1322,-1668,-1735,-1829,-2203,-2542,-2602,-2704,-3084,-3417,-3470,-3578,-3966,-4291,-4337,-4452,-4847,-5165,-5204,-5327,-5729,-6040,-6070,-6201,-6611,-6914,-6937,-7075,-7493,-7788,-7803,-7950,-8376,-8662,-8669,-8824,-9259,-9537,-9534,-9698,-10143,-10411,-10399,-10573,-11027,-11285,-11263,-11447,-11912,-12159,-12126,-12322,-12798,-13033,-12989,-13196,-13684,-13908,-13850,-14071,-14572,-14782,-14710,-14945,-15462,-15656,-15568,-15820,-16353,-16530,-16425,-16695,-17247,-17404,-17278,-17570,-18143,-18277,-18129,-18445,-19043,-19151,-18975,-19320,-19948,-20024,-19815,-20195,-20860,-20897,-20648,-21071,-21781,-21770,-21470,-21948,-22716,-22641,-22274,-22826,-23672,-23511,-23052,-23706,-24662,-24376,-23784,-24593,-25717,-25233,-24422,-25494,-26912,-26063,-24834,-26450,-28515,-26758,-24387,-27853,-32548,-24335,0}, 
{-0,21362,31877,30617,25656,24385,26784,28299,26848,24806,24812,26163,26419,25081,23981,24349,25153,24861,23704,23141,23615,24013,23436,22496,22287,22737,22806,22096,21391,21414,21757,21564,20829,20355,20509,20699,20312,19629,19362,19563,19580,19068,18491,18392,18571,18417,17846,17406,17425,17529,17227,16659,16363,16446,16440,16026,15512,15349,15442,15312,14830,14406,14350,14406,14154,13653,13337,13351,13333,12979,12502,12298,12339,12225,11800,11384,11278,11304,11087,10629,10299,10265,10241,9930,9477,9242,9247,9147,8762,8351,8207,8214,8024,7597,7253,7184,7158,6880,6443,6184,6162,6074,5721,5311,5137,5130,4964,4560,4203,4106,4080,3830,3405,3123,3080,3006,2679,2266,2066,2050,1906,1520,1150,1028,1006,781,364,60,-0,-60,-364,-781,-1006,-1028,-1150,-1520,-1906,-2050,-2066,-2266,-2679,-3006,-3080,-3123,-3405,-3830,-4080,-4106,-4203,-4560,-4964,-5130,-5137,-5311,-5721,-6074,-6162,-6184,-6444,-6880,-7158,-7184,-7253,-7597,-8024,-8214,-8207,-8351,-8762,-9147,-9247,-9242,-9477,-9930,-10241,-10265,-10299,-10629,-11087,-11304,-11278,-11384,-11800,-12225,-12339,-12298,-12502,-12979,-13333,-13351,-13337,-13653,-14154,-14406,-14350,-14406,-14830,-15312,-15442,-15349,-15512,-16026,-16440,-16446,-16363,-16659,-17227,-17529,-17425,-17406,-17846,-18417,-18571,-18392,-18491,-19068,-19580,-19563,-19362,-19629,-20312,-20699,-20509,-20355,-20829,-21564,-21757,-21414,-21391,-22096,-22806,-22737,-22287,-22496,-23436,-24013,-23615,-23141,-23704,-24861,-25153,-24349,-23981,-25081,-26419,-26163,-24812,-24806,-26848,-28299,-26784,-24385,-25656,-30617,-31877,-21362,0}, 
{-0,18345,29838,32213,28716,24884,24179,26098,27853,27522,25658,24226,24398,25514,26046,25288,23972,23324,23724,24402,24374,23504,22567,22341,22774,23112,22760,21914,21287,21309,21675,21728,21192,20446,20079,20231,20470,20291,19671,19071,18909,19102,19183,18828,18204,17769,17754,17917,17833,17361,16795,16522,16591,16674,16438,15911,15444,15310,15405,15376,15016,14491,14144,14114,14183,14030,13588,13111,12887,12916,12918,12648,12169,11775,11659,11702,11610,11244,10774,10481,10444,10458,10262,9835,9412,9221,9228,9179,8885,8434,8087,7986,7997,7862,7490,7054,6799,6762,6739,6511,6091,5705,5540,5535,5449,5135,4701,4389,4303,4293,4125,3743,3332,3107,3074,3025,2770,2350,1992,1852,1841,1726,1391,967,684,615,591,394,-0,-394,-591,-615,-684,-967,-1391,-1726,-1841,-1852,-1992,-2350,-2770,-3025,-3074,-3107,-3332,-3743,-4125,-4293,-4303,-4389,-4701,-5135,-5449,-5535,-5540,-5705,-6091,-6511,-6739,-6762,-6799,-7054,-7490,-7862,-7997,-7986,-8087,-8434,-8885,-9179,-9228,-9221,-9412,-9835,-10262,-10458,-10444,-10481,-10774,-11245,-11610,-11702,-11659,-11775,-12169,-12648,-12918,-12916,-12887,-13111,-13588,-14030,-14183,-14114,-14144,-14491,-15016,-15376,-15405,-15310,-15444,-15911,-16438,-16674,-16591,-16522,-16796,-17361,-17833,-17917,-17754,-17769,-18204,-18828,-19183,-19102,-18909,-19071,-19671,-20291,-20470,-20231,-20079,-20446,-21192,-21729,-21675,-21309,-21287,-21914,-22760,-23112,-22774,-22341,-22567,-23504,-24374,-24402,-23724,-23325,-23972,-25288,-26046,-25514,-24398,-24226,-25658,-27522,-27853,-26098,-24179,-24884,-28716,-32214,-29838,-18345,0}, 
{-0,15799,27220,32048,31127,27508,24499,23875,25292,27069,27648,26659,24956,23787,23803,24660,25417,25325,24381,23245,22659,22859,23443,23741,23367,22498,21690,21408,21668,22048,22062,21545,20770,20199,20104,20360,20565,20380,19798,19131,18746,18766,18978,19026,18700,18103,17552,17316,17397,17540,17449,17027,16452,16019,15899,16000,16056,15844,15366,14842,14522,14484,14573,14534,14223,13723,13269,13052,13065,13115,12979,12595,12102,11729,11599,11635,11625,11399,10966,10507,10219,10156,10188,10106,9800,9346,8938,8733,8716,8719,8559,8190,7739,7397,7265,7270,7225,6989,6577,6151,5882,5810,5813,5707,5400,4967,4585,4389,4359,4338,4163,3799,3367,3044,2915,2906,2843,2597,2192,1782,1526,1454,1445,1325,1012,586,218,31,-0,-31,-218,-586,-1012,-1325,-1445,-1454,-1526,-1782,-2192,-2597,-2843,-2906,-2915,-3044,-3367,-3799,-4163,-4338,-4359,-4389,-4585,-4967,-5400,-5707,-5813,-5810,-5882,-6151,-6577,-6989,-7225,-7270,-7265,-7397,-7739,-8190,-8559,-8719,-8716,-8733,-8938,-9346,-9800,-10106,-10188,-10156,-10219,-10507,-10966,-11399,-11625,-11635,-11599,-11729,-12102,-12595,-12979,-13115,-13065,-13052,-13269,-13723,-14223,-14534,-14573,-14484,-14522,-14842,-15366,-15844,-16056,-16000,-15899,-16019,-16452,-17027,-17449,-17540,-17397,-17316,-17552,-18103,-18700,-19026,-18978,-18766,-18746,-19131,-19798,-20380,-20565,-20360,-20104,-20199,-20770,-21546,-22062,-22048,-21668,-21409,-21690,-22498,-23367,-23741,-23443,-22859,-22659,-23245,-24381,-25325,-25417,-24660,-23803,-23787,-24956,-26659,-27649,-27069,-25292,-23875,-24499,-27508,-31128,-32048,-27220,-15799,0}, 
{-0,13497,24255,30525,32107,30264,27059,24445,23520,24263,25803,27027,27193,26257,24782,23548,23099,23470,24234,24787,24709,23979,22951,22119,21820,22059,22530,22814,22633,21995,21176,20537,20314,20485,20799,20936,20696,20112,19415,18893,18716,18843,19058,19101,18824,18275,17660,17217,17071,17169,17315,17290,16987,16463,15908,15522,15399,15475,15569,15494,15170,14666,14157,13816,13711,13770,13822,13707,13367,12879,12407,12102,12012,12056,12075,11926,11572,11098,10657,10383,10306,10338,10327,10150,9784,9321,8908,8661,8595,8615,8579,8376,8000,7547,7159,6936,6879,6891,6831,6605,6220,5776,5410,5209,5162,5164,5082,4836,4441,4006,3661,3481,3442,3436,3334,3067,2664,2237,1912,1752,1721,1707,1585,1299,888,469,163,22,-0,-22,-163,-469,-888,-1299,-1585,-1707,-1721,-1752,-1912,-2237,-2664,-3067,-3334,-3436,-3442,-3481,-3661,-4006,-4441,-4836,-5082,-5164,-5162,-5209,-5410,-5776,-6220,-6605,-6831,-6891,-6879,-6936,-7159,-7547,-8000,-8376,-8579,-8616,-8595,-8661,-8908,-9321,-9784,-10150,-10327,-10338,-10306,-10383,-10657,-11098,-11572,-11926,-12075,-12056,-12012,-12102,-12407,-12879,-13367,-13707,-13822,-13770,-13711,-13816,-14157,-14666,-15170,-15494,-15569,-15475,-15399,-15522,-15908,-16463,-16987,-17290,-17315,-17169,-17071,-17217,-17660,-18275,-18824,-19101,-19058,-18843,-18716,-18893,-19415,-20112,-20696,-20936,-20799,-20485,-20314,-20537,-21176,-21995,-22633,-22814,-22530,-22059,-21820,-22119,-22951,-23979,-24709,-24787,-24234,-23470,-23099,-23548,-24782,-26257,-27193,-27027,-25803,-24263,-23520,-24445,-27059,-30264,-32107,-30525,-24255,-13496,0}, 
{-0,11503,21302,28140,31513,31750,29837,27070,24650,23349,23357,24334,25634,26592,26779,26135,24942,23667,22756,22459,22746,23349,23897,24072,23740,22989,22075,21305,20901,20917,21227,21587,21748,21561,21032,20311,19624,19168,19035,19171,19412,19557,19453,19063,18472,17848,17366,17135,17150,17302,17426,17376,17085,16592,16022,15529,15229,15152,15230,15330,15314,15097,14685,14165,13671,13322,13170,13183,13255,13260,13103,12759,12288,11801,11415,11202,11154,11196,11212,11101,10818,10394,9921,9510,9244,9141,9149,9168,9093,8864,8488,8033,7606,7295,7141,7112,7126,7080,6900,6569,6139,5703,5355,5152,5085,5087,5062,4925,4641,4239,3801,3423,3173,3066,3051,3039,2940,2702,2333,1900,1498,1205,1055,1018,1013,947,753,421,-0,-421,-753,-947,-1013,-1018,-1055,-1205,-1498,-1900,-2333,-2702,-2940,-3039,-3051,-3066,-3173,-3423,-3801,-4239,-4641,-4925,-5062,-5087,-5085,-5152,-5355,-5703,-6139,-6569,-6900,-7080,-7126,-7112,-7141,-7295,-7606,-8033,-8488,-8865,-9093,-9168,-9149,-9141,-9244,-9510,-9921,-10394,-10818,-11101,-11212,-11196,-11154,-11202,-11415,-11801,-12288,-12759,-13103,-13260,-13255,-13183,-13170,-13322,-13672,-14165,-14685,-15097,-15314,-15330,-15230,-15152,-15229,-15529,-16022,-16592,-17085,-17376,-17426,-17302,-17150,-17135,-17366,-17848,-18472,-19063,-19453,-19557,-19412,-19171,-19035,-19168,-19624,-20311,-21032,-21561,-21748,-21587,-21227,-20917,-20901,-21305,-22075,-22989,-23740,-24072,-23897,-23349,-22746,-22459,-22756,-23667,-24942,-26135,-26779,-26592,-25634,-24334,-23357,-23349,-24650,-27070,-29837,-31750,-31513,-28140,-21302,-11503,0}, 
{-0,9867,18650,25477,29845,31699,31410,29661,27273,25017,23456,22852,23153,24060,25145,25992,26308,25994,25151,24025,22925,22119,21763,21859,22272,22781,23153,23213,22896,22258,21452,20672,20093,19816,19842,20078,20370,20553,20507,20188,19641,18979,18349,17879,17642,17634,17780,17957,18040,17936,17615,17117,16537,15993,15587,15374,15348,15440,15548,15569,15427,15103,14635,14107,13619,13256,13061,13023,13080,13142,13120,12952,12624,12176,11683,11233,10901,10720,10675,10709,10739,10686,10497,10166,9730,9262,8840,8532,8362,8315,8333,8339,8262,8057,7720,7292,6841,6442,6152,5993,5945,5953,5942,5845,5625,5283,4859,4420,4038,3764,3616,3570,3571,3547,3435,3202,2852,2429,1999,1629,1370,1233,1192,1189,1155,1030,784,425,-0,-425,-784,-1030,-1155,-1189,-1192,-1233,-1370,-1629,-1999,-2429,-2852,-3202,-3435,-3547,-3571,-3571,-3616,-3764,-4038,-4420,-4859,-5283,-5625,-5845,-5942,-5953,-5946,-5993,-6152,-6442,-6841,-7292,-7720,-8057,-8262,-8339,-8333,-8315,-8362,-8532,-8841,-9262,-9730,-10166,-10497,-10686,-10740,-10709,-10675,-10720,-10901,-11233,-11683,-12176,-12624,-12952,-13120,-13143,-13080,-13023,-13061,-13256,-13619,-14107,-14635,-15103,-15427,-15569,-15548,-15440,-15348,-15374,-15587,-15993,-16537,-17117,-17615,-17936,-18040,-17957,-17780,-17634,-17642,-17879,-18349,-18979,-19641,-20188,-20507,-20553,-20370,-20078,-19842,-19816,-20093,-20672,-21452,-22258,-22896,-23213,-23153,-22781,-22272,-21859,-21763,-22119,-22925,-24025,-25151,-25994,-26309,-25993,-25145,-24060,-23153,-22852,-23456,-25017,-27273,-29661,-31410,-31699,-29845,-25477,-18650,-9867,0}, 
{-0,8198,15768,22166,27002,30091,31462,31344,30115,28238,26183,24358,23054,22411,22421,22947,23765,24623,25286,25589,25457,24912,24062,23070,22113,21349,20881,20740,20887,21224,21616,21929,22050,21917,21526,20928,20218,19509,18907,18493,18299,18312,18469,18684,18858,18906,18775,18452,17967,17386,16791,16267,15877,15656,15599,15664,15786,15887,15897,15769,15485,15065,14557,14027,13545,13168,12929,12829,12839,12905,12963,12952,12826,12569,12190,11728,11239,10783,10412,10160,10031,10003,10033,10064,10040,9919,9681,9331,8900,8437,7997,7629,7364,7214,7160,7165,7179,7149,7034,6811,6482,6074,5628,5197,4827,4552,4384,4311,4300,4303,4271,4163,3954,3643,3250,2815,2387,2013,1727,1545,1457,1434,1433,1404,1304,1108,811,429,-0,-429,-811,-1108,-1304,-1404,-1433,-1434,-1457,-1545,-1727,-2013,-2387,-2815,-3250,-3643,-3954,-4163,-4271,-4303,-4300,-4311,-4384,-4552,-4827,-5197,-5628,-6074,-6482,-6811,-7034,-7149,-7179,-7165,-7160,-7214,-7364,-7629,-7997,-8437,-8900,-9331,-9681,-9919,-10040,-10064,-10033,-10003,-10031,-10160,-10412,-10783,-11239,-11728,-12190,-12569,-12826,-12952,-12963,-12905,-12839,-12829,-12929,-13168,-13545,-14027,-14557,-15065,-15485,-15769,-15897,-15887,-15786,-15664,-15599,-15656,-15877,-16267,-16791,-17386,-17967,-18452,-18775,-18906,-18858,-18684,-18469,-18312,-18299,-18493,-18907,-19509,-20218,-20929,-21526,-21917,-22050,-21929,-21616,-21224,-20887,-20740,-20881,-21349,-22114,-23070,-24062,-24912,-25457,-25589,-25287,-24623,-23765,-22947,-22421,-22411,-23054,-24359,-26183,-28238,-30115,-31344,-31462,-30091,-27002,-22166,-15768,-8198,0}, 
{-0,6929,13474,19287,24092,27706,30056,31181,31219,30390,28965,27234,25474,23919,22738,22027,21799,21997,22511,23194,23891,24459,24789,24817,24529,23962,23191,22316,21448,20688,20113,19767,19657,19751,19989,20292,20573,20756,20781,20618,20268,19758,19143,18490,17869,17342,16955,16729,16659,16715,16851,17006,17120,17143,17038,16792,16413,15930,15390,14844,14345,13937,13647,13483,13435,13471,13549,13621,13640,13570,13388,13092,12696,12230,11736,11257,10836,10504,10277,10155,10121,10143,10183,10197,10151,10016,9780,9448,9040,8586,8125,7697,7334,7058,6879,6788,6765,6776,6785,6756,6657,6471,6193,5833,5414,4970,4537,4149,3833,3605,3466,3401,3387,3389,3373,3305,3162,2931,2615,2230,1803,1368,959,608,335,150,46,6,-0,-6,-46,-150,-335,-608,-959,-1368,-1803,-2230,-2615,-2931,-3162,-3305,-3373,-3389,-3387,-3401,-3466,-3605,-3833,-4149,-4537,-4970,-5414,-5833,-6193,-6471,-6657,-6756,-6785,-6776,-6765,-6788,-6879,-7058,-7334,-7697,-8125,-8586,-9040,-9449,-9780,-10016,-10151,-10197,-10183,-10143,-10121,-10155,-10277,-10504,-10836,-11257,-11736,-12230,-12696,-13092,-13388,-13570,-13640,-13621,-13549,-13471,-13435,-13483,-13647,-13937,-14345,-14844,-15390,-15930,-16413,-16792,-17038,-17143,-17120,-17006,-16851,-16715,-16659,-16729,-16955,-17342,-17869,-18490,-19143,-19758,-20268,-20618,-20781,-20756,-20573,-20292,-19989,-19751,-19657,-19767,-20113,-20688,-21448,-22316,-23191,-23962,-24529,-24817,-24789,-24459,-23891,-23194,-22511,-21997,-21799,-22027,-22738,-23919,-25474,-27234,-28965,-30390,-31219,-31181,-30056,-27706,-24092,-19287,-13474,-6929,0}, 
{-0,5647,11082,16107,20549,24274,27193,29265,30500,30957,30732,29957,28781,27365,25865,24422,23153,22145,21449,21081,21024,21230,21633,22149,22694,23185,23552,23743,23728,23498,23069,22476,21769,21004,20244,19545,18955,18507,18220,18091,18105,18230,18425,18642,18835,18961,18985,18886,18655,18299,17837,17299,16720,16142,15602,15134,14761,14499,14348,14297,14327,14408,14507,14589,14622,14581,14449,14217,13891,13483,13016,12517,12018,11549,11135,10797,10547,10386,10306,10291,10318,10360,10389,10377,10304,10154,9922,9609,9228,8796,8338,7879,7445,7060,6741,6497,6332,6238,6201,6201,6214,6215,6180,6089,5930,5696,5390,5021,4606,4167,3728,3312,2942,2632,2393,2227,2127,2081,2069,2070,2059,2013,1915,1750,1514,1209,843,433,-0,-433,-843,-1209,-1514,-1750,-1915,-2013,-2059,-2070,-2069,-2081,-2127,-2227,-2393,-2632,-2942,-3312,-3728,-4167,-4606,-5021,-5390,-5696,-5930,-6089,-6180,-6215,-6214,-6201,-6201,-6238,-6332,-6497,-6741,-7060,-7445,-7879,-8338,-8796,-9228,-9610,-9922,-10154,-10304,-10377,-10389,-10360,-10318,-10291,-10306,-10386,-10547,-10797,-11135,-11549,-12018,-12517,-13016,-13483,-13891,-14217,-14449,-14581,-14622,-14589,-14507,-14408,-14327,-14297,-14348,-14499,-14761,-15134,-15602,-16142,-16720,-17299,-17837,-18299,-18655,-18886,-18985,-18961,-18835,-18642,-18425,-18230,-18105,-18091,-18220,-18507,-18955,-19545,-20244,-21004,-21769,-22476,-23069,-23498,-23728,-23743,-23552,-23185,-22694,-22149,-21633,-21230,-21024,-21081,-21449,-22145,-23153,-24422,-25865,-27365,-28781,-29957,-30732,-30957,-30500,-29265,-27193,-24274,-20549,-16107,-11082,-5647,0}, 
{-0,4787,9442,13839,17867,21427,24447,26876,28690,29892,30510,30595,30218,29465,28428,27208,25903,24602,23387,22323,21457,20821,20423,20258,20301,20516,20858,21274,21710,22116,22446,22662,22737,22659,22424,22042,21535,20929,20261,19568,18887,18254,17699,17244,16903,16682,16575,16570,16647,16778,16936,17090,17211,17275,17260,17154,16950,16651,16265,15808,15300,14766,14231,13718,13252,12849,12524,12281,12122,12040,12022,12051,12108,12169,12214,12221,12174,12061,11873,11611,11278,10886,10448,9982,9508,9047,8617,8234,7911,7655,7468,7346,7282,7263,7271,7290,7301,7285,7226,7114,6939,6699,6397,6038,5636,5204,4759,4320,3904,3526,3198,2929,2723,2578,2488,2443,2428,2429,2426,2404,2347,2242,2080,1858,1575,1236,852,434,-0,-434,-852,-1236,-1575,-1858,-2080,-2242,-2347,-2404,-2426,-2429,-2428,-2443,-2488,-2578,-2723,-2929,-3198,-3526,-3904,-4320,-4759,-5204,-5636,-6038,-6397,-6699,-6939,-7114,-7226,-7285,-7301,-7290,-7271,-7263,-7282,-7346,-7468,-7655,-7911,-8234,-8617,-9047,-9508,-9982,-10448,-10886,-11278,-11611,-11873,-12061,-12174,-12221,-12214,-12169,-12108,-12051,-12022,-12040,-12122,-12281,-12524,-12849,-13252,-13719,-14231,-14766,-15301,-15808,-16265,-16651,-16950,-17154,-17260,-17275,-17211,-17090,-16936,-16778,-16647,-16570,-16575,-16682,-16903,-17244,-17699,-18254,-18887,-19568,-20261,-20929,-21535,-22042,-22424,-22659,-22737,-22662,-22446,-22116,-21710,-21274,-20858,-20516,-20301,-20258,-20423,-20821,-21457,-22323,-23387,-24602,-25903,-27209,-28428,-29465,-30218,-30595,-30510,-29892,-28690,-26876,-24447,-21427,-17867,-13839,-9442,-4787,0}, 
{-0,3922,7769,11470,14958,18171,21057,23576,25698,27403,28688,29557,30030,30135,29910,29401,28658,27737,26693,25582,24456,23363,22345,21438,20666,20050,19596,19306,19171,19178,19304,19525,19811,20133,20460,20762,21015,21196,21286,21276,21157,20930,20600,20178,19678,19117,18517,17900,17286,16698,16152,15667,15252,14918,14666,14497,14405,14381,14413,14486,14583,14687,14780,14846,14871,14843,14752,14594,14366,14071,13715,13305,12854,12374,11880,11387,10910,10462,10056,9699,9399,9160,8981,8859,8789,8761,8765,8788,8818,8840,8842,8813,8742,8622,8449,8220,7937,7604,7227,6815,6379,5931,5484,5049,4638,4262,3928,3642,3409,3227,3095,3009,2960,2939,2935,2938,2934,2913,2864,2777,2646,2466,2236,1955,1628,1259,859,435,-0,-435,-859,-1259,-1628,-1955,-2236,-2466,-2646,-2777,-2864,-2913,-2934,-2938,-2936,-2939,-2960,-3009,-3095,-3227,-3409,-3642,-3928,-4262,-4638,-5049,-5484,-5931,-6379,-6815,-7227,-7604,-7937,-8220,-8449,-8622,-8742,-8813,-8842,-8840,-8818,-8788,-8765,-8761,-8789,-8859,-8981,-9160,-9399,-9699,-10056,-10462,-10910,-11387,-11880,-12374,-12854,-13305,-13715,-14071,-14366,-14594,-14752,-14843,-14871,-14846,-14780,-14687,-14583,-14486,-14413,-14381,-14405,-14497,-14666,-14918,-15252,-15667,-16153,-16698,-17286,-17900,-18518,-19117,-19678,-20178,-20600,-20930,-21157,-21276,-21286,-21196,-21015,-20762,-20460,-20133,-19811,-19525,-19304,-19178,-19171,-19306,-19596,-20050,-20667,-21438,-22345,-23363,-24456,-25582,-26693,-27737,-28658,-29401,-29910,-30135,-30030,-29557,-28688,-27403,-25698,-23576,-21057,-18171,-14958,-11471,-7769,-3922,0}, 
{-0,3488,6923,10253,13428,16403,19138,21598,23757,25594,27098,28264,29097,29607,29813,29739,29416,28877,28160,27304,26350,25337,24303,23284,22312,21414,20613,19927,19365,18936,18638,18466,18412,18461,18596,18798,19046,19316,19589,19842,20057,20218,20310,20324,20252,20093,19847,19518,19115,18648,18129,17574,16998,16416,15845,15299,14791,14332,13932,13596,13327,13126,12991,12915,12892,12912,12963,13034,13111,13182,13234,13257,13240,13176,13059,12886,12656,12370,12032,11649,11228,10778,10310,9835,9363,8907,8475,8076,7718,7407,7145,6934,6772,6658,6585,6548,6538,6545,6560,6573,6573,6552,6501,6414,6284,6108,5886,5616,5303,4949,4562,4148,3717,3277,2838,2410,2002,1621,1274,968,705,488,316,187,98,42,13,2,-0,-2,-13,-42,-98,-187,-316,-488,-705,-968,-1274,-1621,-2002,-2410,-2838,-3277,-3717,-4148,-4562,-4949,-5303,-5616,-5886,-6108,-6284,-6414,-6501,-6552,-6573,-6573,-6560,-6545,-6538,-6548,-6585,-6658,-6772,-6934,-7145,-7407,-7718,-8076,-8475,-8907,-9363,-9835,-10310,-10778,-11228,-11649,-12032,-12370,-12656,-12886,-13059,-13176,-13240,-13257,-13234,-13182,-13111,-13034,-12963,-12912,-12892,-12915,-12991,-13126,-13327,-13596,-13932,-14332,-14791,-15299,-15845,-16416,-16998,-17574,-18129,-18648,-19115,-19518,-19847,-20093,-20252,-20324,-20310,-20218,-20057,-19842,-19589,-19316,-19046,-18798,-18596,-18461,-18412,-18466,-18638,-18936,-19365,-19927,-20613,-21414,-22312,-23284,-24303,-25337,-26350,-27304,-28160,-28877,-29416,-29739,-29813,-29607,-29097,-28264,-27098,-25594,-23757,-21598,-19138,-16403,-13428,-10253,-6923,-3488,0}, 
{-0,3054,6071,9016,11854,14552,17081,19414,21530,23410,25041,26413,27522,28370,28961,29305,29416,29311,29012,28541,27924,27188,26360,25468,24538,23598,22670,21778,20940,20173,19490,18901,18412,18027,17744,17561,17471,17465,17532,17659,17831,18034,18253,18472,18678,18856,18995,19084,19115,19082,18981,18811,18572,18267,17902,17483,17017,16516,15989,15447,14902,14363,13843,13350,12892,12477,12111,11797,11536,11330,11177,11073,11013,10992,11002,11035,11081,11133,11180,11215,11228,11212,11162,11072,10938,10758,10531,10260,9945,9590,9202,8785,8347,7895,7437,6982,6538,6110,5708,5336,4999,4701,4444,4230,4057,3925,3829,3765,3728,3712,3710,3714,3717,3712,3690,3647,3576,3472,3331,3151,2932,2672,2373,2038,1672,1279,865,436,-0,-436,-865,-1279,-1672,-2038,-2373,-2672,-2932,-3152,-3331,-3472,-3576,-3647,-3690,-3712,-3717,-3714,-3710,-3712,-3728,-3765,-3829,-3925,-4057,-4230,-4444,-4701,-4999,-5336,-5708,-6110,-6538,-6982,-7437,-7895,-8347,-8785,-9202,-9590,-9945,-10260,-10532,-10758,-10938,-11072,-11162,-11212,-11228,-11215,-11180,-11133,-11081,-11035,-11002,-10992,-11013,-11073,-11177,-11330,-11536,-11797,-12111,-12477,-12892,-13350,-13843,-14363,-14902,-15447,-15989,-16516,-17017,-17483,-17902,-18268,-18572,-18811,-18981,-19082,-19115,-19084,-18995,-18856,-18678,-18472,-18253,-18034,-17831,-17659,-17532,-17465,-17471,-17561,-17744,-18027,-18412,-18901,-19490,-20173,-20940,-21778,-22670,-23598,-24538,-25468,-26360,-27188,-27924,-28541,-29012,-29311,-29416,-29305,-28961,-28370,-27522,-26413,-25041,-23410,-21530,-19414,-17081,-14552,-11854,-9016,-6071,-3054,0}, 
{-0,2619,5214,7762,10239,12625,14898,17040,19035,20867,22524,23997,25278,26364,27252,27943,28442,28754,28887,28852,28663,28332,27876,27311,26654,25924,25139,24315,23472,22625,21790,20981,20211,19492,18832,18240,17721,17278,16914,16627,16417,16280,16209,16200,16243,16330,16453,16601,16764,16932,17096,17246,17373,17469,17529,17545,17514,17432,17297,17109,16869,16577,16239,15857,15437,14984,14507,14011,13503,12992,12485,11989,11510,11055,10629,10237,9882,9567,9295,9065,8877,8730,8620,8546,8503,8485,8488,8505,8531,8559,8583,8598,8596,8574,8525,8447,8337,8191,8008,7788,7531,7239,6913,6556,6173,5768,5344,4909,4467,4024,3585,3156,2743,2350,1982,1641,1332,1056,814,608,436,298,190,112,58,25,7,1,-0,-1,-7,-25,-58,-112,-190,-298,-436,-608,-814,-1056,-1332,-1641,-1982,-2350,-2743,-3156,-3585,-4024,-4467,-4909,-5344,-5768,-6173,-6556,-6913,-7239,-7531,-7788,-8008,-8191,-8337,-8448,-8525,-8574,-8596,-8598,-8583,-8559,-8531,-8505,-8488,-8485,-8503,-8546,-8620,-8730,-8877,-9065,-9295,-9567,-9882,-10237,-10629,-11055,-11510,-11989,-12485,-12992,-13503,-14011,-14507,-14985,-15437,-15857,-16239,-16577,-16869,-17109,-17297,-17432,-17514,-17545,-17529,-17469,-17373,-17246,-17096,-16932,-16764,-16601,-16453,-16330,-16243,-16200,-16209,-16280,-16417,-16627,-16914,-17278,-17721,-18240,-18832,-19492,-20211,-20981,-21790,-22625,-23472,-24315,-25139,-25924,-26654,-27311,-27876,-28332,-28663,-28852,-28887,-28754,-28442,-27943,-27252,-26364,-25278,-23997,-22524,-20867,-19035,-17040,-14898,-12625,-10239,-7762,-5214,-2619,0}, 
{-0,2183,4352,6493,8590,10631,12603,14494,16292,17987,19570,21032,22367,23569,24634,25559,26343,26985,27488,27852,28084,28186,28167,28032,27790,27450,27022,26515,25940,25308,24631,23917,23180,22428,21673,20924,20189,19478,18797,18154,17553,17001,16500,16054,15664,15330,15054,14833,14665,14548,14478,14450,14461,14504,14574,14665,14771,14886,15002,15116,15219,15308,15377,15421,15437,15420,15369,15280,15153,14986,14780,14535,14252,13934,13583,13202,12793,12362,11913,11449,10976,10498,10020,9546,9082,8631,8197,7784,7395,7033,6700,6398,6128,5890,5685,5511,5368,5254,5167,5104,5063,5039,5029,5030,5037,5046,5053,5055,5046,5024,4984,4925,4842,4735,4600,4436,4243,4021,3768,3487,3179,2844,2485,2105,1707,1294,869,436,-0,-437,-869,-1294,-1707,-2105,-2485,-2844,-3179,-3487,-3769,-4021,-4243,-4436,-4600,-4735,-4842,-4925,-4984,-5024,-5046,-5055,-5053,-5046,-5037,-5030,-5029,-5039,-5063,-5104,-5167,-5254,-5368,-5511,-5685,-5890,-6128,-6398,-6700,-7033,-7395,-7784,-8197,-8631,-9082,-9546,-10020,-10498,-10976,-11449,-11913,-12362,-12793,-13202,-13583,-13934,-14252,-14535,-14780,-14986,-15153,-15280,-15369,-15420,-15437,-15421,-15377,-15308,-15219,-15116,-15002,-14886,-14771,-14665,-14574,-14504,-14461,-14450,-14478,-14548,-14665,-14833,-15054,-15330,-15664,-16054,-16500,-17001,-17553,-18154,-18797,-19478,-20189,-20924,-21673,-22428,-23180,-23917,-24631,-25308,-25940,-26515,-27022,-27450,-27790,-28032,-28167,-28186,-28084,-27852,-27488,-26985,-26343,-25559,-24634,-23569,-22367,-21032,-19570,-17987,-16292,-14494,-12603,-10631,-8590,-6493,-4352,-2183,0}, 
{-0,1747,3487,5210,6911,8580,10211,11797,13330,14805,16216,17556,18822,20008,21110,22126,23052,23886,24626,25272,25824,26281,26644,26915,27095,27188,27197,27124,26974,26752,26462,26109,25699,25237,24728,24180,23598,22987,22355,21706,21047,20384,19721,19064,18417,17787,17176,16588,16028,15498,15000,14538,14112,13724,13374,13064,12792,12559,12363,12203,12078,11985,11921,11886,11874,11885,11913,11956,12011,12073,12140,12208,12273,12333,12383,12421,12444,12450,12436,12399,12339,12254,12142,12003,11835,11640,11417,11166,10889,10586,10258,9908,9537,9147,8740,8319,7887,7446,6999,6548,6097,5648,5204,4768,4342,3929,3530,3149,2786,2444,2123,1825,1551,1301,1076,875,698,545,414,305,217,146,93,54,28,12,4,0,-0,-0,-4,-12,-28,-54,-93,-146,-217,-305,-414,-545,-698,-875,-1076,-1301,-1551,-1825,-2123,-2444,-2786,-3149,-3530,-3929,-4342,-4768,-5204,-5648,-6097,-6548,-6999,-7446,-7887,-8319,-8740,-9147,-9537,-9908,-10258,-10586,-10889,-11166,-11417,-11640,-11836,-12003,-12142,-12254,-12339,-12399,-12436,-12450,-12444,-12421,-12383,-12333,-12273,-12208,-12140,-12073,-12011,-11956,-11913,-11885,-11874,-11886,-11921,-11985,-12078,-12203,-12363,-12559,-12792,-13064,-13374,-13724,-14112,-14538,-15000,-15498,-16028,-16588,-17176,-17787,-18417,-19064,-19721,-20384,-21047,-21706,-22355,-22987,-23598,-24180,-24728,-25237,-25699,-26109,-26462,-26752,-26974,-27124,-27197,-27188,-27095,-26915,-26644,-26281,-25824,-25272,-24626,-23886,-23052,-22126,-21110,-20008,-18822,-17556,-16216,-14805,-13330,-11797,-10211,-8580,-6911,-5211,-3487,-1747,0}, 
{-0,1311,2618,3918,5207,6481,7737,8972,10181,11363,12513,13629,14708,15746,16743,17694,18599,19454,20259,21011,21710,22353,22941,23472,23947,24363,24723,25025,25270,25459,25593,25673,25699,25673,25597,25473,25302,25087,24829,24531,24196,23826,23423,22991,22531,22048,21543,21020,20481,19929,19368,18799,18226,17651,17077,16506,15941,15384,14837,14302,13782,13277,12790,12322,11874,11448,11044,10664,10307,9974,9666,9383,9125,8890,8680,8494,8330,8189,8068,7968,7886,7822,7775,7741,7722,7713,7715,7724,7740,7761,7784,7809,7833,7854,7871,7883,7887,7882,7867,7841,7801,7747,7678,7593,7491,7371,7233,7076,6900,6705,6490,6257,6004,5733,5443,5136,4812,4472,4117,3748,3365,2971,2567,2153,1732,1304,872,437,-0,-437,-872,-1304,-1732,-2153,-2567,-2971,-3365,-3748,-4117,-4472,-4812,-5136,-5443,-5733,-6004,-6257,-6490,-6705,-6900,-7076,-7233,-7371,-7491,-7593,-7678,-7747,-7801,-7841,-7867,-7882,-7887,-7883,-7871,-7854,-7833,-7809,-7784,-7761,-7740,-7724,-7715,-7713,-7722,-7742,-7775,-7822,-7886,-7968,-8068,-8189,-8330,-8494,-8680,-8891,-9125,-9383,-9666,-9974,-10307,-10664,-11044,-11448,-11874,-12322,-12790,-13277,-13782,-14302,-14837,-15384,-15941,-16506,-17077,-17651,-18226,-18799,-19368,-19929,-20481,-21020,-21543,-22048,-22531,-22991,-23423,-23826,-24196,-24531,-24829,-25087,-25302,-25473,-25597,-25673,-25699,-25673,-25593,-25459,-25270,-25025,-24723,-24363,-23947,-23472,-22941,-22353,-21710,-21011,-20259,-19454,-18599,-17694,-16743,-15746,-14708,-13629,-12513,-11363,-10181,-8972,-7737,-6481,-5207,-3918,-2618,-1311,0}, 
{-0,1311,2618,3918,5207,6481,7737,8972,10181,11363,12513,13629,14708,15746,16743,17694,18599,19454,20259,21011,21710,22353,22941,23472,23947,24363,24723,25025,25270,25459,25593,25673,25699,25673,25597,25473,25302,25087,24829,24531,24196,23826,23423,22991,22531,22048,21543,21020,20481,19929,19368,18799,18226,17651,17077,16506,15941,15384,14837,14302,13782,13277,12790,12322,11874,11448,11044,10664,10307,9974,9666,9383,9125,8890,8680,8494,8330,8189,8068,7968,7886,7822,7775,7741,7722,7713,7715,7724,7740,7761,7784,7809,7833,7854,7871,7883,7887,7882,7867,7841,7801,7747,7678,7593,7491,7371,7233,7076,6900,6705,6490,6257,6004,5733,5443,5136,4812,4472,4117,3748,3365,2971,2567,2153,1732,1304,872,437,-0,-437,-872,-1304,-1732,-2153,-2567,-2971,-3365,-3748,-4117,-4472,-4812,-5136,-5443,-5733,-6004,-6257,-6490,-6705,-6900,-7076,-7233,-7371,-7491,-7593,-7678,-7747,-7801,-7841,-7867,-7882,-7887,-7883,-7871,-7854,-7833,-7809,-7784,-7761,-7740,-7724,-7715,-7713,-7722,-7742,-7775,-7822,-7886,-7968,-8068,-8189,-8330,-8494,-8680,-8891,-9125,-9383,-9666,-9974,-10307,-10664,-11044,-11448,-11874,-12322,-12790,-13277,-13782,-14302,-14837,-15384,-15941,-16506,-17077,-17651,-18226,-18799,-19368,-19929,-20481,-21020,-21543,-22048,-22531,-22991,-23423,-23826,-24196,-24531,-24829,-25087,-25302,-25473,-25597,-25673,-25699,-25673,-25593,-25459,-25270,-25025,-24723,-24363,-23947,-23472,-22941,-22353,-21710,-21011,-20259,-19454,-18599,-17694,-16743,-15746,-14708,-13629,-12513,-11363,-10181,-8972,-7737,-6481,-5207,-3918,-2618,-1311,0}, 
{-0,874,1747,2617,3483,4344,5199,6045,6883,7710,8526,9329,10118,10892,11650,12391,13114,13817,14500,15161,15801,16418,17011,17580,18123,18641,19133,19597,20034,20443,20824,21177,21500,21795,22060,22296,22503,22681,22829,22948,23038,23099,23132,23136,23113,23063,22986,22882,22753,22599,22420,22218,21992,21745,21476,21186,20877,20550,20204,19842,19463,19070,18663,18243,17812,17369,16917,16457,15988,15514,15034,14549,14061,13571,13080,12588,12097,11607,11121,10637,10158,9685,9217,8757,8303,7859,7423,6997,6582,6177,5784,5403,5034,4678,4335,4005,3689,3387,3099,2825,2565,2319,2088,1871,1668,1478,1303,1141,991,855,731,619,519,430,351,282,223,172,130,95,67,45,28,16,8,4,1,0,-0,-0,-1,-4,-8,-16,-28,-45,-67,-95,-130,-172,-223,-282,-351,-430,-519,-619,-731,-855,-991,-1141,-1303,-1478,-1668,-1871,-2088,-2319,-2565,-2825,-3099,-3387,-3689,-4005,-4335,-4678,-5034,-5403,-5784,-6177,-6582,-6997,-7423,-7859,-8304,-8757,-9217,-9685,-10158,-10637,-11121,-11607,-12097,-12588,-13080,-13571,-14061,-14549,-15034,-15514,-15988,-16457,-16917,-17369,-17812,-18243,-18663,-19070,-19463,-19842,-20204,-20550,-20877,-21186,-21476,-21745,-21992,-22218,-22420,-22599,-22753,-22882,-22986,-23063,-23113,-23136,-23132,-23099,-23038,-22948,-22829,-22681,-22503,-22296,-22060,-21795,-21500,-21177,-20824,-20443,-20034,-19597,-19133,-18641,-18123,-17580,-17011,-16418,-15801,-15161,-14500,-13817,-13114,-12391,-11650,-10892,-10118,-9329,-8526,-7710,-6883,-6045,-5199,-4344,-3483,-2617,-1747,-874,0}, 
{-0,874,1747,2617,3483,4344,5199,6045,6883,7710,8526,9329,10118,10892,11650,12391,13114,13817,14500,15161,15801,16418,17011,17580,18123,18641,19133,19597,20034,20443,20824,21177,21500,21795,22060,22296,22503,22681,22829,22948,23038,23099,23132,23136,23113,23063,22986,22882,22753,22599,22420,22218,21992,21745,21476,21186,20877,20550,20204,19842,19463,19070,18663,18243,17812,17369,16917,16457,15988,15514,15034,14549,14061,13571,13080,12588,12097,11607,11121,10637,10158,9685,9217,8757,8303,7859,7423,6997,6582,6177,5784,5403,5034,4678,4335,4005,3689,3387,3099,2825,2565,2319,2088,1871,1668,1478,1303,1141,991,855,731,619,519,430,351,282,223,172,130,95,67,45,28,16,8,4,1,0,-0,-0,-1,-4,-8,-16,-28,-45,-67,-95,-130,-172,-223,-282,-351,-430,-519,-619,-731,-855,-991,-1141,-1303,-1478,-1668,-1871,-2088,-2319,-2565,-2825,-3099,-3387,-3689,-4005,-4335,-4678,-5034,-5403,-5784,-6177,-6582,-6997,-7423,-7859,-8304,-8757,-9217,-9685,-10158,-10637,-11121,-11607,-12097,-12588,-13080,-13571,-14061,-14549,-15034,-15514,-15988,-16457,-16917,-17369,-17812,-18243,-18663,-19070,-19463,-19842,-20204,-20550,-20877,-21186,-21476,-21745,-21992,-22218,-22420,-22599,-22753,-22882,-22986,-23063,-23113,-23136,-23132,-23099,-23038,-22948,-22829,-22681,-22503,-22296,-22060,-21795,-21500,-21177,-20824,-20443,-20034,-19597,-19133,-18641,-18123,-17580,-17011,-16418,-15801,-15161,-14500,-13817,-13114,-12391,-11650,-10892,-10118,-9329,-8526,-7710,-6883,-6045,-5199,-4344,-3483,-2617,-1747,-874,0}, 
{-0,874,1747,2617,3483,4344,5199,6045,6883,7710,8526,9329,10118,10892,11650,12391,13114,13817,14500,15161,15801,16418,17011,17580,18123,18641,19133,19597,20034,20443,20824,21177,21500,21795,22060,22296,22503,22681,22829,22948,23038,23099,23132,23136,23113,23063,22986,22882,22753,22599,22420,22218,21992,21745,21476,21186,20877,20550,20204,19842,19463,19070,18663,18243,17812,17369,16917,16457,15988,15514,15034,14549,14061,13571,13080,12588,12097,11607,11121,10637,10158,9685,9217,8757,8303,7859,7423,6997,6582,6177,5784,5403,5034,4678,4335,4005,3689,3387,3099,2825,2565,2319,2088,1871,1668,1478,1303,1141,991,855,731,619,519,430,351,282,223,172,130,95,67,45,28,16,8,4,1,0,-0,-0,-1,-4,-8,-16,-28,-45,-67,-95,-130,-172,-223,-282,-351,-430,-519,-619,-731,-855,-991,-1141,-1303,-1478,-1668,-1871,-2088,-2319,-2565,-2825,-3099,-3387,-3689,-4005,-4335,-4678,-5034,-5403,-5784,-6177,-6582,-6997,-7423,-7859,-8304,-8757,-9217,-9685,-10158,-10637,-11121,-11607,-12097,-12588,-13080,-13571,-14061,-14549,-15034,-15514,-15988,-16457,-16917,-17369,-17812,-18243,-18663,-19070,-19463,-19842,-20204,-20550,-20877,-21186,-21476,-21745,-21992,-22218,-22420,-22599,-22753,-22882,-22986,-23063,-23113,-23136,-23132,-23099,-23038,-22948,-22829,-22681,-22503,-22296,-22060,-21795,-21500,-21177,-20824,-20443,-20034,-19597,-19133,-18641,-18123,-17580,-17011,-16418,-15801,-15161,-14500,-13817,-13114,-12391,-11650,-10892,-10118,-9329,-8526,-7710,-6883,-6045,-5199,-4344,-3483,-2617,-1747,-874,0}, 
{-0,437,874,1310,1746,2180,2613,3045,3475,3903,4328,4751,5170,5587,6001,6410,6816,7218,7615,8008,8396,8779,9157,9529,9896,10256,10610,10958,11300,11634,11962,12282,12595,12900,13197,13487,13769,14042,14306,14562,14810,15048,15277,15498,15708,15910,16101,16283,16456,16618,16770,16913,17045,17166,17278,17379,17469,17549,17619,17678,17726,17763,17790,17806,17812,17806,17790,17763,17726,17678,17619,17549,17469,17379,17278,17166,17045,16913,16770,16618,16456,16283,16101,15910,15708,15498,15277,15048,14810,14562,14306,14042,13769,13487,13197,12900,12595,12282,11962,11634,11300,10958,10610,10256,9896,9529,9157,8779,8396,8008,7615,7218,6816,6410,6001,5587,5170,4751,4328,3903,3475,3045,2613,2180,1746,1310,874,437,-0,-437,-874,-1310,-1746,-2180,-2614,-3045,-3475,-3903,-4328,-4751,-5170,-5587,-6001,-6410,-6816,-7218,-7615,-8008,-8396,-8779,-9157,-9529,-9896,-10256,-10610,-10958,-11300,-11634,-11962,-12282,-12595,-12900,-13197,-13487,-13769,-14042,-14306,-14562,-14810,-15048,-15277,-15498,-15708,-15910,-16101,-16284,-16456,-16618,-16770,-16913,-17045,-17166,-17278,-17379,-17469,-17549,-17619,-17678,-17726,-17763,-17790,-17806,-17812,-17806,-17790,-17763,-17726,-17678,-17619,-17549,-17469,-17379,-17278,-17166,-17045,-16913,-16770,-16618,-16456,-16284,-16101,-15910,-15708,-15498,-15277,-15048,-14810,-14562,-14306,-14042,-13769,-13487,-13197,-12900,-12595,-12282,-11962,-11634,-11300,-10958,-10610,-10256,-9896,-9529,-9157,-8779,-8396,-8008,-7615,-7218,-6816,-6410,-6001,-5587,-5170,-4751,-4328,-3903,-3475,-3045,-2614,-2180,-1746,-1310,-874,-437,0}, 
{-0,437,874,1310,1746,2180,2613,3045,3475,3903,4328,4751,5170,5587,6001,6410,6816,7218,7615,8008,8396,8779,9157,9529,9896,10256,10610,10958,11300,11634,11962,12282,12595,12900,13197,13487,13769,14042,14306,14562,14810,15048,15277,15498,15708,15910,16101,16283,16456,16618,16770,16913,17045,17166,17278,17379,17469,17549,17619,17678,17726,17763,17790,17806,17812,17806,17790,17763,17726,17678,17619,17549,17469,17379,17278,17166,17045,16913,16770,16618,16456,16283,16101,15910,15708,15498,15277,15048,14810,14562,14306,14042,13769,13487,13197,12900,12595,12282,11962,11634,11300,10958,10610,10256,9896,9529,9157,8779,8396,8008,7615,7218,6816,6410,6001,5587,5170,4751,4328,3903,3475,3045,2613,2180,1746,1310,874,437,-0,-437,-874,-1310,-1746,-2180,-2614,-3045,-3475,-3903,-4328,-4751,-5170,-5587,-6001,-6410,-6816,-7218,-7615,-8008,-8396,-8779,-9157,-9529,-9896,-10256,-10610,-10958,-11300,-11634,-11962,-12282,-12595,-12900,-13197,-13487,-13769,-14042,-14306,-14562,-14810,-15048,-15277,-15498,-15708,-15910,-16101,-16284,-16456,-16618,-16770,-16913,-17045,-17166,-17278,-17379,-17469,-17549,-17619,-17678,-17726,-17763,-17790,-17806,-17812,-17806,-17790,-17763,-17726,-17678,-17619,-17549,-17469,-17379,-17278,-17166,-17045,-16913,-16770,-16618,-16456,-16284,-16101,-15910,-15708,-15498,-15277,-15048,-14810,-14562,-14306,-14042,-13769,-13487,-13197,-12900,-12595,-12282,-11962,-11634,-11300,-10958,-10610,-10256,-9896,-9529,-9157,-8779,-8396,-8008,-7615,-7218,-6816,-6410,-6001,-5587,-5170,-4751,-4328,-3903,-3475,-3045,-2614,-2180,-1746,-1310,-874,-437,0}, 
};
 
Now we need to find a way to use it with Teensy. The way you use the Arbitrary Waveform is calling the right array. To do that I created a function that would convert frequency into an index, then this index would be used to call the right array. So, the way to do that is using like this:
Code:
waveform.arbitraryWaveform(sawtoothWavetable[oscFreqIndex(frequency)], maxFreq);
Being "oscFreqIndex: the function that will do the conversion. And forget "maxFreq, it's not being used by the library.

In the end I came up with a code like that:
Code:
#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>

// GUItool: begin automatically generated code
AudioSynthWaveform       waveform;      //xy=2631.2500381469727,2188.7500324249268
AudioMixer4              mixer;         //xy=2810,2223.75
AudioOutputI2S           i2s;           //xy=2973,2226
AudioConnection          patchCord1(waveform, 0, mixer, 0);
AudioConnection          patchCord2(mixer, 0, i2s, 0);
AudioConnection          patchCord3(mixer, 0, i2s, 1);
AudioControlSGTL5000     sgtl5000_1;     //xy=2841,2312
// GUItool: end automatically generated code



/* include some wavetables: the files need to contain arrays [256] of type const short int wt1[] = { ... } */


//#include "SineWave.h"
#include "sineWave257_16bit.h"
#include "sawtoohWave257_16bit.h"
#include "sawtoothWavetable.h"


// OSC 1
int osc1 = WAVEFORM_ARBITRARY;
float osc1freq = 440;
float osc1level = 0.5;
int osc1FreqIndex = (osc1freq / 3) + 1;

// OSC 2
int osc2 = WAVEFORM_SAWTOOTH;
int osc2freq = 150;
float osc2level = 0.5;

// mixers
float mixer1Gain0 = 0.5; // osc 1
float mixer1Gain1 = 0.5; // osc 2

int maxFreq = 20000;

void setup() {
  Serial.begin(9600);

  AudioMemory(12);
  Serial.begin(115200);
  sgtl5000_1.enable();
  sgtl5000_1.volume(0.45);

  waveform.begin(osc1level, osc1freq, osc1);

  waveform.arbitraryWaveform(sawtoothWavetable[oscFreqIndex(osc1freq)], maxFreq);

  mixer.gain(0, mixer1Gain0);


  waveform.frequency(osc1freq);

}

void loop() {


  waveform.begin(WAVEFORM_ARBITRARY);
  for (int i = 1; i < 110; i++) {
    waveform.arbitraryWaveform(sawtoothWavetable[oscFreqIndex(midiToFreq(i))], maxFreq);
    waveform.frequency(midiToFreq(i));
    delay(200);
  }

  delay(1000);
  waveform.begin(WAVEFORM_SAWTOOTH);
  for (int i = 1; i < 110; i++) {
    waveform.frequency(midiToFreq(i));
    delay(200);
  }

}

int oscFreqIndex(float freq)
{
  int freqIndex = (freqToMidi(freq) / 3) + 1;
  return freqIndex;
}

float midiToFreq(float midival)
{
  float f = 0.0;
  if (midival) f = 8.1757989156 * pow(2.0, midival / 12.0);
  return f;
}

float freqToMidi(float f)
{
  int midival = log(f / 440.0) / log(2) * 12 + 69;
  return midival;
}

This code compare the built in Sawtooth and my sawtooth, so you can compare the aliasing. Don't forget to put the wavetable ".h" file in the same folder as the arduino sketch.

So, people, what do you think?
 
Cool! I will take a look at it, I guess in terms of efficiency it is just comparable to an AudioSynthWaveform (plus some extra checking to select the appropiate table)? I am intrigued why AudioSynthWaveform is slower than AudioSynthWaveformSine by the way..
 
Status
Not open for further replies.
Back
Top