Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all 2896 articles
Browse latest View live

How do I export 3D models with multiple layers from the Shapes 3D library as an .obj file?

$
0
0

I want to use two libraries in conjunction: the first one, "OBJExport" (http://n-e-r-v-o-u-s.com/tools/obj/), to export 3D models as .obj files. These models will be generated by the "Shapes 3D" library (http://www.lagers.org.uk/s3d4p/index.html), which I need to create an extrusion from my svg path. The export works just fine, but only for one shape. Since I generate multiple extrusions in a recursive manner, I want to export a group of objects rather than one combined model. I'm not sure if this is possible with OBJExport and I could not find anything related on the website of Nervous System, but I think if at all it'll only be possible by having multiple PGraphics (or in this case "OBJExport" which extends PGraphics) objects with all the shapes rendered to them separately. Of course, It'd be nice to have something like ".nextPage()" from the PDF library but for separating objects in the .obj file. My hope was to be able to assign a PGraphics object to the .draw() function of my shape, but I can only initialize it with a different PApplet, which I think is not useful for this situation (or is it?).

Maybe someone else did something like this before and can help me out or there is a different library to export 3D models, otherwise I'd have to separate the objects manually in C4D which will be quite tedious.

Here is my test sketch for the extrusion export based on an example sketch from Shapes 3D (of course it doesn't work, since I need to assign the graphics context to the shape):

import nervoussystem.obj.*;
boolean record = false;

import shapes3d.utils.*;
import shapes3d.animation.*;
import shapes3d.*;

float angleX, angleY, angleZ;
Extrusion e;

Path path;
Contour contour;
ContourScale conScale;

public void setup() {
  size(300, 300, P3D);
  cursor(CROSS);

  path = new P_LinearPath(new PVector(0, 80, 0), new PVector(0, 0, 0));
  contour = getBuildingContour();
  conScale = new CS_ConstantScale();
  // Create the texture coordinates for the end
  contour.make_u_Coordinates();
  // Create the extrusion
  //e = new Extrusion(this, path, 1, contour, conScale);
  e = new Extrusion(this, path, 1, contour, conScale);
  e.setTexture("wall.png", 1, 1);
  e.drawMode(S3D.TEXTURE );
  // Extrusion end caps
  e.setTexture("grass.jpg", S3D.E_CAP);
  e.setTexture("sky.jpg", S3D.S_CAP);
  e.drawMode(S3D.TEXTURE, S3D.BOTH_CAP);
}

OBJExport obj;

public void draw() {
  background(32, 32, 128);

  if (record) {
    obj = (OBJExport) createGraphics(width, height, "nervoussystem.obj.OBJExport", "test.obj");
    obj.setColor(true);
    obj.beginDraw();
    obj.noFill();
  }

  camera(0, 0, 250, 0, 0, 0, 0, 1, 0);
  angleX += radians(0.913f);
  angleY += radians(0.799f);
  angleZ += radians(1.213f);
  e.rotateTo(angleX, angleY, angleZ);
  e.draw();
  //if (record) e.draw(obj); <- this would be needed here!

  if (record) {
    obj.endDraw();
    obj.dispose();
    record = false;
  }
}

public Contour getBuildingContour() {
  PVector[] c = new PVector[] {
    new PVector(-30, 30),
    new PVector(30, 30),
    new PVector(50, 10),
    new PVector(10, -30),
    new PVector(-10, -30),
    new PVector(-50, 10)
  };
  return new Building(c);
}

// The extrusion contour must be from a class that
// extends the library Contour class.
public class Building extends Contour {

  public Building(PVector[] c) {
    this.contour = c;
  }
}

void keyPressed()
{
  if (key == 'r') {
    record = true;
  }
}

[EDIT] Okay, I saw this thread (https://forum.processing.org/two/discussion/11391/objexport-library#latest) and it seems that my problem is actually that I need to have groups in my .obj files. Something like "g sphere" or "g box" in front of the vertices. But I couldn't find anything related in the OBJExport library source, so I think this is pretty much hopeless. Maybe I can try hacking my way through this, but I'm no Java expert and will probably mess up the code..


XML issues updating a Twitter variable sketch made in Processing 1.5.1

$
0
0

Hello everyone,

I've tried endlessly to resolve this myself, but keep on running into walls... I feel like this is something the Processing community could do in their sleep!

I originally made a Processing sketch in 1.5.1 (back in 2011) that used the "Programming from A to Z" function by Daniel Shiffman to query Twitter's XML feed and record the mentions of the words "want" and "need". It would then display the results from each word on a running line graph, similar to an electrocardiogram.

I had made this into a web app using processing-1.1.0.js at the time, but it no longer works when viewed online as Java has become antiquated.

The online version is available here: http://goo.gl/ZlCQe

And the ZIP of the sketch is here: http://goo.gl/BgcRX

Now that I'm dusting this off and opening it with 3.1.1, I keep getting an error:

The class "XMLElement" does not exist

This thread answered my question, but when I changed all mentions of "XMLElement" to "XML", I got the new error:

The constructor "XML(PApplet,String)" does not exist

Since this happens in the RetrieveData.pde, code which I didn't write, I don't know where to start in updating the code. I'm also really dusty on Programming since 2011. I've tried launching this in Processing 1.5.1, but it no longer opens on OS X 10.11.

Once I had gotten the sketch running again, I was hoping to re-export it in 3.1.1 using the latest Processing.js (or up-to-date web export tool) to display it online.

I'm not exactly sure where to start, but any help is much appreciated!

-A

play sound when mouse pressed and paused when released

$
0
0

Hey guys, I'm trying to code a guitar hero like game for my school project. My goal is to have a guitar with different colors on the neck and depending on which color I press with the mouse a different note play. I'm not sure how to use a sound based on the X,Y position of the mouse and then have the sound play when the mouse is pressed and stop playing when the mouse is released. Any help would be appreciated!

Thanks

Play Sound

$
0
0

I read "LEARNING PROCESSING" book and I found the way to play Sound and the code was...

import processing.video.*;

Movie movie;

void setup() { size(200, 200);

movie = new Movie(this, "sample.mp3");

}

void draw() { background(0); noLoop(); }

void mousePressed(){ movie.stop(); movie.play(); }

but... The class "Movie" does not exist

What's wrong?

Can't import Xbee Java Library in Processing 3.1.1 (MacOS 10.5)

$
0
0

Hi,

I try to run the follow_the_leader demo from XBeeArduinoCodingPlatform (see https://docs.digi.com/display/XBeeArduinoCodingPlatform/Follow+the+Leader).

Unfortunately, I get : No library found for com.digi.xbee.api.models No library found for com.digi.xbee.api.connection Libraries must be installed in a folder named 'libraries' inside the 'sketchbook' folder.

However, I have put the XBJL-1.1.1 directory in the ~/Documents/Processing/libraries directory as required.

Could anyone help me ?

Thank you.

Geomerative – Is there something like shapeMode() for RShape?

$
0
0

Hi Coders,

i am trying to center a SVG with geomerative's RShape. I want to do something like

shapeMode(CENTER); translate(width/2,height/2);

Could someone of you help me, to "translate" this to Geomerative-syntax?

Thanks in advance!

Deconstructing PeasyCam for practice

$
0
0

Hey all, I'm interested in building my own version of PeasyCam which is designed to be computationally fast, whatever that means.

Essentially I'm trying to convert the orbital design into a first person design, and removing everything to bare-bone.

Any recommendations before I get bloody knuckles? This is for practice so the more references and subject material you can post the better off.

KeyPressed BACKSPACE and delete just one shape

$
0
0

Hi there again, this time I need a little help: I've create a code for a "generative" logo (it's at the start so is not complete), and I want that while pressing one time the BACKSPACE I can go back just for one shape. Now like I have my code, when I press Backspace it delete all.

I leave the code here, thanks !

    import controlP5.*;

    ControlP5 cp5;

    String textValue = "";
    String val;

    void setup() {
       size(700,800);

      PFont font = createFont("arial",20);

      cp5 = new ControlP5(this);

      cp5.addTextfield("INPUT")
         .setPosition(width/2-100,600)
         .setSize(200,40)
         .setFont(font)
         .setFocus(true)
         .setColor(color(255,255,255))

         ;

      textFont(font);
      background(0);
      noStroke();
    }
    void draw() {


      if (keyPressed) {

        if (key == 'o' || key == 'O') {
          fill(205, 152, 59, 100);
          ellipse(width/2, height/2, 50, 50);
        }

          if (key == 'b' || key == 'B') {
            fill(20, 84, 42, 100);
            rectMode(CENTER);
            rect(width/2, height/2, 50, 50);
          }
        }
        if (key == BACKSPACE) {    //This reset all, I want to reset just the last one shape
      background (0);
    }

    val = cp5.get(Textfield.class,"INPUT").getText();
     println(val.length());

    }

how use the OpenCV with Processing?

$
0
0

its always shows "the package hypermedia does not exist" . i did all methods found in internet, but dont have any result processing 3.1 and openCV 3.0 versions

Movie Read (Frame Differencing)

$
0
0

What's wrong with my code. The video is playable but it is without the frame differencing filter.

import processing.video.*;

int numPixels;
int[] previousFrame;
Movie video;

void setup() {
  size(1920, 1080);

  // This the default video input, see the GettingStartedCapture
  // example if it creates an error
  video = new Movie(this, "abc.mp4");

  // Start capturing the images from the camera
     video.loop();
   //video.read();
  numPixels = video.width * video.height;
  // Create an array to store the previously captured frame
  previousFrame = new int[numPixels];
  loadPixels();

}

void draw() {
  if (video.available()) {

    // When using video to manipulate the screen, use video.available() and
    // video.read() inside the draw() method so that it's safe to draw to the screen
    video.read(); // Read the new frame from the camera
    video.loadPixels(); // Make its pixels[] array available
    image(video, 0, 0);
    int movementSum = 0; // Amount of movement in the frame
    for (int i = 0; i < numPixels; i++) { // For each pixel in the video frame...
      color currColor = video.pixels[i];
      color prevColor = previousFrame[i];
      // Extract the red, green, and blue components from current pixel
      int currR = (currColor >> 16) & 0xFF; // Like red(), but faster
      int currG = (currColor >> 8) & 0xFF;
      int currB = currColor & 0xFF;
      // Extract red, green, and blue components from previous pixel
      int prevR = (prevColor >> 16) & 0xFF;
      int prevG = (prevColor >> 8) & 0xFF;
      int prevB = prevColor & 0xFF;
      // Compute the difference of the red, green, and blue values
      int diffR = abs(currR - prevR);
      int diffG = abs(currG - prevG);
      int diffB = abs(currB - prevB);
      // Add these differences to the running tally
      movementSum += diffR + diffG + diffB;
      // Render the difference image to the screen
      pixels[i] = color(diffR, diffG, diffB);
      // The following line is much faster, but more confusing to read
      //pixels[i] = 0xff000000 | (diffR << 16) | (diffG << 8) | diffB;
      // Save the current color into the 'previous' buffer
      previousFrame[i] = currColor;
    }
    // To prevent flicker from frames that are all black (no movement),
    // only update the screen if the image has changed.
    if (movementSum > 0) {
      updatePixels();
      println(movementSum); // Print the total amount of movement to the console
    }
  }
}

Pie Chart & XY plot (jfreechart)

$
0
0

I have made one pic chart with jfree chart.


PImage chartImage;

void setup(){
  size(500, 300);

 DefaultPieDataset pieDataset = new DefaultPieDataset();
pieDataset.setValue("JavaWorld", new Integer(75));
pieDataset.setValue("Other", new Integer(25));
JFreeChart chart = ChartFactory.createPieChart("Pie Chart",pieDataset,true,false,false);
 chartImage = new PImage(chart.createBufferedImage(500,300));
}


void draw(){
  // display chart image on screen
 image(chartImage, 0, 0);
}

I have attached 2 files jcommon & jfreechart. & its working ok.

Now I have change pie chart to line chart but it show error XYPlot function() could not find.

Can some one help me to solve this. Here is the code.

PImage chartImage;

void setup(){
  size(500, 300);

XYSeries series = new XYSeries("Average Size");
series.add(20.0, 10.0);
series.add(40.0, 20.0);
series.add(70.0, 50.0);
XYDataset xyDataset = new XYSeriesCollection(series);
JFreeChart chart = ChartFactory.createAreaXYChart("Sample XY Chart","Height","Weight",xyDataset,true);


  // create image from chart
  chartImage = new PImage(chart.createBufferedImage(500,300));
}


void draw(){
  // display chart image on screen
 image(chartImage, 0, 0);
}

Need Help.

Need to make click and drop

$
0
0

Hi, I'm very very new to using processing, I have an idea I want to make a reality, but I'm still a beginner to coding and stuff. I have a long way to go, but here is what I have so far...

import processing.sound.*;
SoundFile file;

PFont Serif;
int gridSize = 100;
PVector object;
float x, y;

final static private int actualGrid = 100; // 100 pixels wide grid

void setup() {
  fullScreen();
  background(52);
  // Load a soundfile from the /data folder of the sketch and play it back
  file = new SoundFile(this, "Giriu Dvasios - Zeme.mp3");
  file.play();
  x = random(width);
  y = random(height);

  //Font Properties
  smooth();
  Serif = createFont("Serif", 60);
}

void draw() {
  background(52);
  //Draw the Interactive Canvas

  noStroke();
  fill(27);
  rect(270, 170, 1800, 1200);

  fill(224);
  stroke(238);
  strokeWeight(1);
  for (int i=0; i<18; i++) {
    for (int j=0; j<12; j++) {
      rect(250+100*i, 150+100*j, 100, 100);
    }
  }
  x-=x%100;
  y-=y%100;
  if (mousePressed) {
    x=mouseX;
    y=mouseY;
  }
  noStroke();
  fill(255, 0, 128);
  ellipse(x, y, 80, 80);

  //Headline

  fill(240);
  textFont(Serif);
  text("THE ARCHITECTURE OF", 255, 85);
  text("COLLABORATIVE DESIGN", 255, 135);

  //Draw the shape of the menu blocks

  //Block1
  noStroke();
  fill(27);
  rect(60, 160, 150, 150);
  noStroke();
  fill(224);
  rect(50, 150, 150, 150);

  //Block2
  noStroke();
  fill(27);
  rect(60, 360, 150, 150);
  noStroke();
  fill(224);
  rect(50, 350, 150, 150);

  //Draw the line-shapes inside the block

  //BlockLine1
  stroke(161);
  strokeWeight(5);
  line(75, 175, 175, 275);

  //BlockLine2
  stroke(161);
  strokeWeight(5);
  line(75, 475, 175, 375);
}

I would like to make it so that you can press on the line shapes on the side menu and press on the grid-canvas to place them. I want it so that the user can drag them around the canvas and then remove them by right-clicking on the shape.

It know it may seem an easy enough idea, but the existing code with the ball is conflicting with it, I copied it from somewhere online and I don't really need it, just unsure which parts to take away.

SQLite inserting float value

$
0
0

Hello everyone!

I have a problem with inserting some values into table(SQLite library). I have 3 columns, 1. is ID, second is number/value and third is just a string. Problem is that because I have float as value SQLite thinks I am sending 4 values in because float has a comma in it.

My code:

query = "INSERT INTO" +String.format(" %s VALUES(NULL, %d, '%s');", TableName, value, randomText);
    db.query(query);

What Processing is saying:

INSERT INTO VrednostiEKG VALUES(NULL, 0,23, 'Stiski?'); java.sql.SQLException: [SQLITE_ERROR] SQL error or missing database (table VrednostiEKG has 3 columns but 4 values were supplied)

Anyone knows of a solution? I could make another column and separate value float into 2 different columns but that could make things messy at the end.

Drawing inside Serial event handler

$
0
0

Hi,

I've been away from processing for a long time. Coming back to do a quick o-scope project that involves plotting numbers coming from serial port. I'm using serial event handler according to an ancient post on arduino's website. The code seems to work in Processing 2, but not in processing 3 or old 1.x. In 3, the data are coming in and the line functions are called but there seems to be a lack of actual drawing so the screen is blank. What am I doing wrong?

Here is the code. Code tag seems to not work on my computer.

import processing.serial.*;

Serial myPort;        // The serial port
int xPos = 1;         // horizontal position of the graph

float oldinByte=0;
float oldinFloat=0;
float inFloat=0;
float trigger_threshold=0.5;
String trigger_mode="POS EDGE";

void setup ()
{
  // set the window size:
  size(320, 240);
  //println("Height is"+height);

  // List all the available serial ports
  // if using Processing 2.1 or later, use Serial.printArray()
  println(Serial.list());

  // I know that the first port in the serial list on my mac
  // is always my  Arduino, so I open Serial.list()[0].
  // Open whatever port is the one you're using.
  myPort = new Serial(this, Serial.list()[1], 250000);

  // don't generate a serialEvent() unless you get a newline character:
  myPort.bufferUntil('\n');

  // set inital background:
  background(0);
}

void draw ()
{
}

void mouseClicked()
{
  if (trigger_mode=="POS EDGE") trigger_mode="AUTO";
  else trigger_mode="POS EDGE";
}

void serialEvent (Serial myPort)
{
  // get the ASCII string:
  String inString = myPort.readStringUntil('\n');
  if (inString != null) {
    // trim off any whitespace:
    inString = trim(inString);
    // convert to an int and map to the screen height:
    oldinFloat=inFloat;
    inFloat = float(inString);
    float inByte = map(inFloat, -10, 10, 0, height);
    //println(inByte);
    // draw the line:

    //Trigger
    if (trigger_mode=="POS EDGE")
    {
      if (xPos==0)
      {
        if(!((oldinFloat<trigger_threshold)&&(inFloat>trigger_threshold)&&(inFloat>oldinFloat))) return;
      }
    }
    stroke(0,0,0);
    line(xPos,0,xPos,height);
    line(xPos+1,0,xPos+1,height);
    stroke(0,255,0);
    if (xPos==0)
    {
      line(xPos, height-inByte, xPos, height-inByte);
    }
    else line(xPos, height-inByte, xPos-2, height-oldinByte);
    oldinByte=inByte;

    // at the edge of the screen, go back to the beginning:
    if (xPos >= width) {
      text(trigger_mode,width-70,height-10);
      xPos = 0;
      //background(0);
    } else {
      // increment the horizontal position:
      xPos+=2;
    }
  }
}

controlP5 Font Size of items in ScrollableList

$
0
0

Does anyone know if it is possible to change the size of "item" text in scrollable lists ?

I can only find examples of changing the CaptionLabel .. i.e the header/name of your scrollable list, but not the size of the text for items within the list. Hopefully i'm just missing an obvious solution to improve the legibility of these items in the list.

Cheers, mala


Nice transitions between scenes for 3D environment as an real-time interactive project

$
0
0

Dear all,

I am currently working on a project in a 3D environment, it's a real-time interactive project. I would like to know is there any library or way to make transition between scenes instead of outputting to VJ software like Resolume to make it work.

The code has already built in a quite complicate geometric results, like landscape, raining effect, swarm behaviors. Of course, I can find a way to code it with transparency changing, but it would be quite a lot of works. Or otherwise, I might simply use black background with transparency to gradually re-flash the scene. The other thing is the transition of camera, since I am using PeasyCam, it could be an issue as well.

So I just wonder is there any nice library designed for this purpose, especially for 3D. Is the animation libraries, such as ijeomamotion or motion would be helpful? Or is there any simply solution for this. Just for reminding, it's a rea-time interactive project, so to render as a movie and post edit it is not a solution.

Thanks for whoever answer in advance. Looking forward to it!

3d triangulation library

$
0
0

What is the best and actual library for triangulation of 3d vertices?

Is ControlP5 compatible with FX2D?

$
0
0

Hello,

I recently changed my sketch's renderer to FX2D for more performance but now, controlP5 seems to be firing some exceptions that prevents my sketch from running. As far as I know, it seems to be somewhat related to font loading or something. Here's the stack trace:

java.lang.NullPointerException at processing.javafx.PGraphicsFX2D$FontCache$Key.hashCode(PGraphicsFX2D.java:1423) at java.util.HashMap.hash(HashMap.java:338) at java.util.LinkedHashMap.get(LinkedHashMap.java:440) at processing.javafx.PGraphicsFX2D$FontCache.get(PGraphicsFX2D.java:1377) at processing.javafx.PGraphicsFX2D.handleTextFont(PGraphicsFX2D.java:1470) at processing.javafx.PGraphicsFX2D.textFontImpl(PGraphicsFX2D.java:1446) at processing.core.PGraphics.textFont(PGraphics.java:4232) at controlP5.ControlFont.adjust(Unknown Source) at controlP5.Label$SinglelineLabel.draw(Unknown Source) at controlP5.Label$SinglelineLabel.draw(Unknown Source) at controlP5.Label.draw(Unknown Source) at controlP5.Textfield.draw(Unknown Source) at controlP5.ControllerGroup.drawControllers(Unknown Source) at controlP5.ControllerGroup.draw(Unknown Source) at controlP5.ControlWindow.draw(Unknown Source) at controlP5.ControlWindow.draw(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1395) at processing.core.PApplet$RegisteredMethods.handle(PApplet.java:1388) at processing.core.PApplet.handleMethods(PApplet.java:1582) at processing.core.PApplet.handleDraw(PApplet.java:2412) at processing.javafx.PSurfaceFX$1.handle(PSurfaceFX.java:75) at processing.javafx.PSurfaceFX$1.handle(PSurfaceFX.java:1) at com.sun.scenario.animation.shared.TimelineClipCore.visitKeyFrame(TimelineClipCore.java:226) at com.sun.scenario.animation.shared.TimelineClipCore.playTo(TimelineClipCore.java:184) at javafx.animation.Timeline.impl_playTo(Timeline.java:176) at javafx.animation.AnimationAccessorImpl.playTo(AnimationAccessorImpl.java:39) at com.sun.scenario.animation.shared.InfiniteClipEnvelope.timePulse(InfiniteClipEnvelope.java:110) at javafx.animation.Animation.impl_timePulse(Animation.java:1102) at javafx.animation.Animation$1.lambda$timePulse$26(Animation.java:186) at javafx.animation.Animation$1$$Lambda$99/1799217597.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at javafx.animation.Animation$1.timePulse(Animation.java:185) at com.sun.scenario.animation.AbstractMasterTimer.timePulseImpl(AbstractMasterTimer.java:344) at com.sun.scenario.animation.AbstractMasterTimer$MainLoop.run(AbstractMasterTimer.java:267) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:521) at com.sun.javafx.tk.quantum.QuantumToolkit.pulse(QuantumToolkit.java:505) at com.sun.javafx.tk.quantum.QuantumToolkit.lambda$runToolkit$400(QuantumToolkit.java:334) at com.sun.javafx.tk.quantum.QuantumToolkit$$Lambda$56/1871729890.run(Unknown Source) at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95) at com.sun.glass.ui.win.WinApplication._runLoop(Native Method) at com.sun.glass.ui.win.WinApplication.lambda$null$145(WinApplication.java:101) at com.sun.glass.ui.win.WinApplication$$Lambda$52/1220204850.run(Unknown Source) at java.lang.Thread.run(Thread.java:745) handleDraw() called before finishing Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help ? Troubleshooting.

My animations lag when I'm not using FX2D and I need ControlP5 for user interface. How can I fix this? Or is it even caused by FX2D?

Sound Amplitude coding

$
0
0

Hi everyone, I want to try and modify an existing code (which tracks in real time the amplitude of surrounding noises and visualises them via a waveform on the screen), so that when a certain sound reaches a certain amplitude a desired sound (such as the recorded sound of rain) starts to automatically play to negate this noise, and stops after the noise it is trying to negate has not gone above that same high amplitude for 10 seconds. How would I go about modifying this existing code to do this?

Any kind of feedback would be appreciated!

Here is the existing code I have-

` import ddf.minim.analysis.*; import ddf.minim.ugens.*; import ddf.minim.*;

Minim minim;
FFT fft;

AudioInput in;

void setup() { size(1000, 300, P3D);

minim = new Minim(this);

in = minim.getLineIn();

fft = new FFT(in.bufferSize(), in.sampleRate());

}

void draw() { background(0);

stroke( 255 );

for(int i = 0; i < in.bufferSize() - 1; i++) { float x1 = map( i, 0, in.bufferSize(), 0, width ); float x2 = map( i+1, 0, in.bufferSize(), 0, width ); line( x1, 50 + in.mix.get(i)50, x2, 50 + in.mix.get(i+1)50 ); }

noStroke(); fill( 255, 128 );

rect( 0, 0, in.mix.level()*width, 100 );

}`

controlP5 save controller image

$
0
0

Hello,

Is there an easy way to save as an image the appearance of the controllers used by the library p5 ?

Using save() or saveFrame() I capture everything except the controllers.

Viewing all 2896 articles
Browse latest View live