Csound Csound-dev Csound-tekno Search About

[Csnd] A Toggle button for Android Csound?

Date2023-09-04 23:53
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
Subject[Csnd] A Toggle button for Android Csound?
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>


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

Date2023-09-05 02:32
FromST Music
SubjectRe: [Csnd] A Toggle button for Android Csound?
Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok: 

kamp init 0
kamp chnget "butt1"

kOnOff init 0

ktrig trigger kamp, .5, 0
  if  ktrig == 1 then
      kOnOff += 1
   kamp = .3
  endif
  
  if  kOnOff %2 == 0 then
      kamp = 0
    else
      kamp = .3
  endif

Best,
Scott

On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>

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-09-05 02:35
FromST Music
SubjectRe: [Csnd] A Toggle button for Android Csound?
P.S. One thing... I forgot to remove the kamp line in the first if statement. It still works but you should probably delete it.

On Mon, Sept 4, 2023, 9:32 p.m. ST Music <stunes6556@gmail.com> wrote:
Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok: 

kamp init 0
kamp chnget "butt1"

kOnOff init 0

ktrig trigger kamp, .5, 0
  if  ktrig == 1 then
      kOnOff += 1
   kamp = .3
  endif
  
  if  kOnOff %2 == 0 then
      kamp = 0
    else
      kamp = .3
  endif

Best,
Scott

On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>

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-09-05 21:09
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] A Toggle button for Android Csound?
Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)

I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"

Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!

Art H.

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

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
Sent: Monday, September 4, 2023 9:32 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] A Toggle button for Android Csound?
 
Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok: 

kamp init 0
kamp chnget "butt1"

kOnOff init 0

ktrig trigger kamp, .5, 0
  if  ktrig == 1 then
      kOnOff += 1
   kamp = .3
  endif
  
  if  kOnOff %2 == 0 then
      kamp = 0
    else
      kamp = .3
  endif

Best,
Scott

On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>

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-09-05 21:54
FromST Music
SubjectRe: [Csnd] A Toggle button for Android Csound?
Hi Art, glad that works ok.

What with all the algorithmic/aleatoric stuff I do I've become somewhat "trigger-happy" =)

Still slightly surprised there aren't more obvious Csound for Android users. While maybe not the easiest platform for editing, with the relative power & portability of newer phones & tablets it's amazing how much one can do with something that fits in your pocket. Even for those with computers, to be able to tinker while commuting or just simply lying on the couch or in bed it's such a great tool.

And with the widgets one could quite conceivably pull off an interactive live performance.

Perhaps I'll see you tomorrow you on Michael's Zoom meeting.

Best,
Scott

On Tue, Sept 5, 2023, 4:09 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)

I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"

Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!

Art H.

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
Sent: Monday, September 4, 2023 9:32 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] A Toggle button for Android Csound?
 
Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok: 

kamp init 0
kamp chnget "butt1"

kOnOff init 0

ktrig trigger kamp, .5, 0
  if  ktrig == 1 then
      kOnOff += 1
   kamp = .3
  endif
  
  if  kOnOff %2 == 0 then
      kamp = 0
    else
      kamp = .3
  endif

Best,
Scott

On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>

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

Date2023-09-05 21:55
From"Brian R."
SubjectRe: [Csnd] A Toggle button for Android Csound?
It has so much power I am switching from making standalone csound apps
to creating a whole set of different csd's that work with the app.

