"virtual kalimba" problem...help, anyone?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

"virtual kalimba" problem...help, anyone?

Aaron Krister Johnson
Hi all,

I'm stuck on how to pull something off in Csound.

I want to have a fractional instrument definition so that I can embed a pitch in use that would represent an individual 'tine' on a kalimba.

This way, Csound can detect that when a tine is playing ti goes on playing unless it is struck again (a reinit).

I've fleshed it out as two instruments: the sound producing 'virtual FM kalimba', and the 'helper instrument' which send event_i events to the sound-engine. I'm trying unsuccesfully to use 'turnoff2' to control envelope release, but I'm getting unexpected results---the engine only plays two notes. Of course, I'm telling it to only allow one note at a time, sensed by the 'active' opcode, but I'm wondering why the fractional instrument thing isn't working as designated in the active/turnoff2 combination....here's my current code, any help will be appreciated:

    instr 7
iamp    = p4*p4
ipch    = p5
;; panning was implemented as a modulus function of pitch
;; this is just a way for us to get fancy stereo automatically, based on pitch
;; as if we are really small standing on the kalimba and hearing the tines
;; coming from all around us.
ipanoffset = (log(ipch/64)/log(2)/20) - .1
if (ipanoffset > .1) then
ipanoffset = .1
elseif (ipanoffset < -.1) then
ipanoffset = -.1
endif
ipanr   = sqrt(p6 + ipanoffset)
ipanl   = sqrt(1- (p6+ ipanoffset))
imix    = p7
kmodenv oscil1  0, 4+rnd(1), .1, 51
kenv    expsegr  (.001), .01, (1), ((2200/ipch)*1.6), (.001), .7, (.001) ;;;added last two terms for 'helper inst' 97
aosc    foscil  kenv, ipch, 1, 5.873, kmodenv, 1
    zawm aosc*kenv*iamp*ipanl*imix, 1
    zawm aosc*kenv*iamp*ipanr*imix, 2
    endin

    instr 97 ;;; kalimba helper
iamp = p4
ipch = p5
ipan = p6
imix = p7
Sinsnum sprintf "7.%d", int(p5)
iinsnum strtod Sinsnum
iact active iinsnum
if iact > 1 then
   turnoff2 iinsnum, 12, 1
endif
event_i "i", iinsnum, 0, -1, iamp, ipch, ipan, imix
    endin

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

Reply | Threaded
Open this post in threaded view
|

Re: "virtual kalimba" problem...help, anyone?

Justin Smith
What are the p5 values you are using? you know that i2.1 is the same as i2.10 i2.100 etc, right?

Also, you don't need to use sprintf and strtod, you can just add the fraction to the instrument number (ie. iinsnum = 2 + p5/1000, which generates i2.001 i2.002 ... i2.010 (equal to i2.01) i2.012 etc. which takes 1000 instances to start wrapping, rather than 10).

Also, active does not pay any attention to subinstrument arguments, the following lines:
active 2.1
active 2.2
active 2

All will return the same result.

Aaron Krister Johnson wrote:

> Hi all,
>
> I'm stuck on how to pull something off in Csound.
>
> I want to have a fractional instrument definition so that I can embed a
> pitch in use that would represent an individual 'tine' on a kalimba.
>
> This way, Csound can detect that when a tine is playing ti goes on playing
> unless it is struck again (a reinit).
>
> I've fleshed it out as two instruments: the sound producing 'virtual FM
> kalimba', and the 'helper instrument' which send event_i events to the
> sound-engine. I'm trying unsuccesfully to use 'turnoff2' to control envelope
> release, but I'm getting unexpected results---the engine only plays two
> notes. Of course, I'm telling it to only allow one note at a time, sensed by
> the 'active' opcode, but I'm wondering why the fractional instrument thing
> isn't working as designated in the active/turnoff2 combination....here's my
> current code, any help will be appreciated:
>
>     instr 7
> iamp    = p4*p4
> ipch    = p5
> ;; panning was implemented as a modulus function of pitch
> ;; this is just a way for us to get fancy stereo automatically, based on
> pitch
> ;; as if we are really small standing on the kalimba and hearing the tines
> ;; coming from all around us.
> ipanoffset = (log(ipch/64)/log(2)/20) - .1
> if (ipanoffset > .1) then
> ipanoffset = .1
> elseif (ipanoffset < -.1) then
> ipanoffset = -.1
> endif
> ipanr   = sqrt(p6 + ipanoffset)
> ipanl   = sqrt(1- (p6+ ipanoffset))
> imix    = p7
> kmodenv oscil1  0, 4+rnd(1), .1, 51
> kenv    expsegr  (.001), .01, (1), ((2200/ipch)*1.6), (.001), .7, (.001)
> ;;;added last two terms for 'helper inst' 97
> aosc    foscil  kenv, ipch, 1, 5.873, kmodenv, 1
>     zawm aosc*kenv*iamp*ipanl*imix, 1
>     zawm aosc*kenv*iamp*ipanr*imix, 2
>     endin
>
>     instr 97 ;;; kalimba helper
> iamp = p4
> ipch = p5
> ipan = p6
> imix = p7
> Sinsnum sprintf "7.%d", int(p5)
> iinsnum strtod Sinsnum
> iact active iinsnum
> if iact > 1 then
>    turnoff2 iinsnum, 12, 1
> endif
> event_i "i", iinsnum, 0, -1, iamp, ipch, ipan, imix
>     endin
>



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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|

