Csound Csound-dev Csound-tekno Search About

[Csnd] Instruments won't play simultaneously

Date2017-09-22 08:32
Fromboleszek
Subject[Csnd] Instruments won't play simultaneously
Hello again,

I was able to continuously modulate the pitch of an oscillator using
numerical data in a txt file using GEN23 (thanks for your help!). I am now
trying to get two instruments to play simultaneously. I thought I could get
them to play simultaneously by just setting their start times both equal to
0, but when I run the csd file I only hear i2!

The instruments are defined with ftables from two different txt files
("LFPb_inst_fq_smoothed.txt" & "LFPlg_inst_fq_smoothed.txt"). The txt files
are each 3s of neural data sampled at 3KHz (8999 samples total, so just
under 3s). I wrote the code so that the play back of the neural data happens
in real time (the whole thing lasting 3s). Any ideas why I can't hear both
instruments simultaneously? My csd file is below:



; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out



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

instr 1
giwave1  ftgen 1,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, giwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
giwave2  ftgen 1,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, giwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin




i1 0 3
i2 0 3

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

Date2017-09-22 12:32
FromJohn ff
SubjectRe: [Csnd] Instruments won't play simultaneously
I think it should work.  Try outputting to astereo file with each instrument on a different channel.  That would show off you have masking

Sent from Blue
On 22 Sep 2017, at 08:32, boleszek <boleszeko@GMAIL.COM> wrote:
Hello again,

I was able to continuously modulate the pitch of an oscillator using
numerical data in a txt file using GEN23 (thanks for your help!). I am now
trying to get two instruments to play simultaneously. I thought I could get
them to play simultaneously by just setting their start times both equal to
0, but when I run the csd file I only hear i2!

The instruments are defined with ftables from two different txt files
("LFPb_inst_fq_smoothed.txt" & "LFPlg_inst_fq_smoothed.txt"). The txt files
are each 3s of neural data sampled at 3KHz (8999 samples total, so just
under 3s). I wrote the code so that the play back of the neural data happens
in real time (the whole thing lasting 3s). Any ideas why I can't hear both
instruments simultaneously? My csd file is below:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
giwave1 ftgen 1,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, giwave1
aSig1 poscil 0.5, 25*aPitch1
out aSig1
endin

instr 2
giwave2 ftgen 1,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, giwave2
aSig2 poscil 0.5, 25*aPitch2
out aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

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

Date2017-09-22 12:33
FromIain McCurdy
SubjectRe: [Csnd] Instruments won't play simultaneously

I think you might need to be careful about how you construct your function tables. I suspect you are hearing both instruments but that they are created identical audio that is layered. As it is, the function table in instrument 2 is immediately overwriting that in instrument one. This is because you are giving them both the same table number (1). You are also giving them a global output variable, which will adopt the table number given as an input argument. These don't need to be global as they are only used within the instrument in which they are created.

I would suggest that, as you are only using the variable name as a handle to the table data, to give table number a value of zero for the p1 input arg. This way, Csound will assign a unique number and you don't really need to worry about what it is. In summary, I'd suggest this:


<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
iwave1  ftgen 0,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, iwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
iwave2  ftgen 0,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, iwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

e
</CsScore>




From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of boleszek <boleszeko@GMAIL.COM>
Sent: 22 September 2017 07:32
To: CSOUND@LISTSERV.HEANET.IE
Subject: [Csnd] Instruments won't play simultaneously
 
Hello again,

I was able to continuously modulate the pitch of an oscillator using
numerical data in a txt file using GEN23 (thanks for your help!). I am now
trying to get two instruments to play simultaneously. I thought I could get
them to play simultaneously by just setting their start times both equal to
0, but when I run the csd file I only hear i2!

The instruments are defined with ftables from two different txt files
("LFPb_inst_fq_smoothed.txt" & "LFPlg_inst_fq_smoothed.txt"). The txt files
are each 3s of neural data sampled at 3KHz (8999 samples total, so just
under 3s). I wrote the code so that the play back of the neural data happens
in real time (the whole thing lasting 3s). Any ideas why I can't hear both
instruments simultaneously? My csd file is below:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
giwave1  ftgen 1,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, giwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
giwave2  ftgen 1,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, giwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

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

Date2017-09-22 14:19
FromForrest Curo
SubjectRe: [Csnd] Instruments won't play simultaneously
And why not (since nchnls= 2):

instr 1

iwave1  ftgen 0,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, iwave1
aSig1 poscil 0.5, 25*aPitch1
; let  'aSig1' be for a few lines of code...
; no need for 'endin' yet

; no need for 'instr 2'
iwave2  ftgen 0,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, iwave2
aSig2 poscil 0.5, 25*aPitch2
outs  aSig1, aSig2
endin

On Fri, Sep 22, 2017 at 4:33 AM, Iain McCurdy <i_mccurdy@hotmail.com> wrote:

I think you might need to be careful about how you construct your function tables. I suspect you are hearing both instruments but that they are created identical audio that is layered. As it is, the function table in instrument 2 is immediately overwriting that in instrument one. This is because you are giving them both the same table number (1). You are also giving them a global output variable, which will adopt the table number given as an input argument. These don't need to be global as they are only used within the instrument in which they are created.