On Tue, Sep 5, 2023 at 1:54 PM ST Music  wrote:
>
> Hi Art, glad that works ok.
>
> What with all the algorithmic/aleatoric stuff I do I've become somewhat "trigger-happy" =)
>
> Still slightly surprised there aren't more obvious Csound for Android users. While maybe not the easiest platform for editing, with the relative power & portability of newer phones & tablets it's amazing how much one can do with something that fits in your pocket. Even for those with computers, to be able to tinker while commuting or just simply lying on the couch or in bed it's such a great tool.
>
> And with the widgets one could quite conceivably pull off an interactive live performance.
>
> Perhaps I'll see you tomorrow you on Michael's Zoom meeting.
>
> Best,
> Scott
>
> On Tue, Sept 5, 2023, 4:09 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)
>>
>> I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"
>>
>> Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!
>>
>> Art H.
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> ________________________________
>> From: A discussion list for users of Csound  on behalf of ST Music 
>> Sent: Monday, September 4, 2023 9:32 PM
>> To: CSOUND@LISTSERV.HEANET.IE 
>> Subject: Re: [Csnd] A Toggle button for Android Csound?
>>
>> Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok:
>>
>> kamp init 0
>> kamp chnget "butt1"
>>
>> kOnOff init 0
>>
>> ktrig trigger kamp, .5, 0
>>   if  ktrig == 1 then
>>       kOnOff += 1
>>    kamp = .3
>>   endif
>>
>>   if  kOnOff %2 == 0 then
>>       kamp = 0
>>     else
>>       kamp = .3
>>   endif
>>
>> Best,
>> Scott
>>
>> On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.
>>
>> According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.
>>
>> Can any brave soul turn the following example into a toggle switch, using the older syntax please?
>>
>> TIA
>> Art Hunkins
>> --------------------------------------------------
>> 
>> 
>>
>> -odac -d
>>
>> 
>> 
>>
>>       sr = 44100
>>       ksmps = 32
>>       nchnls = 2
>>       0dbfs  = 1
>>
>>       instr 1
>>
>> kamp  init 0
>> kamp  chnget "butt1"
>>
>> ktrig trigger kamp, .5, 0
>>       if  ktrig == 1 then
>> kamp  = .3
>>       endif
>> ktrig trigger kamp, .5, 1
>>       if ktrig == 1 then
>> kamp  = 0
>>       endif
>>
>> a1    lfo kamp, 400
>>       outs a1, a1
>>
>>       endin
>>
>> 
>> 
>>
>> i1 0 z
>>
>> e
>>
>> 
>> 
>>
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> 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

Date2023-09-05 23:06
FromST Music
SubjectRe: [Csnd] A Toggle button for Android Csound?
Hi Brian. Welcome to my world! Or Our world, Art included, apologies to other users out there I'm oblivious to. I've been in the trenches for a bit. I don't currently have a computer so all my work is done with the app. I have many csd's & am currently working on developing a more UDO and #include based library of toys for more "modular" flexibility.

I'm not a very experienced user/programmer but for anyone interested I'm slowly getting around to building a github repo for sharing them. There aren't many yet & they're generally quite simple, I'm still wrapping my head around the learning curve involved with something as versatile as Csound.


Here's my Csound SoundCloud page, all pieces were written, edited & produced with a phone & using only the Android app. Some pieces & short examples of experiments.


Shameless self-promotion aside, I hope to see more users taking advantage of the app & of course a big thanks to Michael, Steven & Victor & anyone else involved in the development & maintainance of it.

One of my goals has been to help promote and raise awareness of the app, the hope being that with more vocal users it might help encourage continued growth and support for newer versions of Andoid.

Best,
Scott

On Tue, Sept 5, 2023, 4:56 p.m. Brian R. <brianwredfern@gmail.com> wrote:
It has so much power I am switching from making standalone csound apps
to creating a whole set of different csd's that work with the app.