Re: "virtual kalimba" problem...help, anyone?

Justin Smith
In reply to this post by Aaron Krister Johnson
oh, the other thing is that only one i2.n can exist with a p3 of -1, if you make a new one it will replace the old

this csd should be helpful in figuring out these behaviors:

<CsoundSynthesizer>

<CsOptions>
-L stdin
-d
-B 8192
-b 4000
-o dac
-+rtaudio=jack
</CsOptions>

<CsInstruments>
sr = 48000
ksmps = 1000
nchnls = 2

       instr 1
iins    active 1
isubins active p1
     print iins, isubins, p1
       endin

</CsInstruments>

<CsScore>
f 1 999 2 10 1

e


</CsScore>

</CsoundSynthesizer>

here is a transcript from my using it (all the lines starting with i were typed in real time in the terminal):

(opening output snipped)
audio buffered in 4000 sample-frame blocks
writing 16000-byte blks of shorts to dac
SECTION 1:
i 1 0 -1
  rtevent:         T  4.750 TT  4.750 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 1.000  isubins = 1.000  p1 = 1.000
i 1.1 0 -1
  rtevent:         T 11.750 TT 11.750 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 2.000  isubins = 2.000  p1 = 1.100
i 1.1 0 -1
  rtevent:         T 35.750 TT 35.750 M:      0.0      0.0
instr 1:  iins = 2.000  isubins = 2.000  p1 = 1.100
i 1.1 0 -1
  rtevent:         T 42.167 TT 42.167 M:      0.0      0.0
instr 1:  iins = 2.000  isubins = 2.000  p1 = 1.100
i 1.2 0 -1
  rtevent:         T 51.333 TT 51.333 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 3.000  isubins = 3.000  p1 = 1.200
i 1.0000000001 0 -1
  rtevent:         T 63.583 TT 63.583 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 4.000  isubins = 4.000  p1 = 1.000
i 1.000000001 0 -1
  rtevent:         T 76.000 TT 76.000 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 5.000  isubins = 5.000  p1 = 1.000
i 1.00000001 0 -1
  rtevent:         T 92.750 TT 92.750 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 6.000  isubins = 6.000  p1 = 1.000
i 1.0000001 0 -1
  rtevent:         T101.500 TT101.500 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 7.000  isubins = 7.000  p1 = 1.000
i 1.000001 0 -1
  rtevent:         T111.833 TT111.833 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 8.000  isubins = 8.000  p1 = 1.000
i 1.00001 0 -1
  rtevent:         T120.333 TT120.333 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 9.000  isubins = 9.000  p1 = 1.000
i 1.0001 0 -1
  rtevent:         T128.667 TT128.667 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 10.000  isubins = 10.000  p1 = 1.000
i 1.001 0 -1
  rtevent:         T137.500 TT137.500 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 11.000  isubins = 11.000  p1 = 1.001
i 1.001 0 -1
  rtevent:         T144.917 TT144.917 M:      0.0      0.0
instr 1:  iins = 11.000  isubins = 11.000  p1 = 1.001
i 1.0001 0 -1
  rtevent:         T155.500 TT155.500 M:      0.0      0.0
