Csound Csound-dev Csound-tekno Search About

[Csnd] (Touch)OSC and Csound

Date2023-11-25 16:52
FromPhilipp Neumann
Subject[Csnd] (Touch)OSC and Csound
Hello everybody!

I have some problems with setting up the connection from my iPad to my Mac for controlling Csound via TouchOSC.
I’m new to working with OSC, but i checked out the floss examples.

I initialised the connection via OSCinit in Csound and also tried out sending messages and printing them with the hexler protokol app, which works fine.
But i can’t get values inside my Csound patch, where i want wo print them.

Is there someone who has experience with this and can describe what i have to do to set everything up?
And does someone know if i can print OSC messages inside the terminal of MacOS for debugging purposes?

This is my test instrument and i don’t get errors.



-d -odac -W -3 


sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 1.0


giOSC OSCinit 9000

instr 1
  kAmp init 0
  kFreq init 0
  kAmpT OSClisten giOSC,"/fader1","f",kAmp
  kFreqT OSClisten giOSC,"/fader2","f",kFreq

  kAmp scale kAmp,0,-90,1.,0.
  printks2 "Amp: %d\n",kAmp
  kFreq scale kFreq,80,320
  printks2 "Freq: %d\n",kFreq
  aSig poscil3 ampdbfs(kAmp),kFreq

  outs aSig,aSig
endin
;-----------------------------------------------------------


i1 0 1000



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

Date2023-11-25 17:22
Fromjohn
SubjectRe: [Csnd] (Touch)OSC and Csound
Should you not check the value of kAmpT and kFreqT to see if thwere is a 
value avalilable for kAmp and kFreq?

I use OSC quite a lot but only between csoud instances so ? have nothing 
to say about the iPad, floss or touchOSC

==John ff

On Sat, 25 Nov 2023, Philipp Neumann wrote:

> Hello everybody!
>
> I have some problems with setting up the connection from my iPad to my Mac for controlling Csound via TouchOSC.
> I’m new to working with OSC, but i checked out the floss examples.
>
> I initialised the connection via OSCinit in Csound and also tried out sending messages and printing them with the hexler protokol app, which works fine.
> But i can’t get values inside my Csound patch, where i want wo print them.
>
> Is there someone who has experience with this and can describe what i have to do to set everything up?
> And does someone know if i can print OSC messages inside the terminal of MacOS for debugging purposes?
>
> This is my test instrument and i don’t get errors.
>
> 
> 
> -d -odac -W -3
> 
> 
> sr = 48000
> ksmps = 64
> nchnls = 2
> 0dbfs = 1.0
>
>
> giOSC OSCinit 9000
>
> instr 1
>  kAmp init 0
>  kFreq init 0
>  kAmpT OSClisten giOSC,"/fader1","f",kAmp
>  kFreqT OSClisten giOSC,"/fader2","f",kFreq
>
>  kAmp scale kAmp,0,-90,1.,0.
>  printks2 "Amp: %d\n",kAmp
>  kFreq scale kFreq,80,320
>  printks2 "Freq: %d\n",kFreq
>  aSig poscil3 ampdbfs(kAmp),kFreq
>
>  outs aSig,aSig
> endin
> ;-----------------------------------------------------------
> 
> 
> i1 0 1000
> 
> 
>
> 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

Date2023-11-25 17:29
FromPhilipp Neumann
SubjectRe: [Csnd] (Touch)OSC and Csound
Are the left arguments not like „trigger“ that just allow for checking if something changed there?
I thought the new values are written to the last argument of OSClisten and i can just use them i my instrument and ignore the ’trigger’ arguments.

