Csound Csound-dev Csound-tekno Search About

[Csnd] Voice stealing mechanism turnoff2 question

Date2013-06-25 12:51
Fromlppier
Subject[Csnd] Voice stealing mechanism turnoff2 question
Hi, I currently have a really simple instrument here that does voice
stealing, turning off instrument 1 instances when the number of voices is
more than 16. The reason I did this is to reduce the CPU load. 

When I use it, and I use it with less "noisy" sounds, I can hear a soft
click sound when the instruments are being turned off. 

I'm aware that turnoff2 has a flag that allows the instrument to follow its
own release envelope before being turned off. But in many cases this is not
fast enough and the CPU overloads quickly causing stuttering. 

Is there any way to damp the turning off by turnoff2 such that it follows a
quick release envelope that won't cause any clicks? I'm suspecting this is
the way hardware synths do it. 

instr 3
kinstr init 1
kactive active kinstr
if kactive > 16 then
turnoff2 kinstr, 1, 0
endif
endin




--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-25 13:01
FromRory Walsh
SubjectRe: [Csnd] Voice stealing mechanism turnoff2 question
How about using one of the 'r' family of envelopes? This will cause a
release to take place for a set amount of time after the note has been
turned off. For instance you could use linenr to make sure things fade
out graciously?

Date2013-06-25 13:12
FromVictor Lazzarini
SubjectRe: [Csnd] Voice stealing mechanism turnoff2 question
First make sure you use envelope generators with extra-time extension (linenr, etc).
However, the final release time is set at the start of the note.
The problem is that release time is set at init-time in most env generators, 
so it cannot be changed when you are performing a given note. 

You could try modifying this other envelope generator:


