Csound Csound-dev Csound-tekno Search About

[Csnd] Csound API vs osc message

Date2011-07-17 08:59
FromTarmo Johannes
Subject[Csnd] Csound API vs osc message
Hi, just sharing thoughts:

I have been exploring a bit possibilities to use different hardware (also trivial like mouse, keyboard etc) to control sound synthesis.
At first my way was to write a program pr script that reads the info from the device, runs csound csd in another thread through csound API and feeds the values to Csound via SetChannel -> chnget.

Now I realized that using OSC messages is far more versatile and flexible. Sending a message from python script is as simple as:
------------
import sys,import liblo

target=liblo.Address("tarmo-desktop",7770)
liblo.send(target, "/csound/osctest",('f', 1950.5) )
-------------
(- you have to have python-liblo module installed)

and receive it in csound with
--------
gihandle OSCinit 7770	
 ..
	kk  OSClisten gihandle, "/csound/osctest", "f", kf1 ; within a scope of a instrument
...
-------------


The advantages are:
- THE BEST: you can have your csd running in QuteCsound (or other frontend) and you can use all the powerof the widgets
- you can send the messages to any OSC supporting software, not only csound (PD, Max, Ardour, Ianiix, etc Live should be possible to read OSC)
- the scipts(s) and csound can be run in different computer(s)
- if one crashes, the other keaps running, so it is easier to restart one or other

I have not experimented much but it  looks the way to go. What could be the pros of using API? It is porbably faster but hardly this is an issue thinking that both chnget and OSClisten work only in k-rate anyway.

greetings,
tarmo


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"

Date2011-07-17 10:32
FromPINOT Francois
SubjectRe: [Csnd] Csound API vs osc message
The Csound API is not limited to k-rate in/out channels. It gives you 
full access to Csound components and data streams to all rates (the 
Csound command itself is actually writen as a process using the API). I 
see OSC as a valuable and more versatile alternative to MIDI. The Csound 
API has a different and larger field of application than OSC even if, as 
you show it, they can share some features.

Best

Francois

Le 17/07/2011 09:59, Tarmo Johannes a écrit :
> Hi, just sharing thoughts:
>
> I have been exploring a bit possibilities to use different hardware (also trivial like mouse, keyboard etc) to control sound synthesis.
> At first my way was to write a program pr script that reads the info from the device, runs csound csd in another thread through csound API and feeds the values to Csound via SetChannel ->  chnget.
> a process
> Now I realized that using OSC messages is far more versatile and flexible. Sending a message from python script is as simple as:
> ------------
> import sys,import liblo
>
> target=liblo.Address("tarmo-desktop",7770)
> liblo.send(target, "/csound/osctest",('f', 1950.5) )
> -------------
> (- you have to have python-liblo module installed)
>
> and receive it in csound with
> --------
> gihandle OSCinit 7770	
>   ..
> 	kk  OSClisten gihandle, "/csound/osctest", "f", kf1 ; within a scope of a instrument
> ...
> -------------
>
>
> The advantages are:
> - THE BEST: you can have your csd running in QuteCsound (or other frontend) and you can use all the powerof the widgets
> - you can send the messages to any OSC supporting software, not only csound (PD, Max, Ardour, Ianiix, etc Live should be possible to read OSC)
> - the scipts(s) and csound can be run in different computer(s)
> - if one crashes, the other keaps running, so it is easier to restart one or other
>
> I have not experimented much but it  looks the way to go. What could be the pros of using API? It is porbably faster but hardly this is an issue thinking that both chnget and OSClisten work only in k-rate anyway.
>
> greetings,
> tarmo
>
>
> Send bugs reports to the Sourceforge bug tracker
>              https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>


Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"