> Am 25.11.2023 um 18:22 schrieb john :
> 
> Should you not check the value of kAmpT and kFreqT to see if thwere is a value avalilable for kAmp and kFreq?
> 
> I use OSC quite a lot but only between csoud instances so ? have nothing to say about the iPad, floss or touchOSC
> 
> ==John ff
> 
> On Sat, 25 Nov 2023, Philipp Neumann wrote:
> 
>> Hello everybody!
>> 
>> I have some problems with setting up the connection from my iPad to my Mac for controlling Csound via TouchOSC.
>> I’m new to working with OSC, but i checked out the floss examples.
>> 
>> I initialised the connection via OSCinit in Csound and also tried out sending messages and printing them with the hexler protokol app, which works fine.
>> But i can’t get values inside my Csound patch, where i want wo print them.
>> 
>> Is there someone who has experience with this and can describe what i have to do to set everything up?
>> And does someone know if i can print OSC messages inside the terminal of MacOS for debugging purposes?
>> 
>> This is my test instrument and i don’t get errors.
>> 
>> 
>> 
>> -d -odac -W -3
>> 
>> 
>> sr = 48000
>> ksmps = 64
>> nchnls = 2
>> 0dbfs = 1.0
>> 
>> 
>> giOSC OSCinit 9000
>> 
>> instr 1
>> kAmp init 0
>> kFreq init 0
>> kAmpT OSClisten giOSC,"/fader1","f",kAmp
>> kFreqT OSClisten giOSC,"/fader2","f",kFreq
>> 
>> kAmp scale kAmp,0,-90,1.,0.
>> printks2 "Amp: %d\n",kAmp
>> kFreq scale kFreq,80,320
>> printks2 "Freq: %d\n",kFreq
>> aSig poscil3 ampdbfs(kAmp),kFreq
>> 
>> outs aSig,aSig
>> endin
>> ;-----------------------------------------------------------
>> 
>> 
>> i1 0 1000
>> 
>> 
>> 
>> 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

Date2023-11-25 18:11
Fromjohn
SubjectRe: [Csnd] (Touch)OSC and Csound
Not my understanding The kAMmpT is zrero ifno messahge has been receied 
and 1 if it has.  Otherwise what value could kAmp have?
   The manual looksclear to me

kans is set to 1 if a new message was received, or 0 if not. If multiple 
messages are received in a si.....

==John ff

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

Date2023-11-26 15:31
FromPhilipp Neumann
SubjectRe: [Csnd] (Touch)OSC and Csound
> Am 25.11.2023 um 19:11 schrieb john :
> 
> Not my understanding The kAMmpT is zrero ifno messahge has been receied and 1 if it has.  
This is what i meant with „trigger“.

> Otherwise what value could kAmp have?

i thought kAmp is having then the values im sending on the adress i put in before „/fader1“ or whatever i put there.

Or does OSC behave differently? I’m a little bit stucked.

No one has experience with touchOsc and Csound?

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

Date2023-11-26 18:58
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] (Touch)OSC and Csound
I wrote a 2014 article on TouchOSC and Csound. It can be found, along with a lot of templates, as the last entry​ at: http://arthunkins.com/Android_Csound_Apps.htm .

I doubt, however, that it will have anything to do with your project. But nevertheless . . .

Art H.


abhunkin@uncg.edu
http://www.arthunkins.com

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Philipp Neumann <philipp@VON-NEUMANN.COM>
Sent: Sunday, November 26, 2023 10:31 AM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] (Touch)OSC and Csound
 
> Am 25.11.2023 um 19:11 schrieb john <jpff@CODEMIST.CO.UK>:
>
> Not my understanding The kAMmpT is zrero ifno messahge has been receied and 1 if it has. 
This is what i meant with „trigger“.

> Otherwise what value could kAmp have?

i thought kAmp is having then the values im sending on the adress i put in before „/fader1“ or whatever i put there.

Or does OSC behave differently? I’m a little bit stucked.

No one has experience with touchOsc and Csound?

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

Date2023-11-27 09:30
FromTarmo Johannes
SubjectRe: [Csnd] (Touch)OSC and Csound
Hi!

I have used TouchOSC in serveral occasions in the past, it works like any other OSC sender.

Try this code:


giOSC OSCinit 9000


instr 1

kAmp init 0

kFreq init 0

kAmpData init 0

kFreqData init 0

kAmpT OSClisten giOSC,"/1/fader1","f",kAmpData

kFreqT OSClisten giOSC,"/1/fader2","f",kFreqData

if (kAmpT==1) then

kAmp = kAmpData

endif

if (kFreqT==1) then

kFreq = kFreqData

endif

printk2 kAmp

printk2 kFreq

; kAmp scale kAmp,0,-90,1.,0.

; printks2 "Amp: %d\n",kAmp

; kFreq scale kFreq,80,320

; printks2 "Freq: %d\n",kFreq

; aSig poscil3 ampdbfs(kAmp),kFreq

