[Csnd] Instruments won't play simultaneously
Date | 2017-09-22 08:32 |
From | boleszek |
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: |
Date | 2017-09-22 12:32 |
From | John ff |
Subject | Re: [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, |
Date | 2017-09-22 12:33 | |||||||
From | Iain McCurdy | |||||||
Subject | Re: [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> 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 |
Date | 2017-09-22 14:19 | |||||||
From | Forrest Curo | |||||||
Subject | Re: [Csnd] Instruments won't play simultaneously | |||||||
And why not (since nchnls= 2): instr 1 iwave1 ftgen 0,0,0,-23,"LFPb_inst_fq_ 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_ 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:
|
Date | 2017-09-22 18:55 | |||||||
From | Boleslaw Osinski | |||||||
Subject | Re: [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:
|