• SoftwareC/C++
  • Hello and Am I Using the BELA IDE w/ BELA Incorrectly?

Hello,

Okay...so it is me or me here. I have a regular amplifier, a couple of wires to and from the BELA, and an instrument with some source.

The source runs but the sounds of the instrument have not changed.

I think I am performing the connections, the physical connections, incorrectly...

The input on BELA is from the violin. The output on BELA goes to the amplifier. I can here sound from the amplifier but it seems to just pass through from the violin to the amplifier.

Seth

P.S. I think I am missing something.

what code do you want to run?
and have you tried hitting the 'build and run' button on the IDE?

    Hello Remork ,

    I see my source from the link you posted did not show up in my last post. I built and ran the source while thoughtfully plugged in via the BELA Output and Input.

    Seth

    P.S. I tried this one: https://github.com/transmogrifox/transmogriFX_bela/blob/master/src/klingon.cpp.

    Also, I tried the render.cpp file from the transmogriFX_bela/blog/master/src/ directory. I clicked the radio button online on the IDE. Everything built fine after some fine tuning. I think I even tried multiple, different .cpp files but to no such luck on me getting it to work w/ sounds of Klingon...

    Remork ,

    Hello Again...I have seen BELA work. I am not discrediting the BELA platform and the capabilities it holds.

    I am a bit confused actually. Input in my mind means where I would place the incoming signal of something to be altered, the violin strings being 'strummed' or bowed, and the Output as what exchange the source has made on the Input, i.e. from the BELA Output to the amplifier. Oh! Would I need to power the BBB w/ a dedicated 5v supply from a wall adapter?

    I actually have thought of this plugging-in-a-wall-wart but have not done so yet.

    Seth

    i'm actually not at all sure if i'm the right pseron to help you with this - like i said, my C++ is not too good.
    i do feel there's a lot of info missing on how you are trying this.
    you have the input and output idea correct, that's a start.
    are you using any external potentiometers and switches?
    and if not, did you see that there's a variable in the code that sets the effect to 'OFF' at startup?
    normally you would hook up a switch to turn it on.
    have you tried changing that variable to 'bypass = false' if you are running it without external pots or switches?

    this may be totally obvious and a waste of your time, but need more info

      Remork

      Hello...no pots or switches yet. I am using the source as is as of now.

      ...

      I will look more closely at what I am doing in time. Thank you for pointing out ideas. See, I was just thinking the source as ran would just create the new sound(s).

      Anyway, no issue. Thank you for helping me thus far w/ ideas. I talked/chatted w/ another person about his source from the BELA ideas. He is thinking I may need a preamp and offered a schematic on the preamp to build.

      Seth

      P.S. So, I will be attempting to build this circuit soon so I can test his/BELA's vocoder ideas.

      the source will create new sounds (distortion, in this case), if you tell it to do so.
      that means turning it on.
      whether or not you use a preamp is irrelevant if you're not turning the effect on. 🙂

      in klingon.cpp, early on in the code, there's a section that goes

      // Set defaults
      kot->gain = 50.0;
      kot->tone = 0.5; // Not used -- initialized in tonestack
      kot->hard = 0.0;
      kot->level = 0.5;
      kot->bypass = true;

      if you're not using pots you can set the variables there. and as you can see, it's in bypass by default.
      try changing that last line to kot->bypass = false;
      instead.

        Remork

        Hello...thank you for stating this fact. I will attempt that idea.

        Seth

        P.S. Okay! I will do it. I will reply and learn more by the time I reply.

        4 days later

        @silver2row First make certain the input level for your violin is using up most of the full-scale input. For example, if you have a weak pickup plugged directly to the audio input then maybe the input signal is weak enough that the Klingon Tone just sounds like a mostly linear amplifier rather than a distortion pedal.

        Another possibility is related to what input channel the instrument is connected. If using the sketch as-is using with the render.cpp provided it starts the sketch in active (non-bypassed) state during calls made in setup(), so the effect is probably active unless an unconnected input causes it to toggle after setup.

        It runs the effect only on Channel 0 though, and pass-through on Channel 1 so that might be an issue. If your violin is connected to the pass-through channel, then you can switch to the other input and see if you can hear a difference.

        Here's a way you can disable the possibility of unintended settings changes from floating (unconnected) analog input channels:

        void render(BelaContext *context, void *userData)
        {
            //separate audio inputs into their own buffers
            format_audio_buffer(context, ch1, 1);
            format_audio_buffer(context, ch0, 0);

        Comment these two lines as shown below when no knobs or switches are connected:

            //Scan analog inputs and set settings
            //for(int i = 0; i < N_KNOBS; i++)
                //format_analog_buffer(context, kp[i]);

        Here we see it only runs on ch0

            //Run the klingon on ch0
            klingon_tick(kot, ch0);

        Then see below, ch0 output gets klingon output while output to ch1 just gets the input from ch1.

            //Send it to the output
            for(unsigned int n = 0; n < context->audioFrames; n++)
            {
                // Write klingon through ch0, pass-through ch1
                audioWrite(context, n, 0, ch0[n]);
                audioWrite(context, n, 1, ch1[n]);
            }
        }

        Finally, if you need to make the effect more extreme, I would encourage you to add calls to the settings helper functions from within render.cpp rather than trying to change them in the klingon.cpp file.

        For example in render.cpp, you can add these to the end of setup()

        bool setup(BelaContext *context, void *userData)
        {
        .
        .
        .
        kot_set_drive(kot, 60.0);  //set drive gain to 60dB
        kot_set_mix(kot,1.0);  //maximum hard clipping 
        kot_set_tone(kot, 0.0 );  //Change value between -60.0 to 0.0 for more high/low emphasis
        }

        As a final note, klingon tone emulates a distortion pedal. You might need these final settings changes because it can take quite a lot of distortion to make a violin sound badly distorted. The defaults are set for a nice blues guitar crunch assuming nearly full-range signal input. This default (which sounds good on electric guitar) might simply preserve enough of the natural sound that even though it's making a difference, it is possible the change is too subtle to notice. Changing some of these settings in setup() will make more extreme sounds that you will hear.

          ryjobil ,

          Thank you sir. I will attempt these ideas soon. I have been making headway on the Linux SDK for making the DSPs and IPUs on the BBAI work, i.e. well, until recently.

          I am back using the BELA platform/Cape again. I will attempt this set of examples and change out the setup() files and not the .cpp file from the repo.

          Seth