which can have a k-rate value for its parameters (they are i-time but that can
be just changed to k-time I think, without any other modification).
(btw, I noticed the description is wrong, saying that low is (2), when it's 0.)

Then you can change the decay if you need to shorten it. 

Victor
On 25 Jun 2013, at 12:51, lppier wrote:

Hi, I currently have a really simple instrument here that does voice
stealing, turning off instrument 1 instances when the number of voices is
more than 16. The reason I did this is to reduce the CPU load.

When I use it, and I use it with less "noisy" sounds, I can hear a soft
click sound when the instruments are being turned off.

I'm aware that turnoff2 has a flag that allows the instrument to follow its
own release envelope before being turned off. But in many cases this is not
fast enough and the CPU overloads quickly causing stuttering.

Is there any way to damp the turning off by turnoff2 such that it follows a
quick release envelope that won't cause any clicks? I'm suspecting this is
the way hardware synths do it.

instr 3
kinstr init 1
kactive active kinstr
if kactive > 16 then
turnoff2 kinstr, 1, 0
endif
endin




--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-25 13:16
FromIain McCurdy
SubjectRE: [Csnd] Voice stealing mechanism turnoff2 question
Adding an 'r' envelope to the instrument that will be turned off in you example will break the mechanism and all instruments will turn off. I prefer to use turnoff in the instrument itself. Here is what I use to turn off the oldest note (with soft release) when a polyphony limit is exceeded:
---
gkactive init 0     ; number of active instances of note
giMaxPolyphony  = 2 ; polyphony limit

instr 1
; polyphony control...
gkactive init i(gkactive) + 1   ;increment note counter
if gkactive>giMaxPolyphony then ;if polyphony is exceeded (through the addition of new note)
 turnoff                        ;remove this note
endif
krel release                    ;if note held = 0, if note released = 1
ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e. note has been released... 
if ktrig==1 then                ;
 gkactive = gkactive - 1        ;...decrement active notes counter
endif

; make a sound...
icps  cpsmidi
iamp  ampmidi 1
aenv  linsegr 0,0.05,1, 0.2, 0
asig  vco2    0.1, icps, 4,0.5
      out     asig*aenv
endin
---


> Date: Tue, 25 Jun 2013 04:51:35 -0700
> From: madstrum@gmail.com
> To: csound@lists.bath.ac.uk
> Subject: [Csnd] Voice stealing mechanism turnoff2 question
>
> Hi, I currently have a really simple instrument here that does voice
> stealing, turning off instrument 1 instances when the number of voices is
> more than 16. The reason I did this is to reduce the CPU load.
>
> When I use it, and I use it with less "noisy" sounds, I can hear a soft
> click sound when the instruments are being turned off.
>
> I'm aware that turnoff2 has a flag that allows the instrument to follow its
> own release envelope before being turned off. But in many cases this is not
> fast enough and the CPU overloads quickly causing stuttering.
>
> Is there any way to damp the turning off by turnoff2 such that it follows a
> quick release envelope that won't cause any clicks? I'm suspecting this is
> the way hardware synths do it.
>
> instr 3
> kinstr init 1
> kactive active kinstr
> if kactive > 16 then
> turnoff2 kinstr, 1, 0
> endif
> endin
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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"
>

Date2013-06-26 03:43
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question

Hi Rory, 


In my instrument (that I'm turning off) I'm using this : 
a1 linsegr 0, iattack1, imodamt, idecay1, isustain1, irelease1, 0

However, the release is set when I play the note. I'm looking for a way to quick release the oldest note (so that it doesn't click) when polyphony is exceeded. 

Thanks. 

Pier.



On 25 Jun, 2013, at 8:02 PM, rory walsh [via Csound] <[hidden email]> wrote:

How about using one of the 'r' family of envelopes? This will cause a
release to take place for a set amount of time after the note has been
turned off. For instance you could use linenr to make sure things fade
out graciously?


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 <a href="x-msg://22/user/SendEmail.jtp?type=node&amp;node=5724828&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe csound"




If you reply to this email, your message will be added to the discussion below:
http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724828.html
To unsubscribe from Voice stealing mechanism turnoff2 question, click here.
NAML



View this message in context: Re: Voice stealing mechanism turnoff2 question
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-26 03:57
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question

Hi Iain, 


I tried this , and I seem to get a similar result to when I use 

turnoff2 kinstr, 1, 1 
; definition for the last number : krelease -- if non-zero, the turned off instances are allowed to release, otherwise are deactivated immediately (possibly resulting in clicks)

in my original voice-stealing instrument. 
It's dependent on the original adsr envelope of the note instance. I was wondering if there was a way to override the adsr envelope at performance time, allowing the instrument to release quickly instead of adhering to the original specified envelope. 

Here's how I tried to use it : 

gkactive init 0 ; number of active instances of note
giMaxPolyphony = 2 ; polyphony limit

instr 1

iwhammy chnget "whammy"
iattack chnget "attack"
idecay chnget "decay"
isustain chnget "sustain"
irelease chnget "release"
iattack1 chnget "attack1"
idecay1 chnget "decay1"
isustain1 chnget "sustain1"
irelease1 chnget "release1"
iattack2 chnget "attack2"
idecay2 chnget "decay2"
isustain2 chnget "sustain2"
irelease2 chnget "release2"
ilfoamp chnget "lfoAmp"
ilfofreq chnget "lfoFreq"
imix chnget "mix"
icarrier chnget "carrier"
imodulator1 chnget "modulator1"

; new params
imodulator2 chnget "modulator2"
icarrier2 chnget "carrier2"
imodamt chnget "modAmt"
imodamt2 chnget "modAmt2"

; polyphony control...
gkactive init i(gkactive) + 1 ;increment note counter
if gkactive>giMaxPolyphony then ;if polyphony is exceeded (through the
turnoff
endif
krel release ;if note held = 0, if note released = 1
ktrig trigger krel,0.5,0 ;when release flag crosses 0.5 upwards, i.e. note has been released...
if ktrig==1 then ;
gkactive = gkactive - 1 ;...decrement active notes counter
endif



midinoteonkey p4, p5

kvel = p5/127.0
kpch cpsmid p4
kpb init 0

if (iwhammy==1) then
midipitchbend kpb ; whammy
else
midipitchbend kpb, 0, 21.167 ;2 semi-tones
endif

kpch = octcps(kpch)
kcps = cpsoct(kpch + kpb)
amain linsegr 0, iattack, 1.0, idecay, isustain, irelease, 0
a1 linsegr 0, iattack1, imodamt, idecay1, isustain1, irelease1, 0
a2 linsegr 0, iattack2, imodamt2, idecay2, isustain2, irelease2, 0

klfo lfo ilfoamp, ilfofreq, 2
klfo = klfo + 0.5

 band-limited oscillator
avco vco2 kvel, kcps, 2, klfo
ga1 = ga1 + avco*kvel*amain

endin

Thanks. 

Pier.



On 25 Jun, 2013, at 8:17 PM, Iain McCurdy [via Csound] <[hidden email]> wrote:

Adding an 'r' envelope to the instrument that will be turned off in you example will break the mechanism and all instruments will turn off. I prefer to use turnoff in the instrument itself. Here is what I use to turn off the oldest note (with soft release) when a polyphony limit is exceeded:
---
gkactive init 0     ; number of active instances of note
giMaxPolyphony  = 2 ; polyphony limit

instr 1
; polyphony control...
gkactive init i(gkactive) + 1   ;increment note counter
if gkactive>giMaxPolyphony then ;if polyphony is exceeded (through the addition of new note)
 turnoff                        ;remove this note
endif
krel release                    ;if note held = 0, if note released = 1
ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e. note has been released... 
if ktrig==1 then                ;
 gkactive = gkactive - 1        ;...decrement active notes counter
endif

; make a sound...
icps  cpsmidi
iamp  ampmidi 1
aenv  linsegr 0,0.05,1, 0.2, 0
asig  vco2    0.1, icps, 4,0.5
      out     asig*aenv
endin
---


> Date: Tue, 25 Jun 2013 04:51:35 -0700

> From: <a href="x-msg://44/user/SendEmail.jtp?type=node&amp;node=5724830&amp;i=0" target="_top" rel="nofollow" link="external">[hidden email]
> To: <a href="x-msg://44/user/SendEmail.jtp?type=node&amp;node=5724830&amp;i=1" target="_top" rel="nofollow" link="external">[hidden email]
> Subject: [Csnd] Voice stealing mechanism turnoff2 question
>
> Hi, I currently have a really simple instrument here that does voice
> stealing, turning off instrument 1 instances when the number of voices is
> more than 16. The reason I did this is to reduce the CPU load.
>
> When I use it, and I use it with less "noisy" sounds, I can hear a soft
> click sound when the instruments are being turned off.
>
> I'm aware that turnoff2 has a flag that allows the instrument to follow its
> own release envelope before being turned off. But in many cases this is not
> fast enough and the CPU overloads quickly causing stuttering.
>
> Is there any way to damp the turning off by turnoff2 such that it follows a
> quick release envelope that won't cause any clicks? I'm suspecting this is
> the way hardware synths do it.
>
> instr 3
> kinstr init 1
> kactive active kinstr
> if kactive > 16 then
> turnoff2 kinstr, 1, 0
> endif
> endin
>
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> 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 <a href="x-msg://44/user/SendEmail.jtp?type=node&amp;node=5724830&amp;i=2" target="_top" rel="nofollow" link="external">[hidden email] with body "unsubscribe csound"
>


If you reply to this email, your message will be added to the discussion below:
http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724830.html
To unsubscribe from Voice stealing mechanism turnoff2 question, click here.
NAML



View this message in context: Re: Voice stealing mechanism turnoff2 question
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-26 03:59
FromPier
SubjectRe: [Csnd] Voice stealing mechanism turnoff2 question
Hi Victor, 

I may have to give this a try. So far I have been using 

amain linsegr 0, iattack, 1.0, idecay, isustain, irelease, 0

I'm rather dependant on the "r" functionality for my implementation - this user opcode doesn't have that, right? 

Thanks. 

Pier.



On 25 Jun, 2013, at 8:12 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

First make sure you use envelope generators with extra-time extension (linenr, etc).
However, the final release time is set at the start of the note.
The problem is that release time is set at init-time in most env generators, 
so it cannot be changed when you are performing a given note. 

You could try modifying this other envelope generator:


which can have a k-rate value for its parameters (they are i-time but that can
be just changed to k-time I think, without any other modification).
(btw, I noticed the description is wrong, saying that low is (2), when it's 0.)

Then you can change the decay if you need to shorten it. 

Victor
On 25 Jun 2013, at 12:51, lppier wrote:

Hi, I currently have a really simple instrument here that does voice
stealing, turning off instrument 1 instances when the number of voices is
more than 16. The reason I did this is to reduce the CPU load.

When I use it, and I use it with less "noisy" sounds, I can hear a soft
click sound when the instruments are being turned off.

I'm aware that turnoff2 has a flag that allows the instrument to follow its
own release envelope before being turned off. But in many cases this is not
fast enough and the CPU overloads quickly causing stuttering.

Is there any way to damp the turning off by turnoff2 such that it follows a
quick release envelope that won't cause any clicks? I'm suspecting this is
the way hardware synths do it.

instr 3
kinstr init 1
kactive active kinstr
if kactive > 16 then
turnoff2 kinstr, 1, 0
endif
endin




--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2013-06-26 04:19
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question
Hmmm, putting my irelease to a very low value such as 0.017 and enabling the
release parameter in 
My iattack, isustain and idecay are all really low as well. 

turnoff2 kinstr, 1, *1*

doesn't work that well actually. The cpu still overloads quickly. Are the
instrument instances really turned off at the end of their release? 

When I do this : 
turnoff2 kinstr, 1, 0 ; turn off straight away
it does the job, keeping my CPU below 90% when I hit multiple notes. 



--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724878.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-26 08:10
FromVictor Lazzarini
SubjectRe: [Csnd] Voice stealing mechanism turnoff2 question
you can implement it, with release & xtratim opcodes.

Victor
On 26 Jun 2013, at 03:59, Pier wrote:

Hi Victor, 

I may have to give this a try. So far I have been using 

amain linsegr 0, iattack, 1.0, idecay, isustain, irelease, 0

I'm rather dependant on the "r" functionality for my implementation - this user opcode doesn't have that, right? 

Thanks. 

Pier.



On 25 Jun, 2013, at 8:12 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

First make sure you use envelope generators with extra-time extension (linenr, etc).
However, the final release time is set at the start of the note.
The problem is that release time is set at init-time in most env generators, 
so it cannot be changed when you are performing a given note. 

You could try modifying this other envelope generator:


which can have a k-rate value for its parameters (they are i-time but that can
be just changed to k-time I think, without any other modification).
(btw, I noticed the description is wrong, saying that low is (2), when it's 0.)

Then you can change the decay if you need to shorten it. 

Victor
On 25 Jun 2013, at 12:51, lppier wrote:

Hi, I currently have a really simple instrument here that does voice
stealing, turning off instrument 1 instances when the number of voices is
more than 16. The reason I did this is to reduce the CPU load.

When I use it, and I use it with less "noisy" sounds, I can hear a soft
click sound when the instruments are being turned off.

I'm aware that turnoff2 has a flag that allows the instrument to follow its
own release envelope before being turned off. But in many cases this is not
fast enough and the CPU overloads quickly causing stuttering.

Is there any way to damp the turning off by turnoff2 such that it follows a
quick release envelope that won't cause any clicks? I'm suspecting this is
the way hardware synths do it.

instr 3
kinstr init 1
kactive active kinstr
if kactive > 16 then
turnoff2 kinstr, 1, 0
endif
endin




--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824.html
Sent from the Csound - General mailing list archive at Nabble.com.


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"


Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie




Date2013-06-26 10:10
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question
Ah, I realised that turnoff2 takes into account the release of all envelope
generators in the instrument. 
I have 3 - 

amain linsegr 0, iattack, 1.0, idecay, isustain, irelease, 0
a1 linsegr 0, iattack1, imodamt, idecay1, isustain1, irelease1, 0
a2 linsegr 0, iattack2, imodamt2, idecay2, isustain2, irelease2, 0

It was only when I set the release value of all 3 to very low then could I
see the turnoff2 working with the flag set to wait for release time of
envelope. So turnoff2 actually checks for the latest release time, which is
not really ideal in my case because I only want to check that the amain
signal is released. 

But this doesn't really solve my original issue for which I wanted the
signal to be damped with a custom low release time instead of cut off
immediately. 

Will try modifying the UDO as per Victor's suggestion. 




--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724886.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-27 04:34
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question
Hi Victor, 

This is my attempt on making an UDO envelope that has a k-rate release
value. 
The idea is to use this envelope, and using Iain's method of checking the
number of active polyphony voices, feed a low k-rate release value to the
envelope. 
I would then turn off the instrument instance when the envelope reach 0,
silence. (not yet done)

Couple questions : 
1) I realised that the total time taken by the envelope is not equal to
iatt+idec+isus+krelval . It is more. 
2) Due to (1) putting xtratim i(krelval) doesn't work properly, the note is
cut off in the middle when I lift my finger from the midi keyboard. I have
to put it to a long value of 5 seconds for it to work. 

Not quite sure how to address this issue.... any tips?  adsdtest.csd
  



-o dac -+rtmidi=null -+rtaudio=null -d -+msg_color=0 -M0 -m0


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

massign 0, 1

opcode ADSD,k,iiiik
 imax,iatt,idec,isus,krelval    xin 

 ktime init 0
 kv init 0
 iper = 1/kr

 krel release
 ;xtratim i(krelval)
 xtratim 5
 

 ktime = ktime + iper

if (krel==0) then
  if ktime < iatt then
    kt  = iatt 
     kv = imax
  elseif (ktime < (iatt+idec+isus)) then
     kt = idec
     kv = isus
  elseif (ktime < (iatt+idec+isus+krelval)) then
     kt = krelval ; rel time
     kv = 0 
  endif
else ;krel==1
  kt = krelval
  kv = 0 
  ;ktime = 0
endif

 kenv  portk  kv, kt
 
 printk2 kenv
            xout  kenv

endop

instr 1

k1 ADSD 1,1,0.05,0.7,0.5
;k1 ADSD 1,1,0.05,0.7,0.1 ; enable this to emulate change in release value
a1 vco2 k1, 440

   out a1
endin



i1 0 360000






--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724911.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-27 09:21
Fromlppier
Subject[Csnd] Re: Voice stealing mechanism turnoff2 question
Think I'm close yet so far.. 
I implemented the ADSR envelope in my code, but the new krelease value is
only given to the newest note, not the oldest note that I desire. Help
anyone? 

opcode ADSR,a,iiiik
 imax,iatt,idec,isus,krelval    xin 

 ktime init 0
 kv init 0
 iper = 1/kr

 krel release
 ;xtratim i(krelval)
 xtratim 5
 ktime = ktime + iper
if (krel==0) then
  if ktime < iatt then
    kt  = iatt 
     kv = imax
  elseif (ktime < (iatt+idec+isus)) then
     kt = idec
     kv = isus
  elseif (ktime < (iatt+idec+isus+krelval)) then
     kt = krelval ; rel time
     kv = 0 
  endif
else ;krel==1
  kt = krelval
  kv = 0 
  ;ktime = 0
endif

 kenv  portk  kv, kt
 aenv upsamp kenv
 printk 0.5,krelval
            xout  aenv

endop


instr 1

iattack 		= 0.01
idecay 	    = 0.05
isustain 		= 0.1 
krelease 		= 1

midinoteonkey p4, p5

kvel = p5/127.0
kpch cpsmid p4
kpb init 0

if (iwhammy==1) then
    midipitchbend kpb ; whammy
else
    midipitchbend kpb, 0, 21.167 ;2 semi-tones
endif

kpch = octcps(kpch)
kcps = cpsoct(kpch + kpb)

gkactive init i(gkactive) + 1   ;increment note counter
kMaxPolyFlag init 0


if (kMaxPolyFlag==1) then
  krelease = 0.001
endif

if (gkactive>giMaxPolyphony) then 
  amain ADSR 1, iattack, idecay, isustain, 0.001
  kMaxPolyFlag = 1
else
  amain ADSR 1, iattack, idecay, isustain, krelease
endif

krel release                    ;if note held = 0, if note released = 1
ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e.
note has been released...  
if ktrig==1 then                ;
 gkactive = gkactive - 1        ;...decrement active notes counter
 ;turnoff
endif

avco vco2 0.3, kcps, 0
outs avco*amain, avco*amain



--
View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724912.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-06-27 10:04
FromVictor Lazzarini
SubjectRe: [Csnd] Re: Voice stealing mechanism turnoff2 question
One thing you can try is to pass the desired release time to the instrument at the time it is
being turned off via a channel. You could have N channels, where N is your max polyphony,
and then you can select which one to send depending on which slot you are switching off.

Another way is to hold the release values on a table, so you can read off the release time
using the table opcode and write using the tablew opcode. If you have say 8 voices,
you can have a table of size 8, and use that to pass the release time.

Victor

On 27 Jun 2013, at 09:21, lppier wrote:

> Think I'm close yet so far.. 
> I implemented the ADSR envelope in my code, but the new krelease value is
> only given to the newest note, not the oldest note that I desire. Help
> anyone? 
> 
> opcode ADSR,a,iiiik
> imax,iatt,idec,isus,krelval    xin 
> 
> ktime init 0
> kv init 0
> iper = 1/kr
> 
> krel release
> ;xtratim i(krelval)
> xtratim 5
> ktime = ktime + iper
> if (krel==0) then
>  if ktime < iatt then
>    kt  = iatt 
>     kv = imax
>  elseif (ktime < (iatt+idec+isus)) then
>     kt = idec
>     kv = isus
>  elseif (ktime < (iatt+idec+isus+krelval)) then
>     kt = krelval ; rel time
>     kv = 0 
>  endif
> else ;krel==1
>  kt = krelval
>  kv = 0 
>  ;ktime = 0
> endif
> 
> kenv  portk  kv, kt
> aenv upsamp kenv
> printk 0.5,krelval
>            xout  aenv
> 
> endop
> 
> 
> instr 1
> 
> iattack 		= 0.01
> idecay 	    = 0.05
> isustain 		= 0.1 
> krelease 		= 1
> 
> midinoteonkey p4, p5
> 
> kvel = p5/127.0
> kpch cpsmid p4
> kpb init 0
> 
> if (iwhammy==1) then
>    midipitchbend kpb ; whammy
> else
>    midipitchbend kpb, 0, 21.167 ;2 semi-tones
> endif
> 
> kpch = octcps(kpch)
> kcps = cpsoct(kpch + kpb)
> 
> gkactive init i(gkactive) + 1   ;increment note counter
> kMaxPolyFlag init 0
> 
> 
> if (kMaxPolyFlag==1) then
>  krelease = 0.001
> endif
> 
> if (gkactive>giMaxPolyphony) then 
>  amain ADSR 1, iattack, idecay, isustain, 0.001
>  kMaxPolyFlag = 1
> else
>  amain ADSR 1, iattack, idecay, isustain, krelease
> endif
> 
> krel release                    ;if note held = 0, if note released = 1
> ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e.
> note has been released...  
> if ktrig==1 then                ;
> gkactive = gkactive - 1        ;...decrement active notes counter
> ;turnoff
> endif
> 
> avco vco2 0.3, kcps, 0
> outs avco*amain, avco*amain
> 
> 
> 
> --
> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724912.html
> Sent from the Csound - General mailing list archive at Nabble.com.
> 
> 
> 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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2013-06-27 10:39
FromPier
SubjectRe: [Csnd] Re: Voice stealing mechanism turnoff2 question
Thanks Victor, I'm not familiar with channels so I'll try the table method. It sounds like it could work. 

On a side note, is there anyway to modify turnoff2 to allow for a new option that gives damping on the channel being turned off? 

Pier.



On 27 Jun, 2013, at 5:04 PM, Victor Lazzarini  wrote:

> One thing you can try is to pass the desired release time to the instrument at the time it is
> being turned off via a channel. You could have N channels, where N is your max polyphony,
> and then you can select which one to send depending on which slot you are switching off.
> 
> Another way is to hold the release values on a table, so you can read off the release time
> using the table opcode and write using the tablew opcode. If you have say 8 voices,
> you can have a table of size 8, and use that to pass the release time.
> 
> Victor
> 
> On 27 Jun 2013, at 09:21, lppier wrote:
> 
>> Think I'm close yet so far.. 
>> I implemented the ADSR envelope in my code, but the new krelease value is
>> only given to the newest note, not the oldest note that I desire. Help
>> anyone? 
>> 
>> opcode ADSR,a,iiiik
>> imax,iatt,idec,isus,krelval    xin 
>> 
>> ktime init 0
>> kv init 0
>> iper = 1/kr
>> 
>> krel release
>> ;xtratim i(krelval)
>> xtratim 5
>> ktime = ktime + iper
>> if (krel==0) then
>> if ktime < iatt then
>>   kt  = iatt 
>>    kv = imax
>> elseif (ktime < (iatt+idec+isus)) then
>>    kt = idec
>>    kv = isus
>> elseif (ktime < (iatt+idec+isus+krelval)) then
>>    kt = krelval ; rel time
>>    kv = 0 
>> endif
>> else ;krel==1
>> kt = krelval
>> kv = 0 
>> ;ktime = 0
>> endif
>> 
>> kenv  portk  kv, kt
>> aenv upsamp kenv
>> printk 0.5,krelval
>>           xout  aenv
>> 
>> endop
>> 
>> 
>> instr 1
>> 
>> iattack 		= 0.01
>> idecay 	    = 0.05
>> isustain 		= 0.1 
>> krelease 		= 1
>> 
>> midinoteonkey p4, p5
>> 
>> kvel = p5/127.0
>> kpch cpsmid p4
>> kpb init 0
>> 
>> if (iwhammy==1) then
>>   midipitchbend kpb ; whammy
>> else
>>   midipitchbend kpb, 0, 21.167 ;2 semi-tones
>> endif
>> 
>> kpch = octcps(kpch)
>> kcps = cpsoct(kpch + kpb)
>> 
>> gkactive init i(gkactive) + 1   ;increment note counter
>> kMaxPolyFlag init 0
>> 
>> 
>> if (kMaxPolyFlag==1) then
>> krelease = 0.001
>> endif
>> 
>> if (gkactive>giMaxPolyphony) then 
>> amain ADSR 1, iattack, idecay, isustain, 0.001
>> kMaxPolyFlag = 1
>> else
>> amain ADSR 1, iattack, idecay, isustain, krelease
>> endif
>> 
>> krel release                    ;if note held = 0, if note released = 1
>> ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e.
>> note has been released...  
>> if ktrig==1 then                ;
>> gkactive = gkactive - 1        ;...decrement active notes counter
>> ;turnoff
>> endif
>> 
>> avco vco2 0.3, kcps, 0
>> outs avco*amain, avco*amain
>> 
>> 
>> 
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724912.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>> 
>> 
>> 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"
>> 
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> 
> 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"
> 



Date2013-06-28 10:26
FromJacques Leplat
Subject[Csnd] Csound6.apk rc04 & CSound6 android git build error
Hello,

This morning I downloaded the rc04 Csound6.apk from source forge (available in http://sourceforge.net/projects/csound/files/csound6/Csound6.0rc4/). It fails on startup.

Device: Motorola MZ604
Android Version: 4.0.4

The log is below:

06-28 09:54:52.730: I/ActivityManager(164): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity} from pid 417
06-28 09:54:52.810: D/dalvikvm(7014): Late-enabling CheckJNI
06-28 09:54:52.820: I/ActivityManager(164): Start proc com.csounds.Csound6 for activity com.csounds.Csound6/.CsoundAppActivity: pid=7014 uid=10172 gids={1015, 1007}
06-28 09:54:52.830: I/dalvikvm(7014): Turning on JNI app bug workarounds for target SDK version 10...
06-28 09:54:52.840: D/dalvikvm(7014): Debugger has detached; object registry had 1 entries
06-28 09:54:52.840: D/OpenGLRenderer(417): Flushing caches (mode 1)
06-28 09:54:52.860: D/OpenGLRenderer(417): Flushing caches (mode 0)
06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
06-28 09:54:52.880: D/dalvikvm(7014): Added shared lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
06-28 09:54:52.880: D/dalvikvm(7014): No JNI_OnLoad found in /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920, skipping init
06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libcsoundandroid.so 0x4109b920
06-28 09:54:52.880: W/System.err(7014): csoundandroid native code library failed to load.
06-28 09:54:52.880: W/System.err(7014): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]:    90 could not load needed library 'libgnustl_shared.so' for 'libcsoundandroid.so' (load_library[1091]: Library 'libgnustl_shared.so' not found)
06-28 09:54:52.900: I/ActivityManager(164): Process com.csounds.Csound6 (pid 7014) has died.
06-28 09:54:52.900: D/Zygote(90): Process 7014 exited cleanly (1)
06-28 09:54:52.900: W/ActivityManager(164): Force removing ActivityRecord{410919b8 com.csounds.Csound6/.CsoundAppActivity}: app died, no saved state

All the best,

Jacques




Date2013-06-28 10:34
FromVictor Lazzarini
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
Why I don't understand is the libcsound dependency on libgnustl ? Surely Csound does not require STL?
Can't this be changed?

On 28 Jun 2013, at 10:26, Jacques Leplat wrote:

> Hello,
> 
> This morning I downloaded the rc04 Csound6.apk from source forge (available in http://sourceforge.net/projects/csound/files/csound6/Csound6.0rc4/). It fails on startup.
> 
> Device: Motorola MZ604
> Android Version: 4.0.4
> 
> The log is below:
> 
> 06-28 09:54:52.730: I/ActivityManager(164): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity} from pid 417
> 06-28 09:54:52.810: D/dalvikvm(7014): Late-enabling CheckJNI
> 06-28 09:54:52.820: I/ActivityManager(164): Start proc com.csounds.Csound6 for activity com.csounds.Csound6/.CsoundAppActivity: pid=7014 uid=10172 gids={1015, 1007}
> 06-28 09:54:52.830: I/dalvikvm(7014): Turning on JNI app bug workarounds for target SDK version 10...
> 06-28 09:54:52.840: D/dalvikvm(7014): Debugger has detached; object registry had 1 entries
> 06-28 09:54:52.840: D/OpenGLRenderer(417): Flushing caches (mode 1)
> 06-28 09:54:52.860: D/OpenGLRenderer(417): Flushing caches (mode 0)
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): Added shared lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): No JNI_OnLoad found in /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920, skipping init
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libcsoundandroid.so 0x4109b920
> 06-28 09:54:52.880: W/System.err(7014): csoundandroid native code library failed to load.
> 06-28 09:54:52.880: W/System.err(7014): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]:    90 could not load needed library 'libgnustl_shared.so' for 'libcsoundandroid.so' (load_library[1091]: Library 'libgnustl_shared.so' not found)
> 06-28 09:54:52.900: I/ActivityManager(164): Process com.csounds.Csound6 (pid 7014) has died.
> 06-28 09:54:52.900: D/Zygote(90): Process 7014 exited cleanly (1)
> 06-28 09:54:52.900: W/ActivityManager(164): Force removing ActivityRecord{410919b8 com.csounds.Csound6/.CsoundAppActivity}: app died, no saved state
> 
> All the best,
> 
> Jacques
> 
> 
> 
> 
> 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"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2013-06-28 11:31
FromMichael Gogins
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
The cause of the dependency on libgnustl_shared.so is twofold. First, any code that uses the standard C++ library will need this. That includes some of the code in plugin opcodes, notably the Lua opcodes and the signal flow graph opcodes. Second, there are static elements in C++ code that require that, if a process loads more than one C++ module, all the C++ modules need to be in shared libraries, otherwise data may be corrupted or the app may even crash.