instr 1:  iins = 11.000  isubins = 11.000  p1 = 1.000
i -1.1 0 0
  rtevent:         T748.833 TT748.833 M:      0.0      0.0
i -1.1 0 0
  rtevent:         T757.000 TT757.000 M:      0.0      0.0
could not find playing instr 1.100000
i 1.13 0 -1
  rtevent:         T764.167 TT764.167 M:      0.0      0.0
instr 1:  iins = 11.000  isubins = 11.000  p1 = 1.130
i 1.10 0 -1
  rtevent:         T771.667 TT771.667 M:      0.0      0.0
new alloc for instr 1:
instr 1:  iins = 12.000  isubins = 12.000  p1 = 1.100
i 1.1 0 -1
  rtevent:         T777.500 TT777.500 M:      0.0      0.0
instr 1:  iins = 12.000  isubins = 12.000  p1 = 1.100


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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|

Re: Re: "virtual kalimba" problem...help, anyone?

Aaron Krister Johnson
In reply to this post by Justin Smith
HI Justin,
 
On Mon, Dec 20, 2010 at 12:39 AM, Justin Glenn Smith <[hidden email]> wrote:
What are the p5 values you are using? you know that i2.1 is the same as i2.10 i2.100 etc, right?


Yeah, this doesn't seem to be the issue, b/c the pitches are unique....

 
Also, you don't need to use sprintf and strtod, you can just add the fraction to the instrument number (ie. iinsnum = 2 + p5/1000, which generates i2.001 i2.002 ... i2.010 (equal to i2.01) i2.012 etc. which takes 1000 instances to start wrapping, rather than 10).


Neat trick...I'll try this. Thanks!
 
Also, active does not pay any attention to subinstrument arguments, the following lines:
active 2.1
active 2.2
active 2

All will return the same result.


This is an annoying bug....there ought to be an option for measuring how many active voices of a fractional instrument there are....developers?

Best,
AKJ

 
Aaron Krister Johnson wrote:
> Hi all,
>
> I'm stuck on how to pull something off in Csound.
>
> I want to have a fractional instrument definition so that I can embed a
> pitch in use that would represent an individual 'tine' on a kalimba.
>
> This way, Csound can detect that when a tine is playing ti goes on playing
> unless it is struck again (a reinit).
>
> I've fleshed it out as two instruments: the sound producing 'virtual FM
> kalimba', and the 'helper instrument' which send event_i events to the
> sound-engine. I'm trying unsuccesfully to use 'turnoff2' to control envelope
> release, but I'm getting unexpected results---the engine only plays two
> notes. Of course, I'm telling it to only allow one note at a time, sensed by
> the 'active' opcode, but I'm wondering why the fractional instrument thing
> isn't working as designated in the active/turnoff2 combination....here's my
> current code, any help will be appreciated:
>
>     instr 7
> iamp    = p4*p4
> ipch    = p5
> ;; panning was implemented as a modulus function of pitch
> ;; this is just a way for us to get fancy stereo automatically, based on
> pitch
> ;; as if we are really small standing on the kalimba and hearing the tines
> ;; coming from all around us.
> ipanoffset = (log(ipch/64)/log(2)/20) - .1
> if (ipanoffset > .1) then
> ipanoffset = .1
> elseif (ipanoffset < -.1) then
> ipanoffset = -.1
> endif
> ipanr   = sqrt(p6 + ipanoffset)
> ipanl   = sqrt(1- (p6+ ipanoffset))
> imix    = p7
> kmodenv oscil1  0, 4+rnd(1), .1, 51
> kenv    expsegr  (.001), .01, (1), ((2200/ipch)*1.6), (.001), .7, (.001)
> ;;;added last two terms for 'helper inst' 97
> aosc    foscil  kenv, ipch, 1, 5.873, kmodenv, 1
>     zawm aosc*kenv*iamp*ipanl*imix, 1
>     zawm aosc*kenv*iamp*ipanr*imix, 2
>     endin
>
>     instr 97 ;;; kalimba helper
> iamp = p4
> ipch = p5
> ipan = p6
> imix = p7
> Sinsnum sprintf "7.%d", int(p5)
> iinsnum strtod Sinsnum
> iact active iinsnum
> if iact > 1 then
>    turnoff2 iinsnum, 12, 1
> endif
> event_i "i", iinsnum, 0, -1, iamp, ipch, ipan, imix
>     endin
>



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 [hidden email] with body "unsubscribe csound"




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

