Discussion:
active and fractional instruments
mesca
2014-10-16 14:50:17 UTC
Permalink
Thanks a lot Iain, just what I needed :)
I didn't notice any bug, will let you know if I find something.
Thanks again!
I suppose active ignores the fractional part of p1.
You could try this UDO ActiveFrac which logs fractional p1s and counts them in the manner of active. It gives the correct result with your test. You need to pass it the number of a function table as well which it uses to store the p1 values. I haven't tested it too fully so let me know if there are any problems.
<CsoundSynthesizer>
<CsOptions>
-dm0
</CsOptions>
<CsInstruments>
giTab ftgen 0,0,4096,-2,0
opcode ActiveFrac,i,ii
ip1,iTab xin
iN active p1
tableiw ip1,iN,iTab
iIndx = 1
iInsts = 0
iVal table iIndx,iTab
iInsts = (iVal==ip1?iInsts+1:iInsts)
loop_le iIndx,1,iN,loop
krel release
; when note is released remove its p1 value from the table and shunt subsequent values back
if trigger(krel,0.5,0)==1 then
kNdx = iN
kVal table kNdx+1,iTab
tablew kVal,kNdx,iTab
loop_le kNdx,1,iN,loop2
endif
xout iInsts
endop
instr 1
ia ActiveFrac p1,giTab
print ia
endin
</CsInstruments>
<CsScore>
i 1.1 0 2 ; prints 1
i 1.2 1 1 ; prints 2, should print 1
</CsScore>
</CsoundSynthesizer>
From: [hidden email]
Date: Wed, 15 Oct 2014 18:07:43 +0200
To: [hidden email]
Subject: Re: [Csnd] active and fractional instruments
Sorry to bump this old topic, but I am faced with this problematic again.
I need to count the number of active instances of the current fractional instrument.
Any suggestion?
Hi all,
The active opcode works only with the integer part of instrument numbers (see below). Is there a way to get the number of active instances of a fractional instrument?
<CsoundSynthesizer>
<CsInstruments>
instr 1
ia active p1
print ia
endin
</CsInstruments>
<CsScore>
i 1.1 0 2 ; prints 1
i 1.2 1 1 ; prints 2, should print 1
</CsScore>
</CsoundSynthesizer>
--
Pierre
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Csound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
Csound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/csound-users
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
http://csound.1045644.n5.nabble.com/active-and-fractional-instruments-tp5735689p5737928.html
To unsubscribe from active and fractional instruments, click here.
NAML
--
View this message in context: http://csound.1045644.n5.nabble.com/active-and-fractional-instruments-tp5735689p5737968.html
Sent from the Csound - General mailing list archive at Nabble.com.
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
To unsubscribe, send email ***@lists.bath.ac.uk with body "unsubscribe csound"
Loading...