My whole motive for working on Android Csound is to be able to compose on my phone, and to do that I need the Lua opcodes and the signal flow graph opcodes. I've noticed a number of other composers also use the signal flow graph opcodes, so I think there are good reasons for trying to get this to work. 

So I don't consider dropping these opcodes to be an option.

We do have options however:

First, we can just get this to work. This is my preference. However, I've done a fair amount of research and as far as I can tell I am doing everything correctly now.

Second, we can statically link the app and all the "plugins" into one app, except for LuaJIT, which has no dependency on any C++ code. This will involve putting a little bit of code in the Android Csound C code to get these opcodes into the opcode dispatch table using the Csound API. I will do this if we can't get the gnustl thing resolved quickly.

Third, of course we can produce two versions of the app, one with the C++ plugins and one without. I noticed in the logs provided that libsndfile loaded without any problems so I expect any other plain C plugins also will load without any problems.

What do you think?

I'd appreciate more reports. Has anybody actually been able to run this thing besides me?

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Jun 28, 2013 at 5:34 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Why I don't understand is the libcsound dependency on libgnustl ? Surely Csound does not require STL?
Can't this be changed?

On 28 Jun 2013, at 10:26, Jacques Leplat wrote:

> Hello,
>
> This morning I downloaded the rc04 Csound6.apk from source forge (available in http://sourceforge.net/projects/csound/files/csound6/Csound6.0rc4/). It fails on startup.
>
> Device: Motorola MZ604
> Android Version: 4.0.4
>
> The log is below:
>
> 06-28 09:54:52.730: I/ActivityManager(164): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity} from pid 417
> 06-28 09:54:52.810: D/dalvikvm(7014): Late-enabling CheckJNI
> 06-28 09:54:52.820: I/ActivityManager(164): Start proc com.csounds.Csound6 for activity com.csounds.Csound6/.CsoundAppActivity: pid=7014 uid=10172 gids={1015, 1007}
> 06-28 09:54:52.830: I/dalvikvm(7014): Turning on JNI app bug workarounds for target SDK version 10...
> 06-28 09:54:52.840: D/dalvikvm(7014): Debugger has detached; object registry had 1 entries
> 06-28 09:54:52.840: D/OpenGLRenderer(417): Flushing caches (mode 1)
> 06-28 09:54:52.860: D/OpenGLRenderer(417): Flushing caches (mode 0)
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): Added shared lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): No JNI_OnLoad found in /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920, skipping init
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libcsoundandroid.so 0x4109b920
> 06-28 09:54:52.880: W/System.err(7014): csoundandroid native code library failed to load.
> 06-28 09:54:52.880: W/System.err(7014): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]:    90 could not load needed library 'libgnustl_shared.so' for 'libcsoundandroid.so' (load_library[1091]: Library 'libgnustl_shared.so' not found)
> 06-28 09:54:52.900: I/ActivityManager(164): Process com.csounds.Csound6 (pid 7014) has died.
> 06-28 09:54:52.900: D/Zygote(90): Process 7014 exited cleanly (1)
> 06-28 09:54:52.900: W/ActivityManager(164): Force removing ActivityRecord{410919b8 com.csounds.Csound6/.CsoundAppActivity}: app died, no saved state
>
> All the best,
>
> Jacques
>
>
>
>
> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"