Reply | Threaded
Open this post in threaded view
|

Re: "virtual kalimba" problem...help, anyone?

Justin Smith
I think you can use the implicit tying behavior with held notes, tival, and tigoto to fix your current problem.

If your durations of subinstruments are always -1 (as it appears from your current code), you don't have to worry about subinstrument count, because the next one with the same subinstrument will always replace the previous. Rather than triggering a release in the previous instrument, this will trigger a tie in the newly initialized one (whether the next note has a negative p3 or not).

The tival opcode and the tigoto command can be used to detect whether a previous note is being tied onto by the current instance, and the release opcode can be used to detect if the note is currently being truncated via turnoff2 or a negative p1 value (allowing you to fade out your envelope etc).

You could use tival for example to skip reinitializing an oscillator or filter. You could also insert some other sonic change on a tie, based on the value from tival. For example a buzz as one would get from hitting an already vibrating tine with a thumbnail seems appropriate in your case (perhaps from a temporary increase in the index and clipping of the modulating waveform; the latter can only be done with two separate oscils in fm configuration instead of foscil).

As a semantic issue, pitch usually indicates a logarithmic notation (for example an index into a scale table, or a value to be converted by cpspch or cpsoct), while the terms frequency, cps, or hertz are used more often for raw cycles per second value. Since you are feeding ipch directly into the oscillator with no conversion, I cannot tell if you have a bug  or if you are just using unconventional naming.


Aaron Krister Johnson wrote:

> HI Justin,
>
> On Mon, Dec 20, 2010 at 12:39 AM, Justin Glenn Smith
> <[hidden email]>wrote:
>
>> What are the p5 values you are using? you know that i2.1 is the same as
>> i2.10 i2.100 etc, right?
>>
>>
> Yeah, this doesn't seem to be the issue, b/c the pitches are unique....
>
>
>
>> Also, you don't need to use sprintf and strtod, you can just add the
>> fraction to the instrument number (ie. iinsnum = 2 + p5/1000, which
>> generates i2.001 i2.002 ... i2.010 (equal to i2.01) i2.012 etc. which takes
>> 1000 instances to start wrapping, rather than 10).
>>
>>
> Neat trick...I'll try this. Thanks!
>
>
>> Also, active does not pay any attention to subinstrument arguments, the
>> following lines:
>> active 2.1
>> active 2.2
>> active 2
>>
>> All will return the same result.
>>
>>
> This is an annoying bug....there ought to be an option for measuring how
> many active voices of a fractional instrument there are....developers?
>
> Best,
> AKJ
>
>
>
>> Aaron Krister Johnson wrote:
>>> Hi all,
>>>
>>> I'm stuck on how to pull something off in Csound.
>>>
>>> I want to have a fractional instrument definition so that I can embed a
>>> pitch in use that would represent an individual 'tine' on a kalimba.
>>>
>>> This way, Csound can detect that when a tine is playing ti goes on
>> playing
>>> unless it is struck again (a reinit).
>>>
>>> I've fleshed it out as two instruments: the sound producing 'virtual FM
>>> kalimba', and the 'helper instrument' which send event_i events to the
>>> sound-engine. I'm trying unsuccesfully to use 'turnoff2' to control
>> envelope
>>> release, but I'm getting unexpected results---the engine only plays two
>>> notes. Of course, I'm telling it to only allow one note at a time, sensed
>> by
>>> the 'active' opcode, but I'm wondering why the fractional instrument
>> thing
>>> isn't working as designated in the active/turnoff2 combination....here's
>> my
>>> current code, any help will be appreciated:
>>>
>>>     instr 7
>>> iamp    = p4*p4
>>> ipch    = p5
>>> ;; panning was implemented as a modulus function of pitch
>>> ;; this is just a way for us to get fancy stereo automatically, based on
>>> pitch
>>> ;; as if we are really small standing on the kalimba and hearing the
>> tines
>>> ;; coming from all around us.
>>> ipanoffset = (log(ipch/64)/log(2)/20) - .1
>>> if (ipanoffset > .1) then
>>> ipanoffset = .1
>>> elseif (ipanoffset < -.1) then
>>> ipanoffset = -.1
>>> endif
>>> ipanr   = sqrt(p6 + ipanoffset)
>>> ipanl   = sqrt(1- (p6+ ipanoffset))
>>> imix    = p7
>>> kmodenv oscil1  0, 4+rnd(1), .1, 51
>>> kenv    expsegr  (.001), .01, (1), ((2200/ipch)*1.6), (.001), .7, (.001)
>>> ;;;added last two terms for 'helper inst' 97
>>> aosc    foscil  kenv, ipch, 1, 5.873, kmodenv, 1
>>>     zawm aosc*kenv*iamp*ipanl*imix, 1
>>>     zawm aosc*kenv*iamp*ipanr*imix, 2
>>>     endin
>>>
>>>     instr 97 ;;; kalimba helper
>>> iamp = p4
>>> ipch = p5
>>> ipan = p6
>>> imix = p7
>>> Sinsnum sprintf "7.%d", int(p5)
>>> iinsnum strtod Sinsnum
>>> iact active iinsnum
>>> if iact > 1 then
>>>    turnoff2 iinsnum, 12, 1
>>> endif
>>> event_i "i", iinsnum, 0, -1, iamp, ipch, ipan, imix
>>>     endin
>>>
>>
>>
>> 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|

