ArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArrayArray BrainModular BrainModular Users Forum 2015-05-01T19:13:17+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/4883 2015-05-01T19:13:17+02:00 2015-05-01T19:13:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32592#p32592 <![CDATA[totally lost with audio !]]>
I am totally lost (again) with this github

can't sort out how to upload files.

here they are :
http://we.tl/TE4MLuahoY

Statistics: Posted by oli_lab — 01 May 2015, 19:13


]]>
2015-05-01T16:32:32+02:00 2015-05-01T16:32:32+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32588#p32588 <![CDATA[totally lost with audio !]]>
were these also in the file you uploaded for the Grove?

This weekend I am going to be compiling OS X versions of all the modules :)

Statistics: Posted by ceasless — 01 May 2015, 16:32


]]>
2015-04-30T03:26:34+02:00 2015-04-30T03:26:34+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32579#p32579 <![CDATA[totally lost with audio !]]> Statistics: Posted by Clearscreen — 30 Apr 2015, 03:26


]]>
2015-04-30T00:13:17+02:00 2015-04-30T00:13:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32578#p32578 <![CDATA[totally lost with audio !]]> Statistics: Posted by oli_lab — 30 Apr 2015, 00:13


]]>
2015-04-29T20:08:05+02:00 2015-04-29T20:08:05+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32576#p32576 <![CDATA[totally lost with audio !]]>
Unless there is something I'm missing (and I've gotten used to that ;) ).

The rest of the for-loop construct looks solid.

Statistics: Posted by ceasless — 29 Apr 2015, 20:08


]]>
2015-04-29T16:03:51+02:00 2015-04-29T16:03:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32574#p32574 <![CDATA[totally lost with audio !]]> Statistics: Posted by oli_lab — 29 Apr 2015, 16:03


]]>
2015-04-29T00:38:28+02:00 2015-04-29T00:38:28+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32566#p32566 <![CDATA[totally lost with audio !]]> but if got 4 channels with differents audio content, have to check volumes and process so that they got their own processing, thus the array stuff if i well understood.

Statistics: Posted by 23fx23 — 29 Apr 2015, 00:38


]]>
2015-04-28T15:39:31+02:00 2015-04-28T15:39:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32548#p32548 <![CDATA[totally lost with audio !]]> " could be as well a "tempValue" if I understand right

Statistics: Posted by oli_lab — 28 Apr 2015, 15:39


]]>
2015-04-27T12:56:29+02:00 2015-04-27T12:56:29+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32524#p32524 <![CDATA[totally lost with audio !]]> I'm not lost anymore.

I'll try that tonite !

Olivar

Statistics: Posted by oli_lab — 27 Apr 2015, 12:56


]]>
2015-04-27T11:07:59+02:00 2015-04-27T11:07:59+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32523#p32523 <![CDATA[totally lost with audio !]]>
from the code you posted, you appli the soft clipping formula only to the first sample of each output sample block.
//y = x / (1 + | x | ) softclipping formula
tempValue = sdkGetEvtData(audioOutputs) / (1 + abs(sdkGetEvtData(audioOutputs)));
sdkSetEvtData(audioOutputs, tempValue);

remember that an audio parameter contain the whole block of sample corresponding to the audio tick for this process call, so it's literally an array of size = usineblock.

the simplest implementation is to add a for loop to apply your softclipping algo to each samples

something like this (not tested)

CODE:

void AudioVolumeExample&#58;&#58;onProcess &#40;&#41;&#123;    tempValue    for &#40;int i = 0; i < numOfAudiotInsOuts; i++&#41;    &#123;        sdkCopyEvt &#40;audioInputs&#91;i&#93;, audioOutputs&#91;i&#93;&#41;;        sdkMultEvt1 &#40;coeffGain, audioOutputs&#91;i&#93;&#41;;                //y = x / &#40;1 + | x | &#41;  softclipping formula        for &#40;int j = 0; j < sdkGetEvtSize&#40;audioOutputs&#91;i&#93;&#41;; j++&#41;        &#123;            tempValue&#91;i&#93; = sdkGetEvtArrayData&#40;audioOutputs&#91;i&#93;, j&#41; / &#40;1 + abs&#40;sdkGetEvtArrayData&#40;audioOutputs&#91;i&#93;, j&#41;&#41;&#41;;            sdkSetEvtArrayData&#40;audioOutputs&#91;i&#93;, j, tempValue&#91;i&#93;&#41;;        &#125;    &#125;&#125;

Statistics: Posted by martignasse — 27 Apr 2015, 11:07


]]>
2015-04-26T21:22:28+02:00 2015-04-26T21:22:28+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32514#p32514 <![CDATA[totally lost with audio !]]> but "Don't Process = FALSE" by default so its not that...

