[Csnd-dev] new UDP server commands
Date | 2017-10-14 12:36 |
From | Victor Lazzarini |
Subject | [Csnd-dev] new UDP server commands |
Hi everyone, I have implemented some extensions to the UDP server to allow for events and channel messages (control, for the moment) to be sent to Csound. It now recognises the following commands: $[score] @[channel_name value] in addition to orchestra code for compilation. For instance $i 1 0 1 will run instr 1 for 1 second and @input 1.0 will set control channel “input” to 1.0 in addition, the UDP server now uses the new async API functions for this. In git now. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 |
Date | 2017-10-14 16:09 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] new UDP server commands |
This is fantastic - enables much more flexible remote control! I built, tested and works as expected! I can see several ways how to use it in my projects. Thanks a lot! tarmo On Saturday, October 14, 2017 2:36:20 PM EEST you wrote: > Hi everyone, > > I have implemented some extensions to the UDP server to allow for events and > channel messages (control, for the moment) to be sent to Csound. > > It now recognises the following commands: > > $[score] > > @[channel_name value] > > in addition to orchestra code for compilation. > > For instance > > $i 1 0 1 > > will run instr 1 for 1 second > > and > > @input 1.0 > > will set control channel “input” to 1.0 > > in addition, the UDP server now uses the new async API functions for this. > In git now. > ======================== > Prof. Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy, > Maynooth University, > Maynooth, Co Kildare, Ireland > Tel: 00 353 7086936 > Fax: 00 353 1 7086952 |
Date | 2017-10-14 16:11 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] new UDP server commands |
The only thing I noticed was that when I send an empty string, the UDP server is stopped. Is it inteded this way? Although it is good to be able to stop the server remotely, I am afraid empty string can happen too easily and terminates the session in the middle. tarmo On Saturday, October 14, 2017 2:36:20 PM EEST you wrote: > Hi everyone, > > I have implemented some extensions to the UDP server to allow for events and > channel messages (control, for the moment) to be sent to Csound. > > It now recognises the following commands: > > $[score] > > @[channel_name value] > > in addition to orchestra code for compilation. > > For instance > > $i 1 0 1 > > will run instr 1 for 1 second > > and > > @input 1.0 > > will set control channel “input” to 1.0 > > in addition, the UDP server now uses the new async API functions for this. > In git now. > ======================== > Prof. Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy, > Maynooth University, > Maynooth, Co Kildare, Ireland > Tel: 00 353 7086936 > Fax: 00 353 1 7086952 |
Date | 2017-10-14 16:33 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
not really. Let me check this. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 14 Oct 2017, at 16:12, Tarmo Johannes |
Date | 2017-10-14 18:05 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
I checked this and I was getting "Parsing failed due to no input! Stopping on parser failure” but the server was still going. To close the server and Csound, use, as before ##close## or !!close!! Anyway, I’ve changed it not respond to empty strings. I’ve added another command: %[channel_name string] for string channels, e.g. %stringchn hello world!!! ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Oct 2017, at 16:11, Tarmo Johannes |
Date | 2017-10-14 18:07 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
I was thinking that CsoundQT could talk to the ‘Terminal Csound’ it launches via these commands. Maybe a feature for future implementations. It would allow running Csound safely as a separate process but still using the GUI. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Oct 2017, at 16:09, Tarmo Johannes |
Date | 2017-10-14 18:25 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] new UDP server commands |
But only if one uses Csound's audio io interfaces right?
|
Date | 2017-10-14 18:25 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] new UDP server commands |
And one way communication? On 14 Oct 2017 6:25 p.m., "Rory Walsh" <rorywalsh@ear.ie> wrote:
|
Date | 2017-10-14 18:40 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
CsoundQT does. No difference there. This is
using the cli frontenf.
A host using other audio IO can also start
a server and communicate with it from
another process.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-10-14 18:42 |
From | John ff |
Subject | Re: [Csnd-dev] new UDP server commands |
Are these new server commands documented? Sent from TypeApp On Oct 14, 2017, 18:06, at 18:06, Victor Lazzarini |
Date | 2017-10-14 18:45 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
yes, it only takes in commands. For the other direction, there needs to be a server on the other side to receive data.
There are a few options for feedback:
- UDP opcodes
- OSC opcodes
- API host implementing its own messaging.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-10-14 18:45 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
They will be. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 14 Oct 2017, at 18:43, John ff |
Date | 2017-10-14 19:06 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
Having said that it might be possible to request channel data and receive it via udp.
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-10-14 19:20 |
From | Guillermo Senna |
Subject | Re: [Csnd-dev] new UDP server commands |
Commands for enabling/disabling the transmission at every k-cycle (or maybe just when the value changes)? Or were you thinking more like "What's the current value of ChannelX? Send it to me at this UDP port"? On 14/10/17 15:06, Victor Lazzarini wrote: > Having said that it might be possible to request channel data and receive it via udp. > > Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy > Maynooth University > Ireland > > On 14 Oct 2017, at 18:45, Victor Lazzarini |
Date | 2017-10-14 19:35 |
From | Rory Walsh |
Subject | Re: [Csnd-dev] new UDP server commands |
I thought it also had the option of using its own audio callbacks. Either way, this could be a nice way to make CsoundQT more stable. I'm not sure it would be so useful with Cabbage where Csound is used only for processing. This
|
Date | 2017-10-14 19:51 |
From | Steven Yi |
Subject | Re: [Csnd-dev] new UDP server commands |
I've updated the Vim csound-repl plugin[1] to work with sending score. However, I found that sending notes with Named instruments, such as: i "MKeyPlayer" 0 10 caused an error: sread: unmatched quote section 1: at position -1 WARNING: Internal error in print_input_backtrace() too few pfields (1) illegal RT scoreline: i ^ unknown opcode " illegal RT scoreline: "MKeyP ^ Perhaps this is a side effect from changes for #681? (We should test -L stdin too I assume?) [1] - https://github.com/kunstmusik/csound-repl On Sat, Oct 14, 2017 at 7:36 AM, Victor Lazzarini |
Date | 2017-10-14 19:59 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
yes, probing for values is what I had in mind. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 14 Oct 2017, at 19:20, Guillermo Senna |
Date | 2017-10-14 20:01 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
Not in the current released version. Unless it's a new feature in the RC
Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-10-14 20:04 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
Maybe it's an issue with csoundReadScore()? Don't know whether it ever worked with named instruments. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 14 Oct 2017, at 19:52, Steven Yi |
Date | 2017-10-14 20:16 |
From | Guillermo Senna |
Subject | Re: [Csnd-dev] new UDP server commands |
Would it be to complicated to have commands for enabling/disabling the continuous (or after there's a change) transmission of the value inside a channel? Wouldn't that reduce network latency if one wants to code a UDP client? In any case, it's a great thing that you're further developing this! On 14/10/17 15:59, Victor Lazzarini wrote: > yes, probing for values is what I had in mind. > > Victor Lazzarini > Dean of Arts, Celtic Studies, and Philosophy > Maynooth University > Ireland > >> On 14 Oct 2017, at 19:20, Guillermo Senna |
Date | 2017-10-14 20:19 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
Yes, that is more complex and probably better done from an instrument. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy Maynooth University Ireland > On 14 Oct 2017, at 20:17, Guillermo Senna |
Date | 2017-10-14 20:51 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] new UDP server commands |
I remember suggesting this in St. Petersburg, if this works like I think it does, then I'm defenitely going to use UDP to communicate with csound instead of the API. But there was already socket instance available, but I never tried that enough to know if that already had what I had in mind. Look forward testing this, thanks Victor!
On 14 October 2017 at 21:19, Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote: Yes, that is more complex and probably better done from an instrument. |
Date | 2017-10-14 22:38 |
From | Tarmo Johannes |
Subject | Re: [Csnd-dev] new UDP server commands |
Attachments | udp-test.csd |
As a proof of concept, I wrote a small Qt app for android (but the same is easy to make works also on desktops and iOs) that sends UDP messages to Csound. Works very well, I cannot feel any noticeable latency. You can try it out: http://tarmo.uuu.ee/varia/failid/cs/udp-test.apk This app enables to load also other QML interface files where you can design your own UI and with method udpSender.sendUDPMessage send it to Csound. In future I think it would make sense to enable this app (or something similar) to read also the widget's part of CsoundQt csd-s or maybe even html. For separating Csound process from CsoundQt to make it more stable, it is not enough since it requires fast two way communication, accessing MIDI ringbuffers, messageCallbacks etc but I believe Qt's new QRemoteObjects or QLocalServer could do something similar. Anyway - this is great! Creating remote UI-s (for tablets for example) is so much easier! tarmo Here is csd I used for testing: --- |
Date | 2017-10-14 23:57 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
it was a bug in the async function. All fixed now. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Oct 2017, at 20:04, Victor Lazzarini |
Date | 2017-10-15 00:00 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
yes, I don’t think it is a full replacement to the API (we don’t want that), but just some extra functionality. I think we can have some limited feedback information going the other way using UDP as well, but nothing that involves streaming of signals or anything too time-critical. ======================== Prof. Victor Lazzarini Dean of Arts, Celtic Studies, and Philosophy, Maynooth University, Maynooth, Co Kildare, Ireland Tel: 00 353 7086936 Fax: 00 353 1 7086952 > On 14 Oct 2017, at 22:38, Tarmo Johannes |
Date | 2017-10-15 03:40 |
From | thorin kerr |
Subject | Re: [Csnd-dev] new UDP server commands |
I'm just a user but can I chime in? If messages - as in the Csound log messages - could be send via UDP you could get a kind of REPL going. Use case: Helps with livecoding. On 15 Oct 2017 10:01 AM, "Victor Lazzarini" <Victor.Lazzarini@mu.ie> wrote: yes, I don’t think it is a full replacement to the API (we don’t want that), but just some extra |
Date | 2017-10-25 15:12 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] new UDP server commands |
How does one send compileOrc or compileStr/Eval via udp, I send this directly and I get complete silence "instr 1\naout2 vco2 0.2, p4 \naout vco2 0.1, p4/2 \nouts aout+aout2/2, aout \nendin\n" but when there's for example newline missing, csound will throw parser error. Was there any dollar sign or some syntactical thing for compileOrc? On 15 October 2017 at 04:40, thorin kerr <thorin.kerr@gmail.com> wrote:
|
Date | 2017-10-25 15:17 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] new UDP server commands |
haha, delete and forget what I just asked, it was working, just had -m0 in my .csound6rc config :S On 25 October 2017 at 16:12, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2017-10-25 15:27 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] new UDP server commands |
of curiousity, what does `WARNING: Excess channels ignored` mean, fewer printing warnings is always a plus. On 25 October 2017 at 16:17, Hlöðver Sigurðsson <hlolli@gmail.com> wrote:
|
Date | 2017-10-25 16:31 |
From | Victor Lazzarini |
Subject | Re: [Csnd-dev] new UDP server commands |
it must come from an opcode that is not been used correctly (some mismatch with numbers of channels) Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland
|
Date | 2017-10-25 16:58 |
From | Steven Yi |
Subject | Re: [Csnd-dev] new UDP server commands |
Looks to be from a function called ochn in OOps/aops.c, which all of the out opcode uses at init-time: int ochn(CSOUND *csound, OUTX *p) { uint32_t nch = p->INOCOUNT; if (nch>csound->nchnls) csound->Warning(csound, Str("Excess channels ignored\n")); return OK; } Guessing you're calling one of the out opcodes with more audio signals than nchnls? On Wed, Oct 25, 2017 at 11:31 AM, Victor Lazzarini |
Date | 2017-10-25 17:14 |
From | Hlöðver Sigurðsson |
Subject | Re: [Csnd-dev] new UDP server commands |
aaah! Yes that explains it, that's exactly what I'm doing. As with 0dbfs, I'd need to add nchnls as command line argument. Pointer, which I can make PR myself, --0dbfs=1 works as command line argument, but is not documented here http://www.csounds.com/manual/html/CommandFlags.html Thanks for looking at this! On 25 October 2017 at 17:58, Steven Yi <stevenyi@gmail.com> wrote: Looks to be from a function called ochn in OOps/aops.c, which all of |