Date2013-06-28 11:32
FromMichael Gogins
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
P.S., I will provide an app without the C++ plugins right away as this is by far the easiest thing to do.

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Jun 28, 2013 at 6:31 AM, Michael Gogins <michael.gogins@gmail.com> wrote:
The cause of the dependency on libgnustl_shared.so is twofold. First, any code that uses the standard C++ library will need this. That includes some of the code in plugin opcodes, notably the Lua opcodes and the signal flow graph opcodes. Second, there are static elements in C++ code that require that, if a process loads more than one C++ module, all the C++ modules need to be in shared libraries, otherwise data may be corrupted or the app may even crash.

My whole motive for working on Android Csound is to be able to compose on my phone, and to do that I need the Lua opcodes and the signal flow graph opcodes. I've noticed a number of other composers also use the signal flow graph opcodes, so I think there are good reasons for trying to get this to work. 

So I don't consider dropping these opcodes to be an option.

We do have options however:

First, we can just get this to work. This is my preference. However, I've done a fair amount of research and as far as I can tell I am doing everything correctly now.

Second, we can statically link the app and all the "plugins" into one app, except for LuaJIT, which has no dependency on any C++ code. This will involve putting a little bit of code in the Android Csound C code to get these opcodes into the opcode dispatch table using the Csound API. I will do this if we can't get the gnustl thing resolved quickly.