I would suggest that, as you are only using the variable name as a handle to the table data, to give table number a value of zero for the p1 input arg. This way, Csound will assign a unique number and you don't really need to worry about what it is. In summary, I'd suggest this:


<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
iwave1  ftgen 0,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, iwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
iwave2  ftgen 0,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, iwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

e
</CsScore>




From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of boleszek <boleszeko@GMAIL.COM>
Sent: 22 September 2017 07:32
To: CSOUND@LISTSERV.HEANET.IE
Subject: [Csnd] Instruments won't play simultaneously
 
Hello again,

I was able to continuously modulate the pitch of an oscillator using
numerical data in a txt file using GEN23 (thanks for your help!). I am now
trying to get two instruments to play simultaneously. I thought I could get
them to play simultaneously by just setting their start times both equal to
0, but when I run the csd file I only hear i2!

The instruments are defined with ftables from two different txt files
("LFPb_inst_fq_smoothed.txt" & "LFPlg_inst_fq_smoothed.txt"). The txt files
are each 3s of neural data sampled at 3KHz (8999 samples total, so just
under 3s). I wrote the code so that the play back of the neural data happens
in real time (the whole thing lasting 3s). Any ideas why I can't hear both
instruments simultaneously? My csd file is below:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
giwave1  ftgen 1,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, giwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
giwave2  ftgen 1,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, giwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

e
</CsScore>
</CsoundSynthesizer>




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
This forum is an archive for the mailing list csound@listserv.heanet.ie (more options) Messages posted here will be sent to this mailing list.



Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
A discussion list for users of Csound. Hide Latest Messages. September 2017; August 2017; July 2017; June 2017; May 2017; April 2017; March 2017


Send bugs reports to
        https://github.com/csound/csound/issues
csound - Main repository for Csound ... Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the ...


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

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

Date2017-09-22 18:55
FromBoleslaw Osinski
SubjectRe: [Csnd] Instruments won't play simultaneously
Oh wow, I feel silly. I was indeed assigning both of my function tables to 1. Thanks for pointing that out Iain, now it works!

Bo

On Fri, Sep 22, 2017 at 6:33 AM, Iain McCurdy <i_mccurdy@hotmail.com> wrote:

I think you might need to be careful about how you construct your function tables. I suspect you are hearing both instruments but that they are created identical audio that is layered. As it is, the function table in instrument 2 is immediately overwriting that in instrument one. This is because you are giving them both the same table number (1). You are also giving them a global output variable, which will adopt the table number given as an input argument. These don't need to be global as they are only used within the instrument in which they are created.

I would suggest that, as you are only using the variable name as a handle to the table data, to give table number a value of zero for the p1 input arg. This way, Csound will assign a unique number and you don't really need to worry about what it is. In summary, I'd suggest this:


<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
iwave1  ftgen 0,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, iwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
iwave2  ftgen 0,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, iwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

e
</CsScore>




From: A discussion list for users of Csound <CSOUND@LISTSERV.HEANET.IE> on behalf of boleszek <boleszeko@GMAIL.COM>
Sent: 22 September 2017 07:32
To: CSOUND@LISTSERV.HEANET.IE
Subject: [Csnd] Instruments won't play simultaneously
 
Hello again,

I was able to continuously modulate the pitch of an oscillator using
numerical data in a txt file using GEN23 (thanks for your help!). I am now
trying to get two instruments to play simultaneously. I thought I could get
them to play simultaneously by just setting their start times both equal to
0, but when I run the csd file I only hear i2!

The instruments are defined with ftables from two different txt files
("LFPb_inst_fq_smoothed.txt" & "LFPlg_inst_fq_smoothed.txt"). The txt files
are each 3s of neural data sampled at 3KHz (8999 samples total, so just
under 3s). I wrote the code so that the play back of the neural data happens
in real time (the whole thing lasting 3s). Any ideas why I can't hear both
instruments simultaneously? My csd file is below:

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac  ;;;realtime audio out
</CsOptions>
<CsInstruments>

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

instr 1
giwave1  ftgen 1,0,0,-23,"LFPb_inst_fq_smoothed.txt"
aPitch1 poscil 0.5, 1/3, giwave1
aSig1 poscil 0.5, 25*aPitch1
out  aSig1
endin

instr 2
giwave2  ftgen 1,0,0,-23,"LFPlg_inst_fq_smoothed.txt"
aPitch2 poscil 0.5, 1/3, giwave2
aSig2 poscil 0.5, 25*aPitch2
out  aSig2
endin

</CsInstruments>
<CsScore>

i1 0 3
i2 0 3

e
</CsScore>
</CsoundSynthesizer>




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
This forum is an archive for the mailing list csound@listserv.heanet.ie (more options) Messages posted here will be sent to this mailing list.



Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
A discussion list for users of Csound. Hide Latest Messages. September 2017; August 2017; July 2017; June 2017; May 2017; April 2017; March 2017


Send bugs reports to
        https://github.com/csound/csound/issues
csound - Main repository for Csound ... Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the ...


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

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