Csound Csound-dev Csound-tekno Search About

[Csnd] Two instances of PrePiano?

Date2018-10-11 14:00
Fromfauveboy
Subject[Csnd] Two instances of PrePiano?
With the program below, I was expecting two instances of prepiano to play
simultaneously. Why does it only play the second note? I hoping to play a
chord from the instrument?

Many thanks




; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform



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

instr 1

ifreq 	= cpspch(p4)
iamp		= p5




;;            
FRQ4|NO.STR5|DTUN6|STIF7|DCAY8|HIFRQ9|MASS10|HMFQ11|HMPOS|STPOS| VEL  |sFRQ
| scn |
aa, ab prepiano ifreq,  p6,  p7,	 p8,   p9,   p10,    p11,   p12,   p13,  
p14, p15,  p16,    p17, p18, p19


      outs aa*3.5, ab*3.5

endin


;f10 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
;f11 0 8 2 1 0.7 50 500 1000  ;; 1 rubber

;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		1		1   		8.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.01
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5	
		
		
		
		;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		1		1   		6.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.01
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5		

		
		

e






--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-11 14:29
FromVictor Lazzarini
SubjectRe: [Csnd] Two instances of PrePiano?
Both instances are playing here. It’s hard to hear because they’re the same pitch class, but
if you change it to an interval other than the octave you will hear it
========================
Prof. Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy,
Maynooth University,
Maynooth, Co Kildare, Ireland
Tel: 00 353 7086936
Fax: 00 353 1 7086952 

> On 11 Oct 2018, at 14:00, fauveboy  wrote:
> 
> With the program below, I was expecting two instances of prepiano to play
> simultaneously. Why does it only play the second note? I hoping to play a
> chord from the instrument?
> 
> Many thanks
> 
> 
> 
> 
> ; Select audio/midi flags here according to platform
> -odac     ;;;realtime audio out
> ;-iadc    ;;;uncomment -iadc if real audio input is needed too
> ; For Non-realtime ouput leave only the line below:
> ; -o prepiano.wav -W ;;; for file output any platform
> 
> 
> 
> sr = 44100
> ksmps = 32
> nchnls = 2
> 0dbfs  = 1
> 
> instr 1
> 
> ifreq 	= cpspch(p4)
> iamp		= p5
> 
> 
> 
> 
> ;;            
> FRQ4|NO.STR5|DTUN6|STIF7|DCAY8|HIFRQ9|MASS10|HMFQ11|HMPOS|STPOS| VEL  |sFRQ
> | scn |
> aa, ab prepiano ifreq,  p6,  p7,	 p8,   p9,   p10,    p11,   p12,   p13,  
> p14, p15,  p16,    p17, p18, p19
> 
> 
>      outs aa*3.5, ab*3.5
> 
> endin
> 
> 
> ;f10 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
> ;f11 0 8 2 1 0.7 50 500 1000  ;; 1 rubber
> 
> ;		INS		STR		DUR		;FRQ4	 	AMP5
> i		1 		1		1   		8.12		5
> 
> 		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
> 		3		10		1		3		0.002
> 		
> 		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
> 		2		2		1		5000		-0.01
> 		
> 		;SCFRQ	SCREAD	RATTLE	RUBBER	
> 		0.09		40		0		0.5	
> 		
> 		
> 		
> 		;		INS		STR		DUR		;FRQ4	 	AMP5
> i		1 		1		1   		6.12		5
> 
> 		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
> 		3		10		1		3		0.002
> 		
> 		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
> 		2		2		1		5000		-0.01
> 		
> 		;SCFRQ	SCREAD	RATTLE	RUBBER	
> 		0.09		40		0		0.5		
> 
> 		
> 		
> 
> e
> 
> 
> 
> 
> 
> 
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here


Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-11 16:29
Fromfauveboy
SubjectRe: [Csnd] Two instances of PrePiano?
Ah, thats true but I realised I need to show you this combination of
instruments where the original problem is occurring still:



; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform



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

zakinit 10, 10

	instr 1

ifreq 	= cpspch(p4)
iamp		= p5

iamp1		=	p20
iamp2		=	p21

izout1	=	p22
izout2	=	p23




;;            
FRQ4|NO.STR5|DTUN6|STIF7|DCAY8|HIFRQ9|MASS10|HMFQ11|HMPOS|STPOS| VEL  |sFRQ
| scn |
aa, ab prepiano ifreq,  p6,  p7,	 p8,   p9,   p10,    p11,   p12,   p13,  
p14, p15,  p16,    p17, p18, p19


     
      zaw	aa*iamp1, izout1
      zaw	ab*iamp2, izout2

	endin
	
	
	instr 2
	

asig1		zar		p4

kgl1		=		p5*(p6)
kgr1		=		p5*(1-p6)

asig2		zar		p7

kgl2		=		p8*(p9)
kgr2		=		p8*(1-p9)

asig1		=		asig1*kgl1+asig2*kgl2
asig2		=		asig1*kgl1+asig2*kgl2

	outs asig1,asig2
	
	zacl 0, 10


	endin
	
	


;f10 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
;f11 0 8 2 1 0.7 50 500 1000  ;; 1 rubber

;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		1		1   		8.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.01
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5	
		
		;AMP1		AMP1
		0.0		0.7
		
		;CH1		CH2
		1		2
		 		
		
		
;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		1		1   		6.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.0
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5	
		
		
		;AMP1		AMP1
		0.1		0.0
	
;MIXER	INST			ST		DUR
i		2			0		4

		;CHN1[IN]		GAIN		PAN
		1			1		0.9
		
		;CHN2[IN]		GAIN		PAN
		2			1		0.1
			
	

e






--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-11 16:49
Fromfauveboy
SubjectRe: [Csnd] Two instances of PrePiano?
we this score you can here the first note get cut off by the second:



; Select audio/midi flags here according to platform
-odac     ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform



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

zakinit 10, 10

	instr 1

ifreq 	= cpspch(p4)
iamp		= p5

iamp1		=	p20
iamp2		=	p21

izout1	=	p22
izout2	=	p23




;;            
FRQ4|NO.STR5|DTUN6|STIF7|DCAY8|HIFRQ9|MASS10|HMFQ11|HMPOS|STPOS| VEL  |sFRQ
| scn |
aa, ab prepiano ifreq,  p6,  p7,	 p8,   p9,   p10,    p11,   p12,   p13,  
p14, p15,  p16,    p17, p18, p19


     
      zaw	aa*iamp1, izout1
      zaw	ab*iamp2, izout2

	endin
	
	
	instr 2
	

asig1		zar		p4

kgl1		=		p5*(p6)
kgr1		=		p5*(1-p6)

asig2		zar		p7

kgl2		=		p8*(p9)
kgr2		=		p8*(1-p9)

asig1		=		asig1*kgl1+asig2*kgl2
asig2		=		asig1*kgl1+asig2*kgl2

	outs asig1,asig2
	
	zacl 0, 10


	endin
	
	


;f10 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
;f11 0 8 2 1 0.7 50 500 1000  ;; 1 rubber

;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		0.9		1   		8.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.01
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5	
		
		;AMP1		AMP1
		0.0		0.9
		
		;CH1		CH2
		1		2
		 		
		
		
;		INS		STR		DUR		;FRQ4	 	AMP5
i		1 		1		1   		6.12		5

		;NO.STR6	DTUN7		STIF8		DCAY9		HIFQDCAY10
		3		10		1		3		0.002
		
		;MAS11	HMFQ12	HMPOS13	STRPOS14	VEL15		
		2		2		1		5000		-0.0
		
		;SCFRQ	SCREAD	RATTLE	RUBBER	
		0.09		40		0		0.5	
		
		
		;AMP1		AMP1
		0.5		0.0
	