Third, of course we can produce two versions of the app, one with the C++ plugins and one without. I noticed in the logs provided that libsndfile loaded without any problems so I expect any other plain C plugins also will load without any problems.

What do you think?

I'd appreciate more reports. Has anybody actually been able to run this thing besides me?

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Jun 28, 2013 at 5:34 AM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Why I don't understand is the libcsound dependency on libgnustl ? Surely Csound does not require STL?
Can't this be changed?

On 28 Jun 2013, at 10:26, Jacques Leplat wrote:

> Hello,
>
> This morning I downloaded the rc04 Csound6.apk from source forge (available in http://sourceforge.net/projects/csound/files/csound6/Csound6.0rc4/). It fails on startup.
>
> Device: Motorola MZ604
> Android Version: 4.0.4
>
> The log is below:
>
> 06-28 09:54:52.730: I/ActivityManager(164): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.csounds.Csound6/.CsoundAppActivity} from pid 417
> 06-28 09:54:52.810: D/dalvikvm(7014): Late-enabling CheckJNI
> 06-28 09:54:52.820: I/ActivityManager(164): Start proc com.csounds.Csound6 for activity com.csounds.Csound6/.CsoundAppActivity: pid=7014 uid=10172 gids={1015, 1007}
> 06-28 09:54:52.830: I/dalvikvm(7014): Turning on JNI app bug workarounds for target SDK version 10...
> 06-28 09:54:52.840: D/dalvikvm(7014): Debugger has detached; object registry had 1 entries
> 06-28 09:54:52.840: D/OpenGLRenderer(417): Flushing caches (mode 1)
> 06-28 09:54:52.860: D/OpenGLRenderer(417): Flushing caches (mode 0)
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): Added shared lib /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920
> 06-28 09:54:52.880: D/dalvikvm(7014): No JNI_OnLoad found in /data/data/com.csounds.Csound6/lib/libsndfile.so 0x4109b920, skipping init
> 06-28 09:54:52.880: D/dalvikvm(7014): Trying to load lib /data/data/com.csounds.Csound6/lib/libcsoundandroid.so 0x4109b920
> 06-28 09:54:52.880: W/System.err(7014): csoundandroid native code library failed to load.
> 06-28 09:54:52.880: W/System.err(7014): java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1936]:    90 could not load needed library 'libgnustl_shared.so' for 'libcsoundandroid.so' (load_library[1091]: Library 'libgnustl_shared.so' not found)
> 06-28 09:54:52.900: I/ActivityManager(164): Process com.csounds.Csound6 (pid 7014) has died.
> 06-28 09:54:52.900: D/Zygote(90): Process 7014 exited cleanly (1)
> 06-28 09:54:52.900: W/ActivityManager(164): Force removing ActivityRecord{410919b8 com.csounds.Csound6/.CsoundAppActivity}: app died, no saved state
>
> All the best,
>
> Jacques
>
>
>
>
> 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"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





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"