;

; outs aSig,aSig

endin


The idea is that you don't use the data read bu OSClisten directly but put it to your "working" variable only when there is data.

I needed to change the OSC path according to  my  very old app, change it back what is correct for you.

Hope it helps!
tarmo

Kontakt Arthur Hunkins (<000001e1d761dea2-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval P, 26. november 2023 kell 20:58:
I wrote a 2014 article on TouchOSC and Csound. It can be found, along with a lot of templates, as the last entry​ at: http://arthunkins.com/Android_Csound_Apps.htm .

I doubt, however, that it will have anything to do with your project. But nevertheless . . .

Art H.



From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Philipp Neumann <philipp@VON-NEUMANN.COM>
Sent: Sunday, November 26, 2023 10:31 AM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] (Touch)OSC and Csound
 
> Am 25.11.2023 um 19:11 schrieb john <jpff@CODEMIST.CO.UK>:
>
> Not my understanding The kAMmpT is zrero ifno messahge has been receied and 1 if it has. 
This is what i meant with „trigger“.

> Otherwise what value could kAmp have?

i thought kAmp is having then the values im sending on the adress i put in before „/fader1“ or whatever i put there.

Or does OSC behave differently? I’m a little bit stucked.

No one has experience with touchOsc and Csound?

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

Date2023-11-27 10:17
FromPhilipp Neumann
SubjectRe: [Csnd] (Touch)OSC and Csound
Hi Tarmo!

Thanks a lot! This works great for me!

Best,
Philipp

> Am 27.11.2023 um 10:30 schrieb Tarmo Johannes :
> 
> Hi!
> 
> I have used TouchOSC in serveral occasions in the past, it works like any other OSC sender.
> 
> Try this code:
> 
> 
> giOSC OSCinit 9000
> 
> instr 1
> kAmp init 0
> kFreq init 0
> kAmpData init 0
> kFreqData init 0
> kAmpT OSClisten giOSC,"/1/fader1","f",kAmpData
> kFreqT OSClisten giOSC,"/1/fader2","f",kFreqData
> if (kAmpT==1) then
> kAmp = kAmpData
> endif
> if (kFreqT==1) then
> kFreq = kFreqData
> endif
> printk2 kAmp
> printk2 kFreq
> ; kAmp scale kAmp,0,-90,1.,0.
> ; printks2 "Amp: %d\n",kAmp
> ; kFreq scale kFreq,80,320
> ; printks2 "Freq: %d\n",kFreq
> ; aSig poscil3 ampdbfs(kAmp),kFreq
> ;
> ; outs aSig,aSig
> endin
> 
> The idea is that you don't use the data read bu OSClisten directly but put it to your "working" variable only when there is data.
> 
> I needed to change the OSC path according to  my  very old app, change it back what is correct for you.
> 
> Hope it helps!
> tarmo
> 
> Kontakt Arthur Hunkins (<000001e1d761dea2-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval P, 26. november 2023 kell 20:58:
> I wrote a 2014 article on TouchOSC and Csound. It can be found, along with a lot of templates, as the last entry​ at: http://arthunkins.com/Android_Csound_Apps.htm .
> 
> I doubt, however, that it will have anything to do with your project. But nevertheless . . .
> 
> Art H.
> Android Csound Apps and Other Android Materials for Csound
> Android Csound Apps and Other Android Materials for Csound by Art Hunkins
> arthunkins.com
> 
> 
> abhunkin@uncg.edu
> http://www.arthunkins.com
> From: A discussion list for users of Csound  on behalf of Philipp Neumann 
> Sent: Sunday, November 26, 2023 10:31 AM
> To: CSOUND@LISTSERV.HEANET.IE 
> Subject: Re: [Csnd] (Touch)OSC and Csound   > Am 25.11.2023 um 19:11 schrieb john :
> > 
> > Not my understanding The kAMmpT is zrero ifno messahge has been receied and 1 if it has.  
> This is what i meant with „trigger“.
> 
> > Otherwise what value could kAmp have?
> 
> i thought kAmp is having then the values im sending on the adress i put in before „/fader1“ or whatever i put there.
> 
> Or does OSC behave differently? I’m a little bit stucked.
> 
> No one has experience with touchOsc and Csound?
> 
> 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