Re: Re: "virtual kalimba" problem...help, anyone?

Aaron Krister Johnson
Hey Justin,


On Mon, Dec 20, 2010 at 12:58 PM, Justin Glenn Smith <[hidden email]> wrote:
I think you can use the implicit tying behavior with held notes, tival, and tigoto to fix your current problem.

Hey, sorry you're not getting what I want to do---I understand about Csound tying, etc.

But the kalimba is not a monophonic tying instrument _per-se_. I only want to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the *same* pitch, provided that pitch is actually still sounding.

Actually, this kind of thing would really work well with piano samples, too---saving CPU resources from hoggy polyphony by not calling new instruments when sustain pedal is on, but stopping and restriking an already sounding intsrument with envelopes...perhaps with brief noisy "hammer sounds" as well? This would be the equivalent of the very brief thumb noise stopping and replucking the tine on a kalimba.

Anyway, this kind of thing seems very very tricky to pull off in Csound without a lot of gum and glue engineering. ....

<snip>

You could use tival for example to skip reinitializing an oscillator or filter. You could also insert some other sonic change on a tie, based on the value from tival. For example a buzz as one would get from hitting an already vibrating tine with a thumbnail seems appropriate in your case (perhaps from a temporary increase in the index and clipping of the modulating waveform; the latter can only be done with two separate oscils in fm configuration instead of foscil).

This is what I was thinking, but I'm now more convinced than ever that I need to use samples fro realism--my FM model will just remain for figuring out the issues involved. Maybe I can make it sound more real by some means as you describe...

As a semantic issue, pitch usually indicates a logarithmic notation (for example an index into a scale table, or a value to be converted by cpspch or cpsoct), while the terms frequency, cps, or hertz are used more often for raw cycles per second value. Since you are feeding ipch directly into the oscillator with no conversion, I cannot tell if you have a bug  or if you are just using unconventional naming.


Actually, I'm using my own coded frontend which always converts directly to hz (microcsound takes Just intonation and EDOs and turns them directly into HZ, saving Csound from doing the overhead---besides which, Csound doesn't have a good enough resolution in it's pitch converters....

what this means is that perhaps there is a bug with converting p5 (pitch) to '7.%d' with printf in my original code.

No time right now to think about this, but we'll discuss later. Thanks for your feedback!

Best,
AKJ

 