Date2013-06-28 11:58
FromRory Walsh
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
> I'd appreciate more reports. Has anybody actually been able to run this
> thing besides me?

I've not been able to run the the latest packages on my phone now for
the past month or so. It just crashes on startup. I had no trouble
with Csound for Android in the past. We used it without a problem in
developing Csoundo for Android.

Date2013-06-28 12:15
FromJacques Leplat
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
I haven't managed to run the CSound6 apk, started trying late last week on several devices, and the android emulator.

The CSound version 5.xx of the csound apk (csd player) works fine. The last release(s) of CSound5.xx for android also had libsndfile bundled in, and worked fine. Not sure how that is linked in though.

I'm starting to get into building the android from git, but that takes some time: the build process has dependencies, which have dependencies…. I might get there in the end and be able to help.

All the best,

Jacques

On 28 Jun 2013, at 11:58, Rory Walsh  wrote:

>> I'd appreciate more reports. Has anybody actually been able to run this
>> thing besides me?
> 
> I've not been able to run the the latest packages on my phone now for
> the past month or so. It just crashes on startup. I had no trouble
> with Csound for Android in the past. We used it without a problem in
> developing Csoundo for Android.
> 
> 
> 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"
> 



Date2013-06-28 12:34
FromMichael Gogins
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
Thanks for the feedback. I'd appreciate knowing which devices...