On Tue, Sep 5, 2023 at 1:54 PM ST Music <stunes6556@gmail.com> wrote:
>
> Hi Art, glad that works ok.
>
> What with all the algorithmic/aleatoric stuff I do I've become somewhat "trigger-happy" =)
>
> Still slightly surprised there aren't more obvious Csound for Android users. While maybe not the easiest platform for editing, with the relative power & portability of newer phones & tablets it's amazing how much one can do with something that fits in your pocket. Even for those with computers, to be able to tinker while commuting or just simply lying on the couch or in bed it's such a great tool.
>
> And with the widgets one could quite conceivably pull off an interactive live performance.
>
> Perhaps I'll see you tomorrow you on Michael's Zoom meeting.
>
> Best,
> Scott
>
> On Tue, Sept 5, 2023, 4:09 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)
>>
>> I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"
>>
>> Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!
>>
>> Art H.
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> ________________________________
>> From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
>> Sent: Monday, September 4, 2023 9:32 PM
>> To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
>> Subject: Re: [Csnd] A Toggle button for Android Csound?
>>
>> Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok:
>>
>> kamp init 0
>> kamp chnget "butt1"
>>
>> kOnOff init 0
>>
>> ktrig trigger kamp, .5, 0
>>   if  ktrig == 1 then
>>       kOnOff += 1
>>    kamp = .3
>>   endif
>>
>>   if  kOnOff %2 == 0 then
>>       kamp = 0
>>     else
>>       kamp = .3
>>   endif
>>
>> Best,
>> Scott
>>
>> On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.
>>
>> According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.
>>
>> Can any brave soul turn the following example into a toggle switch, using the older syntax please?
>>
>> TIA
>> Art Hunkins
>> --------------------------------------------------
>> <CsoundSynthesizer>
>> <CsOptions>
>>
>> -odac -d
>>
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 32
>> nchnls = 2
>> 0dbfs  = 1
>>
>> instr 1
>>
>> kamp  init 0
>> kamp  chnget "butt1"
>>
>> ktrig trigger kamp, .5, 0
>> if  ktrig == 1 then
>> kamp  = .3
>> endif
>> ktrig trigger kamp, .5, 1
>> if ktrig == 1 then
>> kamp  = 0
>> endif
>>
>> a1    lfo kamp, 400
>> outs a1, a1
>>
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1 0 z
>>
>> e
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> 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
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-09-06 04:25
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] A Toggle button for Android Csound?
I'll be there on Zoom. Wouldn't want to miss this one!

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

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
Sent: Tuesday, September 5, 2023 4:54 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] A Toggle button for Android Csound?
 
Hi Art, glad that works ok.

What with all the algorithmic/aleatoric stuff I do I've become somewhat "trigger-happy" =)

Still slightly surprised there aren't more obvious Csound for Android users. While maybe not the easiest platform for editing, with the relative power & portability of newer phones & tablets it's amazing how much one can do with something that fits in your pocket. Even for those with computers, to be able to tinker while commuting or just simply lying on the couch or in bed it's such a great tool.

And with the widgets one could quite conceivably pull off an interactive live performance.

Perhaps I'll see you tomorrow you on Michael's Zoom meeting.

Best,
Scott

On Tue, Sept 5, 2023, 4:09 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)

I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"

Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!

Art H.

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
Sent: Monday, September 4, 2023 9:32 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] A Toggle button for Android Csound?
 
Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok: 

kamp init 0
kamp chnget "butt1"

kOnOff init 0

ktrig trigger kamp, .5, 0
  if  ktrig == 1 then
      kOnOff += 1
   kamp = .3
  endif
  
  if  kOnOff %2 == 0 then
      kamp = 0
    else
      kamp = .3
  endif

Best,
Scott

On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.

According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.

Can any brave soul turn the following example into a toggle switch, using the older syntax please?

TIA
Art Hunkins
--------------------------------------------------
<CsoundSynthesizer>
<CsOptions>

-odac -d

</CsOptions>
<CsInstruments>

      sr = 44100
      ksmps = 32
      nchnls = 2
      0dbfs  = 1

      instr 1

kamp  init 0
kamp  chnget "butt1"

ktrig trigger kamp, .5, 0
      if  ktrig == 1 then
kamp  = .3
      endif
ktrig trigger kamp, .5, 1
      if ktrig == 1 then
kamp  = 0
      endif

a1    lfo kamp, 400
      outs a1, a1

      endin

</CsInstruments>
<CsScore>

i1 0 z

e

</CsScore>
</CsoundSynthesizer>

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

Date2023-09-06 04:34
FromArthur Hunkins <000001e1d761dea2-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd] A Toggle button for Android Csound?
I've done concurrent Android versions of my Csound (MIDI) compositions for years now. A bunch of sliders, and sometimes several buttons, are all I need.

Minimal changes are required to convert - especially if you begin by coding controllers in the 0-1 range, and don't require too many function tables to tweak controller output.

Recent smartphones can handle just about anything I throw at them.

Art H.

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

From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of Brian R. <brianwredfern@GMAIL.COM>
Sent: Tuesday, September 5, 2023 4:55 PM
To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
Subject: Re: [Csnd] A Toggle button for Android Csound?
 
It has so much power I am switching from making standalone csound apps
to creating a whole set of different csd's that work with the app.

