Cabbage Logo
Back to Cabbage Site

Feedback seems to be occurring in code. Can't spot the issue

Hi folks.

If I was to pm my code, would any kind soul be willing to take a quick look at my code and suggest why I’m getting a continuous feedback tone?

This should be easy enough to spot, maybe even glaringly obvious, so I’m putting it in the ‘Noobs’ section (I’m fairly tired;)

One thing to note is that I get a continual audio overload signal coming in no matter what input I select in Cabbage’s audio settings… visible in the pic below:

Many thanks.

I have used an if statement to switch of the instrument after stop is clicked. So that has sorted it for the time being.

You can attach the code to a post or a reply, just click the button that looks like a box with an arrow pointed upwards (says “Upload” when you mouse-over it).

I’m sure someone will eventually take a look at it, everyone seems really helpful around here.

Is this on a laptop? The inbuilt mic often picks up the laptop speakers which is a common cause of feedback. If you do need live input and you are working with a laptop, I suggest ear phones. Just attach some reduced code that demonstrates the problem and we can see what the issue is.

Yeah it’s a laptop, more than likely it’s an error with my code and not the mic. I’ll tidy the code up and post what I mean as soon as I can. As I said, I have switched the buzzing off anyways for the time being, with an if statement. Would be nice to find out the issue though.

How many inputs of audio can Cabbage take in?

I have an aggregate set up with 4 or more ins but I only seem to be able to select one pair of ins at a time in the settings. I guess 2 is the maximum?

Thanks.

Martin

Are you running the audio inside a DAW or in standalone mode? In standalone mode it only works with stereo IOs. But I’ve just made some changes to allow plugins to run with 4 stereo IOs. I’ll have to update he OSX installer so it includes this latest feature. I will try to sort out the standalone player too, but in the mean time if you run your instrument as a plugin it will work fine.

I’m running cabbage on it’s own without a DAW. Thanks for the info.

Combining diskin and external audio in one channel.csd (2.8 KB)

Here is the code in question. I have included as much of it that I think might be relevant to solving the buzzing issue.
It is basically one channel of a Cabbage mixer I’m working on.
The feedback was stopped for the time being using the if statement on line 76:

if gkPlayStop1==0 then
gaDiskinPlusExternalIn = 0
endif

When the above code is absent the loud buzzing is always on.

Also, while I’m at it, I’m trying to implement a combo box (I’m using a checkbox for the time being to simplify things) to select whether the channel allows in audio from either the diskin file player or the external input (coming from soundflower in this case) before going to the EQ . When one box is ticked I want the other to be switched off. I have tried many variations of if/else/skip/goto etc etc but nothing has worked.

At the minute I have summed both the diskin player input and the external input on line 74, which makes things even more awkward, though if only one or the other was allowed in at any one time this summing would be fine was my thinking. I was purely trying to get audio in from both somehow, so I’m sure there’s a better way.

On line 23 you can see one such example of an attempt to switch off the diskin instrument if the check box is checked. This has no effect. I have tried many more conditions within the ‘channel 1’ instrument also that I have since deleted.

I hope I have made some sense here. Any tips here would be much appreciated.

Thanks!

M

It would be easier to see the full thing, unless you can reproduce it with a smaller working Cabbage .csd file.

Receiver If Issues.csd (16.1 KB)

Here’s the full code from the receiving file.

Thanks for taking a look:)

You need to take out the

-iadc2 -odac0 -B512 -b128

Cabbage looks after all the audio and MIDI IO. Passing these as CsOptions causes both Cabbage and Csound to output sound simultaneously. That’s never a good idea.

Okay. Noted. Thanks for that. I was noticing some doubling up of the sound and I thought it was due to my messy signal flow in the code… but it seems a little better now and maybe that was the issue.

Thanks again Rory!

No problem. Just be careful when you are transferring over and back between native Csound files and Cabbage ones. You’ll generally want to remove the native .csd file’s CsOptions as they may conflict with Cabbage’s own settings.

1 Like