can't wait it's working : I prepared a supaBooster with softclipping, another with hard insane clipping and a DC blocker, but still this problem with TPrecision...

Statistics: Posted by oli_lab — 26 Apr 2015, 21:22


]]>
2015-04-26T19:10:12+02:00 2015-04-26T19:10:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32512#p32512 <![CDATA[totally lost with audio !]]> Statistics: Posted by 23fx23 — 26 Apr 2015, 19:10


]]>
2015-04-26T18:15:44+02:00 2015-04-26T18:15:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32511#p32511 <![CDATA[totally lost with audio !]]>
I'm trying to get my hands dirty with audio modules...

for a start, I wanted to start easy : an audio volume module with lots of gain followed by a soft clip algorithm...

but even if the module compiles OK, it sounds as if audio is going at modulation rate instead of audio rate.

I'm sure it is not that complicated to sort it out as I must have miss something, but what ???

looks like it is the "TPrecision" that is the problem

here the interesting bits

supabooster.h

private:
//-------------------------------------------------------------------------
// parameters events
UsineEventPtr audioInputs[AUDIO_INS_OUTS_MAX]; // audio input
UsineEventPtr audioOutputs[AUDIO_INS_OUTS_MAX]; // audio output
UsineEventPtr fdrGain;
UsineEventPtr switchMute;
TPrecision tempValue[AUDIO_INS_OUTS_MAX];

//-------------------------------------------------------------------------
static const int numOfParamAfterAudiotInOut = 2;

int queryIndex;
int numOfAudiotInsOuts;

////////////////////////////////////////////////

supabooster.cpp

void AudioVolumeExample::onProcess ()
{
for (int i = 0; i < numOfAudiotInsOuts; i++)
{
sdkCopyEvt (audioInputs, audioOutputs);
sdkMultEvt1 (coeffGain, audioOutputs);

//y = x / (1 + | x | ) softclipping formula
tempValue = sdkGetEvtData(audioOutputs) / (1 + abs(sdkGetEvtData(audioOutputs)));
sdkSetEvtData(audioOutputs, tempValue);

////////////////////////////////////////////////////////

also, is the audio values are between -1 and 1 ?

thanks for your help

Olivar

Statistics: Posted by oli_lab — 26 Apr 2015, 18:15


]]>
BrainModular BrainModular Users Forum 2015-05-01T19:13:17+02:00 https://www.brainmodular.com/forums/app.php/feed/topic/4883 2015-05-01T19:13:17+02:00 2015-05-01T19:13:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32592#p32592 <![CDATA[totally lost with audio !]]>
I am totally lost (again) with this github

can't sort out how to upload files.

here they are :
http://we.tl/TE4MLuahoY

Statistics: Posted by oli_lab — 01 May 2015, 19:13


]]>
2015-05-01T16:32:32+02:00 2015-05-01T16:32:32+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32588#p32588 <![CDATA[totally lost with audio !]]>
were these also in the file you uploaded for the Grove?

This weekend I am going to be compiling OS X versions of all the modules :)

Statistics: Posted by ceasless — 01 May 2015, 16:32


]]>
2015-04-30T03:26:34+02:00 2015-04-30T03:26:34+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32579#p32579 <![CDATA[totally lost with audio !]]> Statistics: Posted by Clearscreen — 30 Apr 2015, 03:26


]]>
2015-04-30T00:13:17+02:00 2015-04-30T00:13:17+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32578#p32578 <![CDATA[totally lost with audio !]]> Statistics: Posted by oli_lab — 30 Apr 2015, 00:13


]]>
2015-04-29T20:08:05+02:00 2015-04-29T20:08:05+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32576#p32576 <![CDATA[totally lost with audio !]]>
Unless there is something I'm missing (and I've gotten used to that ;) ).

The rest of the for-loop construct looks solid.

Statistics: Posted by ceasless — 29 Apr 2015, 20:08


]]>
2015-04-29T16:03:51+02:00 2015-04-29T16:03:51+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32574#p32574 <![CDATA[totally lost with audio !]]> Statistics: Posted by oli_lab — 29 Apr 2015, 16:03


]]>
2015-04-29T00:38:28+02:00 2015-04-29T00:38:28+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32566#p32566 <![CDATA[totally lost with audio !]]> but if got 4 channels with differents audio content, have to check volumes and process so that they got their own processing, thus the array stuff if i well understood.

Statistics: Posted by 23fx23 — 29 Apr 2015, 00:38


]]>
2015-04-28T15:39:31+02:00 2015-04-28T15:39:31+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32548#p32548 <![CDATA[totally lost with audio !]]> " could be as well a "tempValue" if I understand right