On Tue, Sep 5, 2023 at 1:54 PM ST Music <stunes6556@gmail.com> wrote:
>
> Hi Art, glad that works ok.
>
> What with all the algorithmic/aleatoric stuff I do I've become somewhat "trigger-happy" =)
>
> Still slightly surprised there aren't more obvious Csound for Android users. While maybe not the easiest platform for editing, with the relative power & portability of newer phones & tablets it's amazing how much one can do with something that fits in your pocket. Even for those with computers, to be able to tinker while commuting or just simply lying on the couch or in bed it's such a great tool.
>
> And with the widgets one could quite conceivably pull off an interactive live performance.
>
> Perhaps I'll see you tomorrow you on Michael's Zoom meeting.
>
> Best,
> Scott
>
> On Tue, Sept 5, 2023, 4:09 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> Thanks, Scott. Exactly what I needed. Was able to come up with a handy little Android Widget Tester with your help. (It works with Android Csound all the way back to CSD Player - complete with a one-line console message tracking output.)
>>
>> I had gotten all into the weeds dealing with downward triggers, MIDI output (completely off-track), what Csound and Android might be doing with trigger outputs, etc. It had never dawned on me that I could completely forget about how triggers were "returning to zero!"
>>
>> Thanks again. Thankfully at least a few Csounders like you and Michael care about Android!
>>
>> Art H.
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> ________________________________
>> From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of ST Music <stunes6556@GMAIL.COM>
>> Sent: Monday, September 4, 2023 9:32 PM
>> To: CSOUND@LISTSERV.HEANET.IE <CSOUND@LISTSERV.HEANET.IE>
>> Subject: Re: [Csnd] A Toggle button for Android Csound?
>>
>> Hi Art, so you want a latched/toggle switch? Perhaps there's a better method but this seems to work ok:
>>
>> kamp init 0
>> kamp chnget "butt1"
>>
>> kOnOff init 0
>>
>> ktrig trigger kamp, .5, 0
>>   if  ktrig == 1 then
>>       kOnOff += 1
>>    kamp = .3
>>   endif
>>
>>   if  kOnOff %2 == 0 then
>>       kamp = 0
>>     else
>>       kamp = .3
>>   endif
>>
>> Best,
>> Scott
>>
>> On Mon, Sept 4, 2023, 6:53 p.m. Arthur Hunkins <000001e1d761dea2-dmarc-request@listserv.heanet.ie> wrote:
>>
>> For the life of me, I cannot manage to change the momentary contact buttons of Csound for Android into toggle switches.
>>
>> According to Michael's User Guide, buttons output a 1 when pressed, and a 0 when released. The example below gives the usual momentary contact result.
>>
>> Can any brave soul turn the following example into a toggle switch, using the older syntax please?
>>
>> TIA
>> Art Hunkins
>> --------------------------------------------------
>> <CsoundSynthesizer>
>> <CsOptions>
>>
>> -odac -d
>>
>> </CsOptions>
>> <CsInstruments>
>>
>>       sr = 44100
>>       ksmps = 32
>>       nchnls = 2
>>       0dbfs  = 1
>>
>>       instr 1
>>
>> kamp  init 0
>> kamp  chnget "butt1"
>>
>> ktrig trigger kamp, .5, 0
>>       if  ktrig == 1 then
>> kamp  = .3
>>       endif
>> ktrig trigger kamp, .5, 1
>>       if ktrig == 1 then
>> kamp  = 0
>>       endif
>>
>> a1    lfo kamp, 400
>>       outs a1, a1
>>
>>       endin
>>
>> </CsInstruments>
>> <CsScore>
>>
>> i1 0 z
>>
>> e
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> abhunkin@uncg.edu
>> http://www.arthunkins.com
>> 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

Date2023-09-06 21:39
From"Brian R."
SubjectRe: [Csnd] A Toggle button for Android Csound?
At this point to me it makes more sense to use the android app for
android stuff, but then I am using the csound wasm api to build out an
MPE enabled instrument with full MIDI IO and support for my own MPE
based jamstik guitar, but as a PWA I can run it on windows or manjaro
or android and possibly soon even on Apple as they slowly start to
support PWA.

But since I'm just getting started I don't have much to show yet
except design sketches.

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