<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with #controlp5 - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=%23controlp5</link>
      <pubDate>Sun, 08 Aug 2021 18:45:45 +0000</pubDate>
         <description>Tagged with #controlp5 - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/tagged%23controlp5/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Print output from serial device connected on COM port using serial module</title>
      <link>https://forum.processing.org/two/discussion/26150/print-output-from-serial-device-connected-on-com-port-using-serial-module</link>
      <pubDate>Sun, 28 Jan 2018 08:43:59 +0000</pubDate>
      <dc:creator>SVK_212</dc:creator>
      <guid isPermaLink="false">26150@/two/discussions</guid>
      <description><![CDATA[<p>I am trying to use the following modules in p3</p>

<p>controlP5 (for GUI)<br />
serial (to communicate with a device on COM port)</p>

<p>...
the device is a GSM SIM900 module that can understand AT commands.
when I create a session in PUTTY for COM port, for every AT command I type and press ENTER,
I get an acknowledgement.
For e.g.</p>

<p>AT<br />
OK</p>

<p>where AT was the command I typed and OK was the acknowledgement I got.</p>

<p>In p3, I made a GUI that contains 2 textboxes and a button.</p>

<p>I also created a serial handle,</p>

<p><code>mpo = new Serial(this,Serial.list()[0],9600);</code></p>

<p>mpo is global object of class Serial</p>

<p>On clicking the button, the content in the textboxes is processed and if a condition is met, then some functions in serial module are called.</p>

<pre><code>mpo.clear();  
mpo.write("AT\n");
</code></pre>

<p>...
I also have this function,</p>

<pre><code>void serialEvent(Serial mp){  
ins = mp.readString();  
print(ins);  
}  
</code></pre>

<p>where ins is a global String object. This function, I suppose, is called whenever I send commands to module and not when the module acknowledges.
 So, it prints AT, but doesn't print OK...
Is there any way this problem can be solved?</p>
]]></description>
   </item>
   <item>
      <title>Can someone help me start a drum sequencer! :)</title>
      <link>https://forum.processing.org/two/discussion/26048/can-someone-help-me-start-a-drum-sequencer</link>
      <pubDate>Sat, 20 Jan 2018 14:08:43 +0000</pubDate>
      <dc:creator>tagtag22</dc:creator>
      <guid isPermaLink="false">26048@/two/discussions</guid>
      <description><![CDATA[<p>Hello Everybody!</p>

<p>I'm trying to make a super simple drum sequencer using controlp5 and the minim library's.</p>

<p>At the moment i'm just trying to combine the examples, of cp5's matrix and minims trigger sample, with my own drum samples. I'm super knew to this and was wondering if someone could walk me through this step?</p>

<p>after this I think I could probably get my head round and some sliders for volume and and stuff.</p>

<p>Thanks :)</p>
]]></description>
   </item>
   <item>
      <title>ControlP5 : How to add callbacklistener on a tab</title>
      <link>https://forum.processing.org/two/discussion/26028/controlp5-how-to-add-callbacklistener-on-a-tab</link>
      <pubDate>Thu, 18 Jan 2018 16:08:41 +0000</pubDate>
      <dc:creator>YvesB</dc:creator>
      <guid isPermaLink="false">26028@/two/discussions</guid>
      <description><![CDATA[<p>Hello,</p>

<p>I made a complex IU where tabs may cover some controller. I want the priority to be given to the table button. But even if the tab is drawn above, i click on the button in the background.</p>

<p>I tried a function like myTab.onEnter(toFront);</p>

<p>With the callback listener toFront is simply</p>

<pre><code>CallbackListener toFront = new CallbackListener() {
      public void controlEvent(CallbackEvent theEvent) {
        theEvent.getController().bringToFront();
      }
    };
</code></pre>

<p>but this option works only with controller object...</p>

<p>Any tips ?</p>
]]></description>
   </item>
   <item>
      <title>ControlP5 matrix doubt</title>
      <link>https://forum.processing.org/two/discussion/25320/controlp5-matrix-doubt</link>
      <pubDate>Fri, 01 Dec 2017 16:57:21 +0000</pubDate>
      <dc:creator>LuisArandas</dc:creator>
      <guid isPermaLink="false">25320@/two/discussions</guid>
      <description><![CDATA[<p>i have a question friends
I am making king of a synthethizer using libpd with processing and im doing good so far doing some faders comunicating with pure data vanilla etc but now that I'm doing a matrix I can't define like do this x1 and y1 activate a trigger and get me a buffer from pd! I can show you my code and you can see where it goes ok (in the faders) and when I can declare (the matrix)
i need to do this quick so i hope some help best regards Luis</p>
]]></description>
   </item>
   <item>
      <title>Voronoi, controlP5 and toxi's gradient</title>
      <link>https://forum.processing.org/two/discussion/23571/voronoi-controlp5-and-toxi-s-gradient</link>
      <pubDate>Mon, 24 Jul 2017 18:05:42 +0000</pubDate>
      <dc:creator>sinanatra</dc:creator>
      <guid isPermaLink="false">23571@/two/discussions</guid>
      <description><![CDATA[<p>Hi, i posted a different questions some days ago and i drastically changed what i'm doing.
First things first: I'm trying to use controlP5 but it overlaps the sketch, and it makes it impossible to work with it. I would like to have it above it (creating a sort of different container for my sketch), but i'm lost.
I was then thinking to have a sort of .png black and white gradient as a background to create an effect similar to the grayscott examples in toxi, in which it changes the size of the stroke.
Could you please help me? i'm lost with controlP5, and for the gradient map i just need some advise on how to make it.
Thanks, this is the code i'm working on:</p>

<pre><code>int fontend = 8;
int nchars = 0;
boolean record; 
PVector object;
// change this for grid size
int gridSize = 15;
import processing.pdf.*; 
import toxi.geom.*;
import toxi.geom.mesh2d.*;
import toxi.util.*;
import toxi.util.datatypes.*;
import toxi.processing.*;
import controlP5.*;
ControlP5 cp5;
int sliderValue = 100;
Slider abc;
void setup() {
  size(400, 800, P3D);

  cp5 = new ControlP5(this);
  cp5.addSlider("slider")
    .setPosition(10, 10)
    .setSize(100, 20)
    .setRange(15, 50)
    .setValue(15);


  if (record) {
    beginRecord(PDF, "frame-####.pdf");
  }
  object = new PVector(random(width), random(height));
  setupVoronoi(); // create your voronoi generator
}
void draw() {
  //noLoop();
  beginRaw(PDF, "output.pdf");
  //glued to grid
  if (mousePressed) {
    object.x = mouseX;
    object.y = mouseY;
    object.x = int(object.x/gridSize)*gridSize;
    object.y = int(object.y/gridSize)*gridSize;
    drawPoint(object.x, object.y, 1, 1);
    if (key == '3')
      drawPoint(object.x, object.y, 1, 1);
    if (key == '5') {
      for (int k=0; k&lt;400-1; k++) {
        k +=10;
        drawPoint(300, k, 1, 1);
      }
    }
  }
  int centerLimit = 250; // variable to control the diameter of the spiral
  int theta = 0; //increases with every point in your spiral, producing the spiral effect.
  if (key == '4') {
    theta=0; //reset theta 
    for (int k=0; k&lt;centerLimit; k++) {     
      theta +=1;
      //One spiral in center with large-ish shapes
      drawPoint(object.x, object.y, 3*theta/2, 3*theta/2);
    }
  }

  drawVoronoi(); //renders
  endRaw();
}
// into grid
void mouseDragged() {
  object.x = mouseX;
  object.y = mouseY;
  object.x = int(object.x/gridSize)*gridSize;
  object.y = int(object.y/gridSize)*gridSize;
  drawPoint(object.x, object.y, 1, 1);
}
void keyPressed() {
  // unorganic
  if (key == '1')
    drawPoint(mouseX, mouseY, 1, 1);
}
void drawPoint(float orgX, float orgY, float theta, float diameter) { // generates and adds circular points
  float xPos = sin(theta)*diameter+orgX;
  float yPos = cos(theta)*diameter+orgY;
  voronoi.addPoint(new Vec2D(xPos, yPos));
}
// ranges for x/y positions of points
FloatRange xpos, ypos;
// helper class for rendering
ToxiclibsSupport gfx;
// empty voronoi mesh container
Voronoi voronoi = new Voronoi(100000);
// optional polygon clipper
PolygonClipper2D clip;
// switches
boolean doShowPoints = true;
boolean doShowDelaunay;
boolean doClip;
boolean doSave;
void setupVoronoi() {
  smooth();
  // focus x positions around horizontal center (w/ 33% standard deviation)
  xpos=new BiasedFloatRange(0, width, width/2, 0.333f);
  // focus y positions around bottom (w/ 50% standard deviation)
  ypos=new BiasedFloatRange(0, height, height, 0.5f);
  // setup clipper with centered rectangle
  clip=new SutherlandHodgemanClipper(new Rect(width*0.125, height*0.125, width*0.75, height*0.75));
  gfx = new ToxiclibsSupport(this);
  textFont(createFont("SansSerif", 10));
}
void drawVoronoi() {
  if (doSave) {
    saveFrame("voronoi-" + DateUtils.timeStamp() + ".png");
  }
  //rect(0, 0, width, height);
  background(0);
  stroke(255); 

  strokeWeight(1); 
  // stroke(0);
  noFill();
  // draw all voronoi polygons, clip if needed
  for (Polygon2D poly : voronoi.getRegions()) {
    if (doClip) {
      gfx.polygon2D(clip.clipPolygon(poly));
    } else {
      gfx.polygon2D(poly);
    }
  }
  // draw delaunay triangulation
  if (doShowDelaunay) {
    stroke(0);
    fill(0);
    beginShape(TRIANGLES);
    for (Triangle2D t : voronoi.getTriangles()) {
      gfx.triangle(t, false);
    }
    endShape();
  }
  // draw original points added to voronoi
  if (doShowPoints) {
    fill(255);
    for (Vec2D c : voronoi.getSites()) {
      ellipse(c.x, c.y, 10, 10);
    }
  }
  if (doSave) {
    endRecord();
    doSave = false;
  }
}
/// SLIDER ///
void slider(float sizer) {
  gridSize = int(sizer);
  println("changing grid to: "+sizer);
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Detecting MultiTouch (selecting two controlP5 button at same time)</title>
      <link>https://forum.processing.org/two/discussion/21738/detecting-multitouch-selecting-two-controlp5-button-at-same-time</link>
      <pubDate>Fri, 31 Mar 2017 21:09:19 +0000</pubDate>
      <dc:creator>Harsh_25</dc:creator>
      <guid isPermaLink="false">21738@/two/discussions</guid>
      <description><![CDATA[<p>In processing I am using ControlP5 &amp; SMT libraries for my university proejct, I have to develop something like on a touch screen, When I touch button A, Button B will be visible. If I release touch from button A it should hide button B. now I want to select button B without releasing touch from button A</p>

<p>All buttons are built using controlP5. I have used SMT library for multi-touch. I have defined zone for each button and defined touchUp and touchDown methods (SMT  methods)  for each button, to detect click on each button.</p>

<p>The problem is I cannot enable two button at the same time. (I think SMT is not calling two different touchDown method for different buttons, but not sure)</p>

<p>Please suggest if there is any solution. It will be very helpful if I get the any solution as soon as possible. Thank you in advance.</p>
]]></description>
   </item>
   </channel>
</rss>