Statistics: Posted by oli_lab — 28 Apr 2015, 15:39


]]>
2015-04-27T12:56:29+02:00 2015-04-27T12:56:29+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32524#p32524 <![CDATA[totally lost with audio !]]> I'm not lost anymore.

I'll try that tonite !

Olivar

Statistics: Posted by oli_lab — 27 Apr 2015, 12:56


]]>
2015-04-27T11:07:59+02:00 2015-04-27T11:07:59+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32523#p32523 <![CDATA[totally lost with audio !]]>
from the code you posted, you appli the soft clipping formula only to the first sample of each output sample block.
//y = x / (1 + | x | ) softclipping formula
tempValue = sdkGetEvtData(audioOutputs) / (1 + abs(sdkGetEvtData(audioOutputs)));
sdkSetEvtData(audioOutputs, tempValue);

remember that an audio parameter contain the whole block of sample corresponding to the audio tick for this process call, so it's literally an array of size = usineblock.

the simplest implementation is to add a for loop to apply your softclipping algo to each samples

something like this (not tested)

CODE:

void AudioVolumeExample&#58;&#58;onProcess &#40;&#41;&#123;    tempValue    for &#40;int i = 0; i < numOfAudiotInsOuts; i++&#41;    &#123;        sdkCopyEvt &#40;audioInputs&#91;i&#93;, audioOutputs&#91;i&#93;&#41;;        sdkMultEvt1 &#40;coeffGain, audioOutputs&#91;i&#93;&#41;;                //y = x / &#40;1 + | x | &#41;  softclipping formula        for &#40;int j = 0; j < sdkGetEvtSize&#40;audioOutputs&#91;i&#93;&#41;; j++&#41;        &#123;            tempValue&#91;i&#93; = sdkGetEvtArrayData&#40;audioOutputs&#91;i&#93;, j&#41; / &#40;1 + abs&#40;sdkGetEvtArrayData&#40;audioOutputs&#91;i&#93;, j&#41;&#41;&#41;;            sdkSetEvtArrayData&#40;audioOutputs&#91;i&#93;, j, tempValue&#91;i&#93;&#41;;        &#125;    &#125;&#125;

Statistics: Posted by martignasse — 27 Apr 2015, 11:07


]]>
2015-04-26T21:22:28+02:00 2015-04-26T21:22:28+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32514#p32514 <![CDATA[totally lost with audio !]]> but "Don't Process = FALSE" by default so its not that...

can't wait it's working : I prepared a supaBooster with softclipping, another with hard insane clipping and a DC blocker, but still this problem with TPrecision...

Statistics: Posted by oli_lab — 26 Apr 2015, 21:22


]]>
2015-04-26T19:10:12+02:00 2015-04-26T19:10:12+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32512#p32512 <![CDATA[totally lost with audio !]]> Statistics: Posted by 23fx23 — 26 Apr 2015, 19:10


]]>
2015-04-26T18:15:44+02:00 2015-04-26T18:15:44+02:00 https://www.brainmodular.com/forums/viewtopic.php?t=4883&p=32511#p32511 <![CDATA[totally lost with audio !]]>
I'm trying to get my hands dirty with audio modules...

for a start, I wanted to start easy : an audio volume module with lots of gain followed by a soft clip algorithm...

but even if the module compiles OK, it sounds as if audio is going at modulation rate instead of audio rate.

I'm sure it is not that complicated to sort it out as I must have miss something, but what ???

looks like it is the "TPrecision" that is the problem

here the interesting bits

supabooster.h

private:
//-------------------------------------------------------------------------
// parameters events
UsineEventPtr audioInputs[AUDIO_INS_OUTS_MAX]; // audio input
UsineEventPtr audioOutputs[AUDIO_INS_OUTS_MAX]; // audio output
UsineEventPtr fdrGain;
UsineEventPtr switchMute;
TPrecision tempValue[AUDIO_INS_OUTS_MAX];

//-------------------------------------------------------------------------
static const int numOfParamAfterAudiotInOut = 2;

int queryIndex;
int numOfAudiotInsOuts;

////////////////////////////////////////////////

supabooster.cpp

void AudioVolumeExample::onProcess ()
{
for (int i = 0; i < numOfAudiotInsOuts; i++)
{
sdkCopyEvt (audioInputs, audioOutputs);
sdkMultEvt1 (coeffGain, audioOutputs);

//y = x / (1 + | x | ) softclipping formula
tempValue = sdkGetEvtData(audioOutputs) / (1 + abs(sdkGetEvtData(audioOutputs)));
sdkSetEvtData(audioOutputs, tempValue);

////////////////////////////////////////////////////////

also, is the audio values are between -1 and 1 ?

thanks for your help

Olivar

Statistics: Posted by oli_lab — 26 Apr 2015, 18:15


]]>