Aaron Krister Johnson wrote:
> HI Justin,
>
> On Mon, Dec 20, 2010 at 12:39 AM, Justin Glenn Smith
> <[hidden email]>wrote:
>
>> What are the p5 values you are using? you know that i2.1 is the same as
>> i2.10 i2.100 etc, right?
>>
>>
> Yeah, this doesn't seem to be the issue, b/c the pitches are unique....
>
>
>
>> Also, you don't need to use sprintf and strtod, you can just add the
>> fraction to the instrument number (ie. iinsnum = 2 + p5/1000, which
>> generates i2.001 i2.002 ... i2.010 (equal to i2.01) i2.012 etc. which takes
>> 1000 instances to start wrapping, rather than 10).
>>
>>
> Neat trick...I'll try this. Thanks!
>
>
>> Also, active does not pay any attention to subinstrument arguments, the
>> following lines:
>> active 2.1
>> active 2.2
>> active 2
>>
>> All will return the same result.
>>
>>
> This is an annoying bug....there ought to be an option for measuring how
> many active voices of a fractional instrument there are....developers?
>
> Best,
> AKJ
>
>
>
>> Aaron Krister Johnson wrote:
>>> Hi all,
>>>
>>> I'm stuck on how to pull something off in Csound.
>>>
>>> I want to have a fractional instrument definition so that I can embed a
>>> pitch in use that would represent an individual 'tine' on a kalimba.
>>>
>>> This way, Csound can detect that when a tine is playing ti goes on
>> playing
>>> unless it is struck again (a reinit).
>>>
>>> I've fleshed it out as two instruments: the sound producing 'virtual FM
>>> kalimba', and the 'helper instrument' which send event_i events to the
>>> sound-engine. I'm trying unsuccesfully to use 'turnoff2' to control
>> envelope
>>> release, but I'm getting unexpected results---the engine only plays two
>>> notes. Of course, I'm telling it to only allow one note at a time, sensed
>> by
>>> the 'active' opcode, but I'm wondering why the fractional instrument
>> thing
>>> isn't working as designated in the active/turnoff2 combination....here's
>> my
>>> current code, any help will be appreciated:
>>>
>>>     instr 7
>>> iamp    = p4*p4
>>> ipch    = p5
>>> ;; panning was implemented as a modulus function of pitch
>>> ;; this is just a way for us to get fancy stereo automatically, based on
>>> pitch
>>> ;; as if we are really small standing on the kalimba and hearing the
>> tines
>>> ;; coming from all around us.
>>> ipanoffset = (log(ipch/64)/log(2)/20) - .1
>>> if (ipanoffset > .1) then
>>> ipanoffset = .1
>>> elseif (ipanoffset < -.1) then
>>> ipanoffset = -.1
>>> endif
>>> ipanr   = sqrt(p6 + ipanoffset)
>>> ipanl   = sqrt(1- (p6+ ipanoffset))
>>> imix    = p7
>>> kmodenv oscil1  0, 4+rnd(1), .1, 51
>>> kenv    expsegr  (.001), .01, (1), ((2200/ipch)*1.6), (.001), .7, (.001)
>>> ;;;added last two terms for 'helper inst' 97
>>> aosc    foscil  kenv, ipch, 1, 5.873, kmodenv, 1
>>>     zawm aosc*kenv*iamp*ipanl*imix, 1
>>>     zawm aosc*kenv*iamp*ipanr*imix, 2
>>>     endin
>>>
>>>     instr 97 ;;; kalimba helper
>>> iamp = p4
>>> ipch = p5
>>> ipan = p6
>>> imix = p7
>>> Sinsnum sprintf "7.%d", int(p5)
>>> iinsnum strtod Sinsnum
>>> iact active iinsnum
>>> if iact > 1 then
>>>    turnoff2 iinsnum, 12, 1
>>> endif
>>> event_i "i", iinsnum, 0, -1, iamp, ipch, ipan, imix
>>>     endin
>>>
>>
>>
>> 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"




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

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: "virtual kalimba" problem...help, anyone?

Justin Smith
Aaron Krister Johnson wrote:
...
> Hey, sorry you're not getting what I want to do---I understand about Csound
> tying, etc.
>
> But the kalimba is not a monophonic tying instrument _per-se_. I only want
> to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the
> *same* pitch, provided that pitch is actually still sounding.

As I said, this is how tying works. Only identical subinstruments are tied.


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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: "virtual kalimba" problem...help, anyone?

Aaron Krister Johnson


On Tue, Dec 21, 2010 at 5:02 AM, Justin Glenn Smith <[hidden email]> wrote:
Aaron Krister Johnson wrote:
...
> Hey, sorry you're not getting what I want to do---I understand about Csound
> tying, etc.
>
> But the kalimba is not a monophonic tying instrument _per-se_. I only want
> to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the
> *same* pitch, provided that pitch is actually still sounding.

As I said, this is how tying works. Only identical subinstruments are tied.


I thought so too, but it doesn't seem to work in my orchestra, and I can't find the error.

I'm going to try a completely brute force, inelegant solution to my problem: each note is an instrument.....ugly hack, but it might work a lot better and be a straighter line to my goal. RIght now, I'm working against Csound and vice-versa to get what I need....

