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

SuperCollider client problem

$
0
0

Hi all, I'm trying to make the SuperCollider client for Processing work. I have SC 3.7.2 and Processing 3.1.1. I tried to run an example sketch from Daniel John Jones website. The processing part seems to work alright i.e. I get a window displaying a bouncing line but no sound and ...

SuperCollider says :

"FAILURE IN SERVER /n_set Node 2000 not found"

Processing says :

"### [2016/8/13 11:8:5] PROCESS @ OscP5 stopped.

[2016/8/13 11:8:5] PROCESS @ UdpClient.openSocket udp socket initialized.

[2016/8/13 11:8:6] PROCESS @ UdpServer.start() new Unicast DatagramSocket created @ port 57150

[2016/8/13 11:8:6] PROCESS @ UdpServer.run() UdpServer is running @ 57150

[2016/8/13 11:8:6] INFO @ OscP5 is running. you (192.168.1.21) are listening @ port 57150

oscEvent: /b_info oscEvent: /done oscEvent: /done oscEvent: /fail oscEvent: /fail oscEvent: /fail oscEvent: /fail...

... and so on.

Does anyone of you have an idea of what's happening ?

Thanks.

Raphaël

PS : here's the sketch by the way :)

import supercollider.*;
import oscP5.*;

float bx = width / 2,
      by = height / 2,
      vx = 0,
      vy = 0;

Buffer buffer;
Synth synth;

int [] samples;

void setup()
{
  size(1024, 512);
  frameRate(25);
  smooth();

  samples = new int[width];

  buffer = new Buffer(width, 1);
  buffer.alloc(this, "allocated");

  vx = random(-10, 10);
  vy = random(-10, 10);
}

void allocated (Buffer buffer)
{
  buffer.zero();

  synth = new Synth("playbuf_1");
  synth.set("loop", 1);
  synth.set("bufnum", buffer.index);
  synth.create();
}

void exit()
{
  synth.free();
  buffer.free();
  super.exit();
}

void draw()
{
  background(0);
  fill(255);
  noStroke();

  bx += vx;
  by += vy;

  if (bx > width - 1)
  {
    bx = width - 1;
    vx = 0 - vx;
  }
  if (bx < 0)
  {
    bx = 0;
    vx = 0 - vx;
  }
  if (by > height - 1)
  {
    by = height - 1;
    vy = 0 - vy;
  }
  if (by < 0)
  {
    by = 0;
    vy = 0 - vy;
  }

  if (mousePressed)
  {
    vx += (mouseX - bx) * 0.001;
    vy += (mouseY - by) * 0.001;
  }

  buffer.fill((int) bx, (int) abs(vx + 1), (2.0 * by / height) - 1.0);
  for (int i = 0; (i < abs(vx + 1)) && (bx + i < width - 1); i++)
  {
    samples[(int) bx + i] = (int) by;
  }

  for (int i = 0; i < samples.length; i++)
  {
    stroke(150);
    point(i, samples[i]);
  }

  if (synth != null)
  {
    synth.set("pan", (float) bx / width - 0.5);
    synth.set("rate", (float) 0.1 + 0.2 * sqrt(sq(vx) + sq(vy)));
  }
  ellipse(bx, by, 3, 3);
}

Viewing all articles
Browse latest Browse all 2896

Trending Articles