Csound Csound-dev Csound-tekno Search About

[Csnd] example video showing Csound using OSC to a p5js sketch in the browser

Date2018-06-24 17:00
FromRichard
Subject[Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Sliders and VU meters using p5js-OSC with Csound

Richard

https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 17:41
FromGuillermo Senna
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Very nice, Richard. I recently started working with Open Stage Control
(https://osc.ammd.net/). Do you know it? It does the ws-osc conversion
automatically and it has a built-in web server. One can easily build
cool interfaces for Csound even from a smartphone then.

Cheers.


On 24/06/18 13:00, Richard wrote:
> Sliders and VU meters using p5js-OSC with Csound
>
> Richard
>
> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 17:55
FromRichard
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Thanks, sounds very interesting, I will have a look!

Richard


On 24/06/18 18:41, Guillermo Senna wrote:
> Very nice, Richard. I recently started working with Open Stage Control
> (https://osc.ammd.net/). Do you know it? It does the ws-osc conversion
> automatically and it has a built-in web server. One can easily build
> cool interfaces for Csound even from a smartphone then.
>
> Cheers.
>
>
> On 24/06/18 13:00, Richard wrote:
>> Sliders and VU meters using p5js-OSC with Csound
>>
>> Richard
>>
>> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>         https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 18:04
FromTarmo Johannes
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Hi,

very nice demo, thanks!
Would you care to share the html and csd file -  I am interested would it be 
possible to do similar thing withing CsoundQt (-html) or Csound-wasm so that 
you actually don't need web protocol but just Csound channels for 
communication?

greetings,
tarmo

On Sunday, June 24, 2018 7:00:21 PM EEST you wrote:
> Sliders and VU meters using p5js-OSC with Csound
> 
> Richard
> 
> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 18:26
FromRichard
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Attachmentsindex.html  webOSC.csd  
Of course Tarmo. Good questions, btw.
Here are the files.


Richard


On 24/06/18 19:04, Tarmo Johannes wrote:
> Hi,
>
> very nice demo, thanks!
> Would you care to share the html and csd file -  I am interested would it be
> possible to do similar thing withing CsoundQt (-html) or Csound-wasm so that
> you actually don't need web protocol but just Csound channels for
> communication?
>
> greetings,
> tarmo
>
> On Sunday, June 24, 2018 7:00:21 PM EEST you wrote:
>> Sliders and VU meters using p5js-OSC with Csound
>>
>> Richard
>>
>> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
>>
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 19:08
FromTarmo Johannes
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
Thanks,

Looking at the html, seems sketch.js is where the main code is? Can you send 
also that one?

tarmo

On Sunday, June 24, 2018 8:26:02 PM EEST you wrote:
> Of course Tarmo. Good questions, btw.
> Here are the files.
> 
> 
> Richard
> 
> On 24/06/18 19:04, Tarmo Johannes wrote:
> > Hi,
> > 
> > very nice demo, thanks!
> > Would you care to share the html and csd file -  I am interested would it
> > be possible to do similar thing withing CsoundQt (-html) or Csound-wasm
> > so that you actually don't need web protocol but just Csound channels for
> > communication?
> > 
> > greetings,
> > tarmo
> > 
> > On Sunday, June 24, 2018 7:00:21 PM EEST you wrote:
> >> Sliders and VU meters using p5js-OSC with Csound
> >> 
> >> Richard
> >> 
> >> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
> >> 
> >> Csound mailing list
> >> Csound@listserv.heanet.ie
> >> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> >> Send bugs reports to
> >> 
> >>          https://github.com/csound/csound/issues
> >> 
> >> Discussions of bugs and features can be posted here
> > 
> > Csound mailing list
> > Csound@listserv.heanet.ie
> > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> > Send bugs reports to
> > 
> >          https://github.com/csound/csound/issues
> > 
> > Discussions of bugs and features can be posted here
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-06-24 19:18
FromRichard
SubjectRe: [Csnd] example video showing Csound using OSC to a p5js sketch in the browser
That's a tricky one, since the mail won't accept it, I also tried 
zipping it, to no avail.
So here is the code of sketch.js, followed by the code for objectlib.js

//  sketch.js

var x, y;
var rSlider, gSlider, bSlider, vs1, vs2, vslids = [];
var socketready = false;
var oldval = 0;
var socket = null;
var volL = 0;
var volR = 0;

function setup() {
     createCanvas(720, 500);
     setupOsc(7771, 7770);
     textSize(15);
       noStroke();
       // create sliders
       vslids[0] = new Vslider(20,10, "att", 0, 100, 10);
       vslids[1] = new Vslider(60,10, "dec", 0, 255, 100);
       vslids[2] = new Vslider(140,10, "sens", 0, 100, 44);
}

function draw() {
     var r = vslids[0].value();
     var g = vslids[1].value();
     var sens = vslids[2].value();
     sendOsc("/input/sensit", sens);
     VUmeters(200, 60, volL, volR);
}

function receiveOsc(address, value) {
     //console.log("received OSC: " + address + ", " + value);
     if (address == '/input/volume') {
         volL = min(abs(value[0]), 100);
         volR = min(abs(value[1]), 100);
         //console.log(volL);
     }
}

function sendOsc(address, value) {
     if (socketready) {
         if (oldval != value) {
             //console.log("Send " + address + ", " + value);
             socket.emit('message', [address].concat(value));
             oldval = value;
         }
     }
}

function setupOsc(oscPortIn, oscPortOut) {
     socket = io.connect('http://127.0.0.1:8081', { port: 8081, 
rememberTransport: false });
     socket.on('connect', function() {
         socket.emit('config', {
             server: { port: oscPortIn,  host: '127.0.0.1'},
             client: { port: oscPortOut, host: '127.0.0.1'}
         });
         socketready = true;
     });
     socket.on('message', function(msg) {
         if (msg[0] == '#bundle') {
             for (var i=2; i Thanks,
>
> Looking at the html, seems sketch.js is where the main code is? Can you send
> also that one?
>
> tarmo
>
> On Sunday, June 24, 2018 8:26:02 PM EEST you wrote:
>> Of course Tarmo. Good questions, btw.
>> Here are the files.
>>
>>
>> Richard
>>
>> On 24/06/18 19:04, Tarmo Johannes wrote:
>>> Hi,
>>>
>>> very nice demo, thanks!
>>> Would you care to share the html and csd file -  I am interested would it
>>> be possible to do similar thing withing CsoundQt (-html) or Csound-wasm
>>> so that you actually don't need web protocol but just Csound channels for
>>> communication?
>>>
>>> greetings,
>>> tarmo
>>>
>>> On Sunday, June 24, 2018 7:00:21 PM EEST you wrote:
>>>> Sliders and VU meters using p5js-OSC with Csound
>>>>
>>>> Richard
>>>>
>>>> https://www.youtube.com/watch?v=9_i4Oy_OEAM&feature=youtu.be
>>>>
>>>> Csound mailing list
>>>> Csound@listserv.heanet.ie
>>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>>> Send bugs reports to
>>>>
>>>>           https://github.com/csound/csound/issues
>>>>
>>>> Discussions of bugs and features can be posted here
>>> Csound mailing list
>>> Csound@listserv.heanet.ie
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>
>>>           https://github.com/csound/csound/issues
>>>
>>> Discussions of bugs and features can be posted here
>> Csound mailing list
>> Csound@listserv.heanet.ie
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>          https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>          https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here