After all, to simulate my 15-note alto kalimba, I only need 15 intruments!

I can script the code for this in Python, and cut and paste into the .orc file.

AKJ
 

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 [hidden email] with body "unsubscribe csound"




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

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: "virtual kalimba" problem...help, anyone?

Aaron Krister Johnson
Justin (and any lurkers on this thread),

Thanks for all your help on this -- I had a big 'duh' moment when it dawned on me what you are saying about sub-instrument tying...I was doing it all along, but making it too complicated, methinks! :)

Anyway, I have a workable solution right now. I can mess around with FM parameters to try to get a more realistic kalimba timbre, or I can use samples for more realism. Eventually, I'm going to go the latter route.

Cheers,
AKJ

On Tue, Dec 21, 2010 at 7:34 AM, Aaron Krister Johnson <[hidden email]> wrote:


On Tue, Dec 21, 2010 at 5:02 AM, Justin Glenn Smith <[hidden email]> wrote:
Aaron Krister Johnson wrote:
...
> Hey, sorry you're not getting what I want to do---I understand about Csound
> tying, etc.
>
> But the kalimba is not a monophonic tying instrument _per-se_. I only want
> to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the
> *same* pitch, provided that pitch is actually still sounding.

As I said, this is how tying works. Only identical subinstruments are tied.


I thought so too, but it doesn't seem to work in my orchestra, and I can't find the error.

I'm going to try a completely brute force, inelegant solution to my problem: each note is an instrument.....ugly hack, but it might work a lot better and be a straighter line to my goal. RIght now, I'm working against Csound and vice-versa to get what I need....

After all, to simulate my 15-note alto kalimba, I only need 15 intruments!

I can script the code for this in Python, and cut and paste into the .orc file.

AKJ
 

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 [hidden email] with body "unsubscribe csound"






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

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: "virtual kalimba" problem...help, anyone?

Justin Smith
In reply to this post by Aaron Krister Johnson
Your problem is that you are using active and turnoff2, and you should be using neither. Automatic tying of indefinitely playing subinstruments does exactly what you want. Run this csd, and tell me if the output is different from mine:

<CsoundSynthesizer>
<CsOptions>
-d
-n
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 1000
nchnls = 2

       instr 1
isubins active p1
        printf "number running: %G, subinstrument: %G\\n", 1, isubins, p1
itie    tival
        printf "tying from previous i%G\\n", itie, p1
krel    release
        printf "releasing i%G\\n", krel, p1
       endin

</CsInstruments>
<CsScore>
i 1.1 0  -1
i 1.1 5  -1
i 1.2 7  -1
i 1.2 8  -1
i -1.2 9  0
i -1.1 10 0
e
</CsScore>
</CsoundSynthesizer>

The output I get:

not writing to sound disk
SECTION 1:
new alloc for instr 1:
number running: 1, subinstrument: 1.1
B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0      0.0
number running: 1, subinstrument: 1.1
tying from previous i1.1
B  5.000 ..  7.000 T  7.000 TT  7.000 M:      0.0      0.0
new alloc for instr 1:
number running: 2, subinstrument: 1.2
B  7.000 ..  8.000 T  8.000 TT  8.000 M:      0.0      0.0
number running: 2, subinstrument: 1.2
tying from previous i1.2
B  8.000 ..  9.000 T  9.000 TT  9.000 M:      0.0      0.0
releasing i1.2
B  9.000 .. 10.000 T 10.000 TT 10.000 M:      0.0      0.0
releasing i1.1
B 10.000 .. 10.021 T 10.021 TT 10.021 M:      0.0      0.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.              overall amps:      0.0      0.0
           overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 0.022s, CPU: 0.010s
no sound written to disk

Aaron Krister Johnson wrote:

> On Tue, Dec 21, 2010 at 5:02 AM, Justin Glenn Smith <[hidden email]>wrote:
>
>> Aaron Krister Johnson wrote:
>> ...
>>> Hey, sorry you're not getting what I want to do---I understand about
>> Csound
>>> tying, etc.
>>>
>>> But the kalimba is not a monophonic tying instrument _per-se_. I only
>> want
>>> to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the
>>> *same* pitch, provided that pitch is actually still sounding.
>> As I said, this is how tying works. Only identical subinstruments are tied.
>>
>>
> I thought so too, but it doesn't seem to work in my orchestra, and I can't
> find the error.
>
> I'm going to try a completely brute force, inelegant solution to my problem:
> each note is an instrument.....ugly hack, but it might work a lot better and
> be a straighter line to my goal. RIght now, I'm working against Csound and
> vice-versa to get what I need....
>
> After all, to simulate my 15-note alto kalimba, I only need 15 intruments!
>
> I can script the code for this in Python, and cut and paste into the .orc
> file.
>
> AKJ
>
>
>> 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"