I can't do this right now, but I will work on it this weekend. I'm going to create a branch that links everything statically, including the C++ opcodes. The only library that will be loaded dynamically will be LuaJIT. The current plugins will simply become static libraries and the AndroidCsound code in the new branch will be modified to load the opcodes into the opcode dispatch table.

Regards,
Mike


===========================
Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Fri, Jun 28, 2013 at 7:15 AM, Jacques Leplat <jleplat@j3ltd.com> wrote:
I haven't managed to run the CSound6 apk, started trying late last week on several devices, and the android emulator.

The CSound version 5.xx of the csound apk (csd player) works fine. The last release(s) of CSound5.xx for android also had libsndfile bundled in, and worked fine. Not sure how that is linked in though.

I'm starting to get into building the android from git, but that takes some time: the build process has dependencies, which have dependencies…. I might get there in the end and be able to help.

All the best,

Jacques

On 28 Jun 2013, at 11:58, Rory Walsh <rorywalsh@ear.ie> wrote:

>> I'd appreciate more reports. Has anybody actually been able to run this
>> thing besides me?
>
> I've not been able to run the the latest packages on my phone now for
> the past month or so. It just crashes on startup. I had no trouble
> with Csound for Android in the past. We used it without a problem in
> developing Csoundo for Android.
>
>
> 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"



Date2013-06-28 12:47
FromJacques Leplat
SubjectRe: [Csnd] Csound6.apk rc04 & CSound6 android git build error
On 28 Jun 2013, at 12:34, Michael Gogins  wrote:

> Thanks for the feedback. I'd appreciate knowing which devices…

Motorola MZ604 android 4.0.4
LG Nexus 4 android 4.2.2
Sony Experia U (ST25i) android 2.3.7

I also tried Eclipse ADT emulator with the CSD player android project.  In my experience, the emulator is a good test bed to see if an app runs on a plain device, which has no extras present.


> 
> I can't do this right now, but I will work on it this weekend. I'm going to create a branch that links everything statically, including the C++ opcodes. The only library that will be loaded dynamically will be LuaJIT. The current plugins will simply become static libraries and the AndroidCsound code in the new branch will be modified to load the opcodes into the opcode dispatch table.
> 
> Regards,
> Mike
> 

That sounds great to me. I don't expect linking statically would be too much of a bloat. It would also greatly simplify the software development process for Android devices. 

All the best,

Jacques

Date2013-06-28 14:28
FromJacques Leplat
Subject[Csnd] CSound6: BUILDING_FOR_ANDROID instructions, a big thanks
A big thank you to Michael Gogins for his document. I followed it, and managed to build CSound6 for android on a Mac.

This is the 1st time I have built any version of CSound, and the process was much easier than I anticipated.

Many thanks to Michael, his instructions are very good.

All the best,

Jacques

Date2013-07-01 14:45
FromAaron Krister Johnson
SubjectRe: [Csnd] Re: Voice stealing mechanism turnoff2 question
There have been many many threads throughout the years (including one I started) relating to people having to hack up their own solution for live MIDI and polyphony issues....maybe it's time to have a built-in solution that actually works in Csound itself? :D

-AKJ

On Thu, Jun 27, 2013 at 4:39 AM, Pier <madstrum@gmail.com> wrote:
Thanks Victor, I'm not familiar with channels so I'll try the table method. It sounds like it could work.

On a side note, is there anyway to modify turnoff2 to allow for a new option that gives damping on the channel being turned off?

Pier.



On 27 Jun, 2013, at 5:04 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

