IDMNYU / p5.js-func

Function Generators for p5.js
MIT License
126 stars 10 forks source link

TWO_PI is not defined #1

Open Tsangares opened 6 years ago

Tsangares commented 6 years ago

When I try to run this in instance mode I recieve the error, TWO_PI is not defined.

How do I run this in instance mode. Mycode:

var sketch=function(p){
    p.setup=function() {
        var c=p.createCanvas(p.windowWidth, p.windowHeight);
        c.style('position','fixed');
        c.style('z-index', '-1');
        c.style('top', '0');
        var g = new p5.Gen(); // function generator object                                                                                                                                                         
        var bar = g.fillFloat32Array("waveform", 1000, "sine");

    };

    p.draw=function() {

    };
};
var myp5=new p5(sketch);
rev3rend commented 6 years ago

wow. far out. this sounds more like a p5 glitch (the TWO_PI macro is from the main p5.js library).

if you just try to use TWO_PI (or floor(), without using Math.floor()) in your instance mode code, does it work?

Tsangares commented 6 years ago

The glitch is coming from the func library.

ReferenceError: TWO_PI is not defined p5.func.min.js:1:596

jooohyunpark commented 2 years ago

+1 Any plan for npm module port?

Tsangares commented 2 years ago

This is so old I have no idea what i was working on