Reply | Threaded
Open this post in threaded view
|

Re: Re: Re: Re: Re: Re: "virtual kalimba" problem...help, anyone?

Aaron Krister Johnson
Yeah, got it, makes sense....if you're interested, and have an interest or use for such a thing,  I'll share the setup with you once I'm done tweaking. I'm always interested to see where others take such a thing either musically, or tweaking the orchestra to their own liking.

Cheers,
AKJ

On Tue, Dec 21, 2010 at 1:53 PM, Justin Glenn Smith <[hidden email]> wrote:
Your problem is that you are using active and turnoff2, and you should be using neither. Automatic tying of indefinitely playing subinstruments does exactly what you want. Run this csd, and tell me if the output is different from mine:

<CsoundSynthesizer>
<CsOptions>
-d
-n
</CsOptions>
<CsInstruments>
sr = 48000
ksmps = 1000
nchnls = 2

      instr 1
isubins active p1
       printf "number running: %G, subinstrument: %G\\n", 1, isubins, p1
itie    tival
       printf "tying from previous i%G\\n", itie, p1
krel    release
       printf "releasing i%G\\n", krel, p1
      endin

</CsInstruments>
<CsScore>
i 1.1 0  -1
i 1.1 5  -1
i 1.2 7  -1
i 1.2 8  -1
i -1.2 9  0
i -1.1 10 0
e
</CsScore>
</CsoundSynthesizer>

The output I get:

not writing to sound disk
SECTION 1:
new alloc for instr 1:
number running: 1, subinstrument: 1.1
B  0.000 ..  5.000 T  5.000 TT  5.000 M:      0.0      0.0
number running: 1, subinstrument: 1.1
tying from previous i1.1
B  5.000 ..  7.000 T  7.000 TT  7.000 M:      0.0      0.0
new alloc for instr 1:
number running: 2, subinstrument: 1.2
B  7.000 ..  8.000 T  8.000 TT  8.000 M:      0.0      0.0
number running: 2, subinstrument: 1.2
tying from previous i1.2
B  8.000 ..  9.000 T  9.000 TT  9.000 M:      0.0      0.0
releasing i1.2
B  9.000 .. 10.000 T 10.000 TT 10.000 M:      0.0      0.0
releasing i1.1
B 10.000 .. 10.021 T 10.021 TT 10.021 M:      0.0      0.0
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.              overall amps:      0.0      0.0
          overall samples out of range:        0        0
0 errors in performance
Elapsed time at end of performance: real: 0.022s, CPU: 0.010s
no sound written to disk

Aaron Krister Johnson wrote:
> On Tue, Dec 21, 2010 at 5:02 AM, Justin Glenn Smith <[hidden email]>wrote:
>
>> Aaron Krister Johnson wrote:
>> ...
>>> Hey, sorry you're not getting what I want to do---I understand about
>> Csound
>>> tying, etc.
>>>
>>> But the kalimba is not a monophonic tying instrument _per-se_. I only
>> want
>>> to 'tie' (actually stop and reinit with a virtual thumb :) ) notes of the
>>> *same* pitch, provided that pitch is actually still sounding.
>> As I said, this is how tying works. Only identical subinstruments are tied.
>>
>>
> I thought so too, but it doesn't seem to work in my orchestra, and I can't
> find the error.
>
> I'm going to try a completely brute force, inelegant solution to my problem:
> each note is an instrument.....ugly hack, but it might work a lot better and
> be a straighter line to my goal. RIght now, I'm working against Csound and
> vice-versa to get what I need....
>
> After all, to simulate my 15-note alto kalimba, I only need 15 intruments!
>
> I can script the code for this in Python, and cut and paste into the .orc
> file.
>
> AKJ
>
>
>> 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 [hidden email] 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 [hidden email] with body "unsubscribe csound"




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