> One thing you can try is to pass the desired release time to the instrument at the time it is
> being turned off via a channel. You could have N channels, where N is your max polyphony,
> and then you can select which one to send depending on which slot you are switching off.
>
> Another way is to hold the release values on a table, so you can read off the release time
> using the table opcode and write using the tablew opcode. If you have say 8 voices,
> you can have a table of size 8, and use that to pass the release time.
>
> Victor
>
> On 27 Jun 2013, at 09:21, lppier wrote:
>
>> Think I'm close yet so far..
>> I implemented the ADSR envelope in my code, but the new krelease value is
>> only given to the newest note, not the oldest note that I desire. Help
>> anyone?
>>
>> opcode ADSR,a,iiiik
>> imax,iatt,idec,isus,krelval    xin
>>
>> ktime init 0
>> kv init 0
>> iper = 1/kr
>>
>> krel release
>> ;xtratim i(krelval)
>> xtratim 5
>> ktime = ktime + iper
>> if (krel==0) then
>> if ktime < iatt then
>>   kt  = iatt
>>    kv = imax
>> elseif (ktime < (iatt+idec+isus)) then
>>    kt = idec
>>    kv = isus
>> elseif (ktime < (iatt+idec+isus+krelval)) then
>>    kt = krelval ; rel time
>>    kv = 0
>> endif
>> else ;krel==1
>> kt = krelval
>> kv = 0
>> ;ktime = 0
>> endif
>>
>> kenv  portk  kv, kt
>> aenv upsamp kenv
>> printk 0.5,krelval
>>           xout  aenv
>>
>> endop
>>
>>
>> instr 1
>>
>> iattack              = 0.01
>> idecay           = 0.05
>> isustain             = 0.1
>> krelease             = 1
>>
>> midinoteonkey p4, p5
>>
>> kvel = p5/127.0
>> kpch cpsmid p4
>> kpb init 0
>>
>> if (iwhammy==1) then
>>   midipitchbend kpb ; whammy
>> else
>>   midipitchbend kpb, 0, 21.167 ;2 semi-tones
>> endif
>>
>> kpch = octcps(kpch)
>> kcps = cpsoct(kpch + kpb)
>>
>> gkactive init i(gkactive) + 1   ;increment note counter
>> kMaxPolyFlag init 0
>>
>>
>> if (kMaxPolyFlag==1) then
>> krelease = 0.001
>> endif
>>
>> if (gkactive>giMaxPolyphony) then
>> amain ADSR 1, iattack, idecay, isustain, 0.001
>> kMaxPolyFlag = 1
>> else
>> amain ADSR 1, iattack, idecay, isustain, krelease
>> endif
>>
>> krel release                    ;if note held = 0, if note released = 1
>> ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e.
>> note has been released...
>> if ktrig==1 then                ;
>> gkactive = gkactive - 1        ;...decrement active notes counter
>> ;turnoff
>> endif
>>
>> avco vco2 0.3, kcps, 0
>> outs avco*amain, avco*amain
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724912.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"
>>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
>
> 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"




--
Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org

Date2013-07-15 13:23
FromPier
SubjectRe: [Csnd] Voice stealing mechanism turnoff2 question
For one, if turnoff2 could be done with a quick ramp down that's enforced by turnoff2 instead of cutting out immediately causing the click that would be great. 

On 1 Jul, 2013, at 9:45 PM, Aaron Krister Johnson <aaron@akjmusic.com> wrote:

There have been many many threads throughout the years (including one I started) relating to people having to hack up their own solution for live MIDI and polyphony issues....maybe it's time to have a built-in solution that actually works in Csound itself? :D

-AKJ

On Thu, Jun 27, 2013 at 4:39 AM, Pier <madstrum@gmail.com> wrote:
Thanks Victor, I'm not familiar with channels so I'll try the table method. It sounds like it could work.

On a side note, is there anyway to modify turnoff2 to allow for a new option that gives damping on the channel being turned off?

Pier.



On 27 Jun, 2013, at 5:04 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:

> One thing you can try is to pass the desired release time to the instrument at the time it is
> being turned off via a channel. You could have N channels, where N is your max polyphony,
> and then you can select which one to send depending on which slot you are switching off.
>
> Another way is to hold the release values on a table, so you can read off the release time
> using the table opcode and write using the tablew opcode. If you have say 8 voices,
> you can have a table of size 8, and use that to pass the release time.
>
> Victor
>
> On 27 Jun 2013, at 09:21, lppier wrote:
>
>> Think I'm close yet so far..
>> I implemented the ADSR envelope in my code, but the new krelease value is
>> only given to the newest note, not the oldest note that I desire. Help
>> anyone?
>>
>> opcode ADSR,a,iiiik
>> imax,iatt,idec,isus,krelval    xin
>>
>> ktime init 0
>> kv init 0
>> iper = 1/kr
>>
>> krel release
>> ;xtratim i(krelval)
>> xtratim 5
>> ktime = ktime + iper
>> if (krel==0) then
>> if ktime < iatt then
>>   kt  = iatt
>>    kv = imax
>> elseif (ktime < (iatt+idec+isus)) then
>>    kt = idec
>>    kv = isus
>> elseif (ktime < (iatt+idec+isus+krelval)) then
>>    kt = krelval ; rel time
>>    kv = 0
>> endif
>> else ;krel==1
>> kt = krelval
>> kv = 0
>> ;ktime = 0
>> endif
>>
>> kenv  portk  kv, kt
>> aenv upsamp kenv
>> printk 0.5,krelval
>>           xout  aenv
>>
>> endop
>>
>>
>> instr 1
>>
>> iattack              = 0.01
>> idecay           = 0.05
>> isustain             = 0.1
>> krelease             = 1
>>
>> midinoteonkey p4, p5
>>
>> kvel = p5/127.0
>> kpch cpsmid p4
>> kpb init 0
>>
>> if (iwhammy==1) then
>>   midipitchbend kpb ; whammy
>> else
>>   midipitchbend kpb, 0, 21.167 ;2 semi-tones
>> endif
>>
>> kpch = octcps(kpch)
>> kcps = cpsoct(kpch + kpb)
>>
>> gkactive init i(gkactive) + 1   ;increment note counter
>> kMaxPolyFlag init 0
>>
>>
>> if (kMaxPolyFlag==1) then
>> krelease = 0.001
>> endif
>>
>> if (gkactive>giMaxPolyphony) then
>> amain ADSR 1, iattack, idecay, isustain, 0.001
>> kMaxPolyFlag = 1
>> else
>> amain ADSR 1, iattack, idecay, isustain, krelease
>> endif
>>
>> krel release                    ;if note held = 0, if note released = 1
>> ktrig trigger krel,0.5,0        ;when release flag crosses 0.5 upwards, i.e.
>> note has been released...
>> if ktrig==1 then                ;
>> gkactive = gkactive - 1        ;...decrement active notes counter
>> ;turnoff
>> endif
>>
>> avco vco2 0.3, kcps, 0
>> outs avco*amain, avco*amain
>>
>>
>>
>> --
>> View this message in context: http://csound.1045644.n5.nabble.com/Voice-stealing-mechanism-turnoff2-question-tp5724824p5724912.html
>> Sent from the Csound - General mailing list archive at Nabble.com.
>>
>>
>> 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"
>>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
>
> 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"




--
Aaron Krister Johnson
http://www.akjmusic.com
http://www.untwelve.org