Author Message

<  examples  ~  deQuencher - an interface for SuperCollider

PostPosted: Sat Sep 13, 2008 7:14 pm
Joined: Thu May 01, 2008 2:15 pmPosts: 30Location: Turkey
Hello all,

deQuencher is a rewrite of an application I initially coded with the processing language. My first project with openframeworks and I loved every moment of it.

Here is an action shot:
http://tinyurl.com/642fnf

The source code and the Universal Binary for Macs, documentation, tutorial, tutorial video etc. are all at my website here:
http://www.batuhanbozkurt.com/home/proj ... /index.php

The source code includes some abstractions for communicating with SuperCollider, so those who want to create synths buffers etc and control parameters on scserver can benefit from that code I think.

Comments and suggestions are welcome.
Thanks
BB.



_________________
- To err is human but to really foul things up requires a computer.
Offline Profile
PostPosted: Mon Sep 22, 2008 12:01 pm
User avatarSite AdminJoined: Mon Feb 05, 2007 9:31 pmPosts: 1806Location: brooklyn
wow, that's looks great.... I look forward to giving it a try. nice work!


Offline Profile
PostPosted: Thu Feb 12, 2009 2:01 pm
Joined: Mon Jan 19, 2009 8:46 pmPosts: 26
Hey really nice. I just have one question.

I am trying to send OSC messages to SuperCollider, right now every message that is sent from OF is displayed in the post window but I cannot use it to control a synth, for example.

Code:
void testApp::mousePressed(int x, int y, int button){
   
   ofxOscMessage m;
   m.setAddress("/mouse/button");
   m.addStringArg( "mouse clicked" );
   m.addIntArg( "440" );
   oscSender.sendMessage( m );
}



And in SuperCollider I define a SynthDef with the name "sin" and use this bit of code to receive the message:

Code:
(

var ofAddress = NetAddr("127.0.0.1", 57120);
var oscFreq;
oscFreq = 0;

o = OSCresponder(ofAddress, '/mouse/button', { arg time,responder,msg,addr;
   oscFreq = msg[2];                       //Message two, the int argument
   oscFreq.postln;
   a = Synth("sin", [\freq, oscFreq]);
   a.run;
}).add;

)


But all I get is "mouse clicked" posted in the post window in SC. All I want to be able to do is run a synth sound on a mouse click and then I can develop it from there. Any help would be much appreciated.


Offline Profile
PostPosted: Sat Mar 14, 2009 7:51 pm
Joined: Mon Jan 19, 2009 8:46 pmPosts: 26
Actually I've managed to solve the problem, thanks to your source code!

I should have been using "/s_new" for the address, and then vary the nodeID (I'm using OSC to fire off synth events in SC)

I have OF and SC communicating via OSC, so if anyone needs assistance, I'll be more than happy to help.


Offline Profile
PostPosted: Fri Oct 02, 2009 12:25 pm
Joined: Fri Apr 27, 2007 6:52 pmPosts: 132Location: bilbao
markgia, do you have code you could share? i would like to have a look at it. thanks!


Offline Profile
PostPosted: Sat Oct 24, 2009 10:41 pm
Joined: Sat Feb 21, 2009 6:02 pmPosts: 56
hallo,

i tried the ofxosc addon with supercollider but only get this
Code:
FAILURE /mouse/button Command not found
message in supercolider post window i tried the above posted code in supercolider and also the code from the berio blog.
but all that had the same effect. can anyone give me a hint what i am doing wrong?

thanks a lot!


Offline Profile
PostPosted: Sun Oct 25, 2009 9:49 am
Joined: Sat Feb 21, 2009 6:02 pmPosts: 56
ok i think i have managed that supercollider now gets the right messages to the right port. before i used port 57110 which is not the right port. now i use 57120 but i still get no sound or supercollider reaction. i use the following sc code:
Code:
(

var ofAddress = NetAddr("127.0.0.1", 57120);
var oscFreq;
oscFreq = 0;

o = OSCresponder(ofAddress, '/mouse/button', { arg time,responder,msg,addr;
   oscFreq = msg[2];                       //Message two, the int argument
   oscFreq.postln;
   a = Synth("sin", [\freq, oscFreq]);
   a.run;
}).add;

)

is there something wrong with the listening ip or port? maybe someone has an idea.


Offline Profile
PostPosted: Sun Oct 25, 2009 10:43 pm
Joined: Sat Feb 21, 2009 6:02 pmPosts: 56
i got it,

i tried different combinations of code and now it works. one thing that i learned was, that sometimes i got no result because something crashed. after restarting of and sc there were results where before were no effects.

so i used the standart ofxosc addon an dfired up an "/test" message.
here is my sc code:

Code:
(
    x = {SinOsc.ar( 240, 0, Line.kr( 0.5,0.0, 0.2))};
    f = OSCresponder(nil, '/test', { |t, r, msg, addr|
   x.play;
    }).add;
)     
x.free;


mybee this helps someone

edit:

i optimised the sc code a bit so that each oscillator dies after it was triggered. this should be much better for the ram usage.

Code:
(
    x = {SinOsc.ar( 1240, 0, Line.kr( 0.5,0.0, 0.2, 1.0, 0.0, 2))};
    f = OSCresponder(nil, '/test', { |t, r, msg, addr|
   x.play;
    }).add;
)


Offline Profile

Display posts from previous:  Sort by:

All times are UTC
Page 1 of 1
8 posts
Users browsing this forum: No registered users and 1 guest
Search for:
Post new topic  Reply to topic
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
cron