Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
p.translate(0, height-50);
// stroke(random(100,200),random(100,200),0)
for(let i = 0; i < systems.length; i++){
const options = systems[i];
options.p = p;
console.log(options)
const l = new LSystem(options);
p.translate(distanceX, 0)
l.run(iterations[i]);
}
}
}
// set global functions for p5
const p5Instance = new p5(sketch)
This is a port of Daniel Shiffman Nature of Code: Intelligence and Learning
Original Repo: https://github.com/shiffman/NOC-S17-2-Intelligence-Learning
Cristóbal Valenzuela
https://github.com/cvalenzuela/p5deeplearn
===
*/
import p5 from 'p5';
import 'p5/lib/addons/p5.dom';
import { lstm } from './lstm';
let textInput, tempSlider, lengthSlider, maxlen = 40,
waiting = false;
let sketch = new p5((p) => {
p.setup = () => {
p.noCanvas();
// Grab the DOM elements
textInput = p.select('#textInput');
lengthSlider = p.select('#lenSlider');
tempSlider = p.select('#tempSlider');
// Run generate anytime something changes
textInput.input(generate);
lengthSlider.input(generate);
tempSlider.input(generate);
};
let generate = () => {
export function p5Init(domParent) {
var myp5 = new p5(() => {}, domParent);
myp5.setup = () => {
console.warn("Warning, please override p5 setup function");
};
return myp5;
}
componentDidMount() {
this.canvas = new p5(this.props.sketch, this.wrapper);
this.canvas.myCustomRedrawAccordingToNewPropsHandler(this.props);
ourP5 = this.canvas;
rectangleSeed()
}
reload() {
this.p.remove();
new p5(this.sketch, this.root);
}
deriveSizes() {
const runSynth = () => {
const p5 = new P5();
let carrier;
let modulator;
let analyzer;
let modFreq;
let modDepth;
const radius = 200;
let modMaxFreq = 100;
let modMinFreq = 80;
let modMaxDepth = 100;
let modMinDepth = -100;
const setup = () => {
ptick1 = tick1;
}
p.keyPressed = () => {
if(p.key == 'm') {
p.save(Date.now() + ".jpg");
}
}
p.mousePressed = () => {
StartAudioContext(Tone.context).then(function(){});
}
}
export default sketch;
new p5(sketch);
vehicles2[i].run();
}
}
p.keyPressed = () => {
if(p.key == 'm') {
p.save(Date.now() + ".jpg");
}
}
p.mousePressed = () => {
StartAudioContext(Tone.context).then(function(){});
}
}
export default sketch;
new p5(sketch);
This is a port of Daniel Shiffman Nature of Code: Intelligence and Learning
Original Repo: https://github.com/shiffman/NOC-S17-2-Intelligence-Learning
Cristóbal Valenzuela
https://github.com/cvalenzuela/p5deeplearn
===
*/
import p5 from 'p5';
import 'p5/lib/addons/p5.dom';
import { predict } from './predict';
let result, submit, drawing = false,
next = false;
let sketch = new p5((p) => {
p.setup = () => {
let canvas = p.createCanvas(200, 200);
p.pixelDensity(1);
canvas.mousePressed(startDrawing);
canvas.mouseReleased(stopDrawing);
result = p.createP(' ');
submit = p.createButton('classify');
submit.mousePressed(classify);
p.background(0);
};
p.draw = () => {
if (drawing) {
p.stroke(245);
p.strokeWeight(20);