[Cs-dev] quick question, multi-channel
Date | 2014-05-14 21:54 |
From | Rory Walsh |
Subject | [Cs-dev] quick question, multi-channel |
I thought my processing loop in Cabbage could handle multichannel signals. And I can remember experimenting without any problems in the past. Now I get some high pitched artefacts on all channels. Does the processing function presented below look ok to you guys? (note that nchnls==getNumOutputChannels()) I'm testing with a simple oscil instrument, outputting the same signal to each channel. I have nchnls set to 8 and I'm using outch 1-8 to output the samples. The odd thing is that CSspout[channel+pos] changes value every second channel. My understanding would be that it should stay the same until channel returns to 0 and the for loop starts all over again? getNumOutputChannels() returns 8, as does csound->GetNchnls(). void CabbagePluginAudioProcessor::processBlock (AudioSampleBuffer& buffer, MidiBuffer& midiMessages) { float* audioBuffer; for(int i=0;i |
Date | 2014-05-14 22:19 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] quick question, multi-channel |
does it work on the command line? ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 14 May 2014, at 21:54, Rory Walsh |
Date | 2014-05-14 22:52 |
From | Rory Walsh |
Subject | Re: [Cs-dev] quick question, multi-channel |
I don't have enough channels on my sounds card to test a simple API version(but I guess I don't need if I'm only checking the contents of CsSpout?). Anyway I'm wrapping it into an 8 channel VST. Is my assumption that CSspout[channel+pos] should remain the same until it has looped through all 8 channels correct? If I log the variables it looks like this: csndIndex:0 Channel:0 Value:0 csndIndex:0 Channel:1 Value:0 csndIndex:0 Channel:2 Value:0.0283748 csndIndex:0 Channel:3 Value:0.0283748 csndIndex:0 Channel:4 Value:0.0567268 csndIndex:0 Channel:5 Value:0.0567268 csndIndex:0 Channel:6 Value:0.0850331 csndIndex:0 Channel:7 Value:0.0850331 csndIndex:1 Channel:0 Value:0.113652 csndIndex:1 Channel:1 Value:0.113652 csndIndex:1 Channel:2 Value:0.141797 csndIndex:1 Channel:3 Value:0.141797 csndIndex:1 Channel:4 Value:0.169828 csndIndex:1 Channel:5 Value:0.169828 csndIndex:1 Channel:6 Value:0.198098 csndIndex:1 Channel:7 Value:0.198098 csndIndex:2 Channel:0 Value:0.225831 csndIndex:2 Channel:1 Value:0.225831 csndIndex:2 Channel:2 Value:0.253382 csndIndex:2 Channel:3 Value:0.253382 csndIndex:2 Channel:4 Value:0.281097 csndIndex:2 Channel:5 Value:0.281097 csndIndex:2 Channel:6 Value:0.308214 I'll see if I can throw together a quick command line app now.. On 14 May 2014 22:19, Victor Lazzarini |
Date | 2014-05-14 23:24 |
From | Michael Gogins |
Subject | Re: [Cs-dev] quick question, multi-channel |
Attachments | None None |
Your index computation should be something like this: hostOutput[channelI][hostFrameI] += csoundOutput[(csoundFrameI * channelN) + channelI] * outputScale; It looks to me like you are failing to multiply the inner stride by the number of channels. Hope this helps, Mike ----------------------------------------------------- Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Wed, May 14, 2014 at 4:54 PM, Rory Walsh <rorywalsh@ear.ie> wrote: I thought my processing loop in Cabbage could handle multichannel |
Date | 2014-05-14 23:24 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] quick question, multi-channel |
I mean the Csound command, not your own app. Anyway, what you printed looks 2 channels to me. ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 14 May 2014, at 22:52, Rory Walsh |
Date | 2014-05-14 23:31 |
From | Rory Walsh |
Subject | Re: [Cs-dev] quick question, multi-channel |
Unless I'm mistaken, that is what I'm doing? pos = csndIndex*getNumOutputChannels(); hostBuffer[i] = CSspout[channel+pos]/cs_scale; On 14 May 2014 23:24, Michael Gogins |
Date | 2014-05-14 23:35 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] quick question, multi-channel |
you should be able to test any number of channels with jack. ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 14 May 2014, at 23:24, Victor Lazzarini |
Date | 2014-05-14 23:38 |
From | Rory Walsh |
Subject | Re: [Cs-dev] quick question, multi-channel |
When I try to increase the number of channels in jack and start the server it says no can do. If I just run with nchnls=8 with jack started in stereo I get: 0: dac:system:playback_ (system:playback_) *** rtjack: error connecting output ports How do I set up more channels that I have? On 14 May 2014 23:35, Victor Lazzarini |
Date | 2014-05-14 23:40 |
From | Michael Gogins |
Subject | Re: [Cs-dev] quick question, multi-channel |
Attachments | None None |
I missed that line. .. On May 14, 2014 6:32 PM, "Rory Walsh" <rorywalsh@ear.ie> wrote:
Unless I'm mistaken, that is what I'm doing? |
Date | 2014-05-14 23:50 |
From | Victor Lazzarini |
Subject | Re: [Cs-dev] quick question, multi-channel |
yes, it’s trying to autoconnect. I need to add something to disable it. Anyway, you could test it to a file. I’ve just done it on OSX and it’s fine. ======================== Dr Victor Lazzarini Senior Lecturer NUI Maynooth, Ireland victor dot lazzarini at nuim dot ie On 14 May 2014, at 23:38, Rory Walsh |
Date | 2014-05-14 23:55 |
From | Rory Walsh |
Subject | Re: [Cs-dev] quick question, multi-channel |
Fine here too. Ok, must be elsewhere in my code, and hold on. Yes, I know what it is now. Buried somewhere I bet I have used csound_prams to set the channels! Arrgghh. Why must I keep cutting myself with Occam's razor. I really wonder about me at times! On 14 May 2014 23:50, Victor Lazzarini |
Date | 2014-05-15 02:20 |
From | Justin Smith |
Subject | Re: [Cs-dev] quick question, multi-channel |
Attachments | None None |
If you need to debug behavior when larger channel counts are present, you can use the jack dummy (or maybe even net) backend to create arbitrary numbers of channels.
On Wed, May 14, 2014 at 3:55 PM, Rory Walsh <rorywalsh@ear.ie> wrote: Fine here too. Ok, must be elsewhere in my code, and hold on. Yes, I |
Date | 2014-05-15 08:22 |
From | peiman khosravi |
Subject | Re: [Cs-dev] quick question, multi-channel |
Attachments | None None |
At least on osx you can launch jack with as many virtual channels as you want. I think there are two options, one for the physical channels and one for virtual channels. The option is in the setting dialogue of jack pilot. On 14 May 2014 23:38, Rory Walsh <rorywalsh@ear.ie> wrote: When I try to increase the number of channels in jack and start the |
Date | 2014-05-16 00:20 |
From | Rory Walsh |
Subject | Re: [Cs-dev] quick question, multi-channel |
Ah, so that's what the 'dummy' driver settings are for! Nice one. I'm sure that'll come in handy in the future. On 15 May 2014 08:22, peiman khosravi |