• Software
  • RE: Input and Biquad/QuadBiquad.h and Source...

ryjobil

Yes sir,

I will keep attempting the source learning. Also, I will try to build the preamp for the ADC connection.

Seth

P.S. I should have something done in the next couple of months. I am slow on building but things come together in the end. Thank you for supporting this channel. I appreciate your time a neat videos, i.e. esp. the vocoder playing.

ryjobil quick review of the code shows it starts in an active state

i was under the impression that the default was 'bypass = true'.
i should think that it therefore starts in bypass?

    Remork i was under the impression that the default was 'bypass = true'.
    i should think that it therefore starts in bypass?

    While it is true that make_klingon(...) will create a Klingon Tone initialized to bypass state, the specific sketch referenced sets it to active state when you start the sketch.

    See render.cpp, in function setup(...)

        //Bypass is the least intuitive function:
        // If second argument is true, it forces bypass state.
        // If second argument is false, it toggles bypass state.
        // The second call below is all that is needed after make_klingon(), since the constructor function
        // sets bypass state to true.  A call to kot_set_bypass(kot, false) would then toggle to active-state
        // since it is already initialized to bypass state (true).
        // However for clarity in the example it is explicitly set to true, then toggled to demonstrate the normal sequence when
        // the current bypass state is unknown.
        kot_set_bypass(kot, true);
        kot_set_bypass(kot, false);

    Notice I fixed the comment here, but haven't pushed a fix to the comment in the code, so you will see a discrepancy if you read this section of the code before I get around to fixing it.

      8 days later

      ryjobil ,

      Okay...things are settling down again (maybe). So, I looked throughout the over-the-1500 lines of code in render.cpp.

      I came up empty so far.

      ...

      I have not found exactly where this specific set of lines are located. Um, are you sure they are in render.cpp? And if they are in render.cpp, which setup (This_Or_That) function should I look to when looking for this specific set of calls.

      Seth

      P.S.

      bool kot_set_bypass(klingon* kot, bool bypass)
      {
      	if(!bypass)
      	{
      		if(kot->bypass)
      			kot->bypass = false;
      		else
              {
                  kot->bypass = true;
              }
      	}
      	else
      	{
      		kot->bypass = true;
      	}
      
      	return kot->bypass;
      }

      Is this it? I found this in klingon.cpp. Oh! Is it in this repo, https://github.com/transmogrifox/Bela_Misc, and not this one...https://github.com/transmogrifox/transmogriFX_bela?

      Hello Once More,

      ryjobil and Remork ...

      ...

      Um...hmm. I added the scripts to the folder in the form of a .zip file like stated in the instructions for using BELA.local.

      This section of .zip dropping worked but I am receiving an odd error:

      Makefile:153: *** Invalid/empty project. A project needs to have at least one .cpp or .c or .cc or _main.pd or _main.scd or _main.csd or run.sh file.  Stop.

      So, I was thinking that, I am solely guessing here, the Makefile in question here has limitations that I should overcome and quickly. Does this sound correct?

      Seth

      P.S. The Makefile is missing but I have not used a Makefile thus far from what I have understood. So, it is hidden maybe?

      Hello,

      I have narrowed the search for errors and came across only one error in my checking of things:

      /root/Bela/projects/Bela_Misc-master/build/specdense.o

      Seth

      P.S. It seems that specdense.o is not mentioned in my source files or I have to figure out a workaround. Either way, specdense.o may need to be different, i.e. spec_dense.o?

      Remork

      Hello...okay. I will try that idea. I used the .zip file instead of unzipping firstly.

      Seth

      P.S. It does not matter right now. My board is not booting. I need to put on a new image. I will update you all soon.

      
      
      make: *** No rule to make target '/root/Bela/projects/Bela_Misc-master/build/specdense.o', needed by 'syntax'.  Stop.
      make: *** No rule to make target '/root/Bela/projects/Bela_Misc-master/build/specdense.o', needed by 'syntax'.  Stop.
      Open file Bela_Misc-master build/PDM_digital_IO...
      Error: EISDIR: illegal operation on a directory, read,0, Error: EISDIR: illegal operation on a directory, read,0,Building project ...
      Build finished
      make: *** No rule to make target '/root/Bela/projects/Bela_Misc-master/build/specdense.o', needed by '/root/Bela/projects/Bela_Misc-master/Bela_Misc-master'.  Stop.
      make: *** No rule to make target '/root/Bela/projects/Bela_Misc-master/build/specdense.o', needed by '/root/Bela/projects/Bela_Misc-master/Bela_Misc-master'.  Stop.
      Open file Bela_Misc-master build/klingon_tone.cpp...
      Error: EISDIR: illegal operation on a directory, read,0, Error: EISDIR: illegal operation on a directory, read,0,Open file Bela_Misc-master build/klingon_tone.cpp...
      Error: EISDIR: illegal operation on a directory, read,0, Error: EISDIR: illegal operation on a directory, read,0,

      I am receiving the same error if I put in a .zip file or a set of unzipped files. Also, I am receiving the same specdense.o error that is needed (it seems). I keep looking over documentation and I cannot resolve this issue for now.

      It seems like the difficulty you are facing is related to getting started with Bela, understanding the way it is designed to be used. If my guess is correct, then below might help you get the code running.

      This first statement is to describe the assumption I am making about which Zip file you are talking about. The way to get a Zip file from the github repository I sent in a link is like this,
      https://github.com/transmogrifox/Bela_Misc
      ,then there will be an option "Code" and "Download Zip".

      Is that the Zip file to which you have made reference?

      If this is what you mean, then you may unzip this zip file you will have a directory structure of the repository, which looks like the corresponding github page -- within there are multiple directories each having a different sketch. Each one is its own Bela project and I am uncertain what Bela would do with the whole of Bela_Misc copied to a single project directory.

      You need a new project that includes all the .cpp, .h and .txt files you see here:
      https://github.com/transmogrifox/Bela_Misc/tree/master/klingon_tone

      This means on our PC you would browse to the kingon_tone directory under the unzipped Bela_Misc directory and upload those files to a new project from the Bela IDE, like below.

      1) Download Bela_Misc repository zip from https://github.com/transmogrifox/Bela_Misc
      2) Extract zip to your PC
      3) Open web browser to Bela IDE -> create new project, name it whatever you want
      4) Delete the default (auto-generated) render.cpp
      5) Use menu option to upload project files
      6) Browse to extracted zip directory, klingon_tone
      7) Upload all .cpp, .h, .txt files from directory klingon_tone to this new project directory
      8) Build and run
      9) If 8 works, then you can modify code using the IDE editor to observe how it may change the sound, and/or adjust project settings in the IDE (e.g AGC gain, DAC gain). Defaults will be ok for testing basic compilation and verify sound has changed.

      If you have more experience with Bela, there are more elegant ways you can learn to copy the code to the correct place The above method is one way that is easy to explain, and it works.

        ryjobil Each one is its own Bela project and I am uncertain what Bela would do with the whole of Bela_Misc copied to a single project directory.

        it would place them all in the same project and fail gloriously at link time with multiple duplicate symbols!

          giuliomoro and ryjobil ,

          Okay...so:

          Do not install the complete unzipped or zipped directories and files at once

          and...

          Use one directory at a time

          Now, I will attempt this idea. I was just installing the complete BELA_Misc unzipped file in its entirety.

          Seth

          P.S. I will get back to you after installing the single directory and see what happens.

          ryjobil 1) Download Bela_Misc repository zip from https://github.com/transmogrifox/Bela_Misc
          2) Extract zip to your PC
          3) Open web browser to Bela IDE -> create new project, name it whatever you want
          4) Delete the default (auto-generated) render.cpp
          5) Use menu option to upload project files
          6) Browse to extracted zip directory, klingon_tone
          7) Upload all .cpp, .h, .txt files from directory klingon_tone to this new project directory
          8) Build and run
          9) If 8 works, then you can modify code using the IDE editor to observe how it may change the sound, and/or adjust project settings in the IDE (e.g AGC gain, DAC gain). Defaults will be ok for testing basic compilation and verify sound has changed.

          I will attempt this idea too!

          Seth

          ryjobil

          Hello,

          I am sorry. You are right about me being too new w/ .cpp and BELA as of now. I tried your 1 - 9 instructions.

          I received this error:

          Your code is printing to the console too quickly. Check your audio thread for print messages.

          Seth

          P.S. Please let me know if you know of a workaround or if you think I have completed 1 - 9 incorrectly.

            silver2row Your code is printing to the console too quickly. Check your audio thread for print messages.

            Getting this message confirms you followed the instructions correctly, the code compiled and it is running. The message is a side-effect of not having any pots connected to analog inputs. The application prints each time it detects the pot gets turned. When there is nothing connected to the input, the noise appears as if the pot is constantly being turned back and forth from one extreme to the other faster than a human could ever turn it, and it prints more messages than Bela can keep up with.

            Below shows how to disable reading the pots when nothing is connected to the Analog Inputs:

            In render.cpp:

            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 lines as shown below

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

            The remainder of this function posted to help you see where the commented line is found, but you don't need to change anything else below.

                //Run the klingon on ch0
                klingon_tick(kot, ch0);
            
                //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]);
                }
            }

            Once that is working, then you can make modifications to the code I gave previously for making the effect more extreme.

              ryjobil

              Hello...okay. I will test this soon. Thank you.

              Seth

              P.S. I will return service shortly! Okay...I tried the commenting of the source in question:

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



              Same issue...

              format_analog_buffer(context, kp[i]) is the only function running in the audio thread with print functions. If it is commented out in the code you are compiling you won't have that error.

              Close the project, re-open it and see if the commented lines were saved. If not, try again.

                ryjobil

                Okay...I tried to comment out the rt_printf statements w/ // .

                Seth

                P.S. I will try again and again and again. Until! Eureka, it has been done! Please give me time, i.e. as I have only commented the rt_printf statements in the source so far. I will comment out all of the functions for the rt_printf statements.

                I tried and this is the return output I get:

                6410.000000	-4.893197	0.000000
                6420.000000	-4.893508	0.000000
                Your code is printing to the console too quickly. Check your audio thread for print messages.

                  ryjobil Close the project, re-open it and see if the commented lines were saved. If not, try again.

                  Hopefully we got rid of that bug years ago 🙂

                  silver2row I tried and this is the return output I get:
                  This output is helpful. Thanks for posting it.

                  Delete the file test_tonestack.cpp It is the only code in the directory that can generate an output formatted like that, and with those numbers. This is a file that I should have put into the "analysis" directory because it's an offline test utility for the tonestack code, but was not meant to be executed in real time. Sorry about that.

                  @giuliomoro it is noteworthy that Bela seems to be compiling and executing that program without generating an error (except too many print statements at runtime).

                    ryjobil

                    Hello Sir,

                    Yes sir...erasing on the way. test_tonestack.cpp will be removed. Thank you for the info.

                    Seth

                    CPU  PID    MSW        CSW        XSC        PF    STAT       %CPU  NAME
                      0  0      0          413393     0          0     00018000   89.0  [ROOT]
                      0  761    3          3          8          0     000600c0    0.0  Klingon_Tone
                      0  771    1          413390     413392     0     00048046    9.2  bela-audio
                      0  0      0          224671     0          0     00000000    0.7  [IRQ16: [timer]]
                      0  0      0          206726     0          0     00000000    0.7  [IRQ21: rtdm_pruss_irq_irq]

                    Okay...so that is the output. Nothing changes in the form of output from the input of the guitar to the BELA input to the output of BELA to the amplifier. I know you guys do not have unlimited time. If there is something you think I am missing, please reply.