;MIXER	INST			ST		DUR
i		2			0		4

		;CHN1[IN]		GAIN		PAN
		1			1		0.5
		
		;CHN2[IN]		GAIN		PAN
		2			1		0.5
			
	

e






--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-11 23:23
FromJohn ff
SubjectRe: [Csnd] Two instances of PrePiano?
Cc both noted write to the same Zak location without adding the signals

Sent from TypeApp
On 11 Oct 2018, at 16:50, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
we this score you can here the first note get cut off by the second:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
;-iadc ;;;uncomment -iadc if real audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o prepiano.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

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

zakinit 10, 10

instr 1

ifreq = cpspch(p4)
iamp = p5

iamp1 = p20
iamp2 = p21

izout1 = p22
izout2 = p23




;;
FRQ4|NO.STR5|DTUN6|STIF7|DCAY8|HIFRQ9|MASS10|HMFQ11|HMPOS|STPOS| VEL |sFRQ
| scn |
aa, ab prepiano ifreq, p6, p7, p8, p9, p10, p11, p12, p13,
p14, p15, p16, p17, p18, p19



zaw aa*iamp1, izout1
zaw ab*iamp2, izout2

endin


instr 2


asig1 zar p4

kgl1 = p5*(p6)
kgr1 = p5*(1-p6)

asig2 zar p7

kgl2 = p8*(p9)
kgr2 = p8*(1-p9)

asig1 = asig1*kgl1+asig2*kgl2
asig2 = asig1*kgl1+asig2*kgl2

outs asig1,asig2

zacl 0, 10


endin


</CsInstruments>
<CsScore>
;f10 0 8 2 1 0.6 10 100 0.001 ;; 1 rattle
;f11 0 8 2 1 0.7 50 500 1000 ;; 1 rubber

; INS STR DUR ;FRQ4 AMP5
i 1 0.9 1 8.12 5

;NO.STR6 DTUN7 STIF8 DCAY9 HIFQDCAY10
3 10 1 3 0.002

;MAS11 HMFQ12 HMPOS13 STRPOS14 VEL15
2 2 1 5000 -0.01

;SCFRQ SCREAD RATTLE RUBBER
0.09 40 0 0.5

;AMP1 AMP1
0.0 0.9

;CH1 CH2
1 2



; INS STR DUR ;FRQ4 AMP5
i 1 1 1 6.12 5

;NO.STR6 DTUN7 STIF8 DCAY9 HIFQDCAY10
3 10 1 3 0.002

;MAS11 HMFQ12 HMPOS13 STRPOS14 VEL15
2 2 1 5000 -0.0

;SCFRQ SCREAD RATTLE RUBBER
0.09 40 0 0.5


;AMP1 AMP1
0.5 0.0

;MIXER INST ST DUR
i 2 0 4

;CHN1[IN] GAIN PAN
1 1 0.5

;CHN2[IN] GAIN PAN
2 1 0.5



e
</CsScore>
</CsoundSynthesizer>




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-17 14:41
Fromfauveboy
SubjectRe: [Csnd] Two instances of PrePiano?
is there a way to add the signals?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2018-10-17 15:18
FromHlöðver Sigurðsson
SubjectRe: [Csnd] Two instances of PrePiano?
Did you try zar first and zaw the mixed signals? If you use chn istead of the zak system, then you can mix them with chnmix and as a bonus you don't need to initialize them, you can directly call chnset (not sure with chnmix, I tend to read and write for mixing).

On Wed, 17 Oct 2018 at 15:41, fauveboy <joel.ramsbottom@hotmail.co.uk> wrote:
is there a way to add the signals?



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here

Date2018-10-17 16:10
Fromjpff
SubjectRe: [Csnd] Two instances of PrePiano?
zawm opcode is what you need


On Wed, 17 Oct 2018, fauveboy wrote:

> is there a way to add the signals?
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>        https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here