I don't have a video yet, but here's a project that implements a modulated delay line, ready to go, sounds pretty good.
http://cackleberrypines.net/transmogrifox/src/bela/

I'll keep link to most current updated in this top post:
http://cackleberrypines.net/transmogrifox/src/bela/15_MultiDelay_29_June_2017.zip

I have a lot of work I want to do because this is just one small part of my goal to make a mult-FX box. This delay line will cover chorus, flange, echo, and other weird time stuff. Planning to add wah, phaser, pitch shifter, my Infinity effect from Rakarack...and the list goes on.

Probably next I will be working on presets.

Just thought I would share as I go along in case anybody wants to play with it.

Here's some audio -- just twisting knobs and jamming.
http://cackleberrypines.net/transmogrifox/src/bela/bela_demo-cut.mp3

It was recorded from my camera aimed at the bela and video was too dark to see me twisting knobs or anything at all interesting so I just stripped out the audio and cut some 12 minutes down to about 6 minutes....anyway the audio recording quality isn't the best, but it gets the idea across that Bela has a lot of potential for the guitar player.

Points of interest for those who want to skip to the point and avoid aimless jamming:
0:48 Stomped drive channel on amp and set modulation depth somewhat extreme for an interesting warble.
1:30 Adjusted to be a flanger
2:00 More chorus-like sounds
2:50 much deeper chorus
3:05 more strumming deeper chorus
3:25 staccato delay sounds
4:25 change in jam
4:40 out-of-control feedback
5:00 More modulation on the delay line
5:47 change of jam theme

The hardware platform is an aluminum experimentation box I had a local welder build for me 10 years ago for an analog state variable filter effect I made. Has 9 pots and currently 3 switches, but enough real-estate to have probably up to 9 stomp switches spaced at usable distances. The box fortuitously made a perfect home for Bela and Bela can be made to do more than racks of analog circuits.

a month later

Here's finally a video of the thing. I have added quite a bit of stuff:

-Switch debouncing
-Analog input control context switching
-Improvements to modulated delay line
-A good selection of LFO shapes

Effects currently implemented

-Chorus
-Flanger
-Delay

Envelope (dynamic) control of every effect parameter (except delay damping parameter isn't implemented yet).

Here's the current project zip file:
http://cackleberrypines.net/transmogrifox/src/bela/05_MultiDelay_16_Mar_2017.zip

Lots of useful goodies in there. The LFO functions are actually general-purpose oscillators so good for more than only LFO use.

I'm keeping it to C-style programming but it's implemented in a manner that wouldn't be hard to change into classes.

Under the following development cycle, this is in the "make it work" stage of development:

-Make it work
-Make it good (robust against bugs and undesirable/ungraceful operation)
-Make it fast

Here's a video showing off echo (delay) and flanger and the chorus was briefly turned on. Will get a better video some other time, but this is something for now. There is audible distortion as well as the dynamic range compression applied by the camera audio input. Just a disclaimer that audio recording quality is at fault for distortion and low quality audio artefacts. Bela sounds pristine and beautiful to ears located in the same room 🙂

@giuliomoro thanks for adding the plugin. That appears to have worked effortlessly as advertised 😉

Thanks for sharing this, sounds great, though it makes me a bit seasick when your delay affects the pitch 😛

What's the ethernet cable for? How do you power the unit? That is a funny case! How many of the pots did you connect? Did you add a high-impedance buffer in front of Bela's input? Or do you drive the guitar through a non-true-bypass pedal before hand?

I cannot find a way to embed the video as you suggest (nor a way for flarum to allow arbitrary HTML). Yet, I just added a plugin that allows to embed videos from popular sites (e.g.: youtube) just by using a link to the video, so if you move your video to a video hosting service, you should be able to embed it effortlessly.

    Thanks. I'll move it to YouTube and see if I can get it to embed that way.

    giuliomoro What's the ethernet cable for?

    There is a metal tab on the front of the case that doesn't allow enough clearance for the USB cable. I was too lazy to disassemble everything when I discovered this so I started drilling the metal tab with Bela inside. As sound judgment would have told me, the drill slipped when it got through the metal and the bit tore off the USB connector. Now I have to use Ethernet to connect to Bela. I haven't inspected it closely enough to determine whether the USB connector tore up traces so I'm still holding onto hope I can repair it. For now I'm glad the BBB has a LAN port and that it is default configured for DHCP to obtain an IP address from my router.

    How do you power the unit?

    Currently I have a 5V wall-wart that I hacked from a cell phone charger or something. Not having a compatible jack I just stripped the wires and soldered them to the bottom of the Beagle board.

    That is a funny case! How many of the pots did you connect?

    The funny case is my experimentation chassis that I have had for years. It used to be a crazy analog envelope filter that I had disassembled to clean up, but then I never finished re-wiring and it sat in my junk box for years. It makes a really nice home for R&D on Bela.

    I have 8 of the pots connected but my current code uses a maximum of 7. I have it in my mind to reserve at least 1 analog input for the purpose of being able to connect external modulation sources. I have one plan to inject noise from a digital output through a resistor to the output of a Crybaby type wah then T that back into the Analog Input (AC-coupled). My circuit simulations indicate I can use the output impedance of the wah to get a spectral noise power density profile that I can process in software so the standard wah can be used as an expression pedal simply by connecting the output to Bela.

    I'm trying to decide whether I want to claim 1 more analog input for a voice channel for a vocoder, or whether to simply dual-purpose the 1 analog input. The other pots will be used for external analog pre and post-amps (input level & output level adjustment).

    Did you add a high-impedance buffer in front of Bela's input? Or do you drive the guitar through a non-true-bypass pedal before hand?

    A high-impedance buffer is on my todo list, but currently it's being driven through my amp's effects loop, so it's being driven by a relatively low-impedance source in the video. I have also connected directly to Bela input from my guitar and, as you observed in another thread, it sounds fine. I can detect the change of sound of my guitar somewhat but it's pretty subtle.

    giuliomoro though it makes me a bit seasick when your delay affects the pitch

    My wife thinks the same thing. It was a more extreme way of demonstrating envelope control on the LFO rate. It sounds more like a chorus effect when adjusted to sane amounts and the envelope pitch control helps it sound less mechanical.

    ...or if you're talking about the more extreme pitch change where the envelope was effecting delay time directly, this again can sound very pleasant when less extreme settings are used.

    a month later

    Nice one, I finally made a phase-vocoder based time freezer, inspired to a variety of Electro-Harmonix effects.
    We'd like to have a library of effects among the examples, these should be mostly about the DSP and as less as possible about interfacing with it, with a clear interface so that they can be easily re-used by others as building blocks.
    It is going to be challenging to find the appropriate format, though, and my TimeFreezer, for one, is nowhere close to these specs as of now, but if anyone is interested in contributing or pitch in as to what format it should have, feel free to do so.

    I will open a dedicated thread later, but I am leaving this as food for thought ...

    I will check out the time freezer. That looks like fun 🙂 Looking forward to your new thread.

    A lot of work required to get it prepared, but I have thought how nice it would be to have a standard plugin host on Bela. Then the standard format for dedicated effects would be compatible with whatever standard is selected.

    For example, LV2, LADSPA, VST. Another would be to make the interface compatible with the Hoxton OWL so patches can be easily exchange between the OWL and Bela...

    Then the GUI/Control interface would be implemented in the web interface so you can manipulate the plugins through a device like a tablet through Wi-Fi (for example).

    More food for thought...

    I had some success in porting Jalv (jack lv2 host) to Bela: https://github.com/giuliomoro/jalv

    I do not know much at all about LV2, they just seem to have a very complicated interface and metadata structure, probably a bit overkill for our purposes, but I am also against re-inventing the wheel and pro embracing existing wide-spread solutions.

    a month later

    Having more fun with Bela & guitar multi-FX
    State Variable Filter + Sample/Hold + ADSR:

    Some of the bits and pieces of code are here, but I haven't uploaded the project yet (some work left to tie in the controls to ADSR and sample/hold effect parameters). There are a lot of unexposed modes and possibilities:
    http://cackleberrypines.net/transmogrifox/src/bela/misc/
    http://cackleberrypines.net/transmogrifox/src/bela/misc/sample_hold_modulator_with_adsr/
    http://cackleberrypines.net/transmogrifox/src/bela/state_variable_filter/

    The state variable filter is a double-samplerate filter with some distortion. It's actually very pleasantly "mooshy" sounding like some kind of analog synth filter.

    Here is an ADSR waveform plot that I generated for verification of the state machine logic:

    Interesting, by "double-samplerate" do you mean that it is oversampled 2x ? Does it sound much better than without oversampling?

    Yes, it is oversampled in a "cheap" way suggested by Nigel Redmon:
    http://www.earlevel.com/main/2003/03/02/the-digital-state-variable-filter/

    I doubt that it sounds much better at the frequency range over which it is stable, but apparently it is unstable above ~fs/6, so at fs=44.1k that would mean it shouldn't be used for fc > 7.4 kHz. Oversampling 2x makes it more accurate at the higher frequency ranges so the difference might be audible above 2 kHz fc, but I haven't compared.

    Nigel Redmon suggested running the filter on the same sample twice. I extended this slightly by using linear interpolation on the input before running the filter on it but still using zero order hold resampling of the output, so I'm not burning a great deal of resources on resampling.

    Here's the working part of the code:

    void
    svf_tick_n(sv_filter* s, float* x, int N)
    {
        int i = 0;
    
        //double-sample rate processing, linear interpolated
        for(i=0; i < N; i++)
        {
            //Run 1 : Linear interpolate between x[n-1] and x[i]
            s->lpf = s->lpf + s->f * s->bpf;
            s->hpf = s->g5 * (x[i] + s->x1) - s->lpf - s->q * s->bpf;  //g5 includes the 0.5 factor for averaging x[n] and x[n-1]
            s->bpf = s->f * s->hpf + s->bpf;
    
            //Run 2
            s->lpf = s->lpf + s->f * s->bpf;
            s->hpf = s->g * x[i] - s->lpf - s->q * s->bpf;
            s->bpf = s->f * s->hpf + s->bpf;
    
            s->x1 = x[i];
            x[i] = s->lmix * s->lpf + s->hmix * s->hpf + s->bmix * s->bpf;
            if(s->normalize == false) x[i] *= s->gout;
        }
    }

    Below is the function I am using in which frequency response is continuously modulated and distortion is added. On my TODO list is to also linearly interpret the frequency coefficient, but my ears are telling me it's probably a waste of CPU resources.

    void
    svf_tick_fmod_soft_clip_n(sv_filter* s, float* x, float *f, int N)
    {
        int i = 0;
    
        //double-sample rate processing, linear interpolated
        for(i=0; i < N; i++)
        {
            //Run 1 : Linear interpolate between x[n-1] and x[i]
            s->lpf = soft_clip(s, s->lpf + 0.5*(f[i] + s->f1)* s->bpf);
            s->hpf = soft_clip(s, s->g5 * (x[i] + s->x1) - s->lpf - s->q*s->bpf);
            s->bpf = soft_clip(s, f[i]* s->hpf + s->bpf);
    
            //Run 2
            s->lpf = soft_clip(s, s->lpf + f[i]* s->bpf);
            s->hpf = soft_clip(s, s->g * x[i] - s->lpf - s->q*s->bpf);
            s->bpf = soft_clip(s, f[i]* s->hpf + s->bpf);
    
            s->x1 = x[i];
            s->f1 = f[i];
            x[i] = s->lmix*s->lpf + s->hmix*s->hpf + s->bmix*s->bpf;
            if(s->normalize == false)
                x[i] *= s->gout;
            if(s->outclip)
                x[i] = clip1(x[i]);
    
        }
    }

    This is the part that adds the most CPU load, but it's the part that adds the most character to the filter that
    I am unwilling to sacrifice:

    
    inline float
    soft_clip(sv_filter* s, float xn_)
    {
        float xn = s->drive*xn_;
        if(xn > 1.0) xn = 1.0;
        else if (xn < -1.0) xn = - 1.0;
        else if(xn < 0.0) xn = (xn + 1.0)*(xn + 1.0) - 1.0;
        else xn = 1.0 - (1.0 - xn)*(1.0 - xn);
        return s->idrive*xn;
    }
    
    inline float
    sqr(float x)
    {
        return x*x;
    }
    
    inline float
    clip1(float x)
    {
    
        float thrs = 0.8;
        float nthrs = -0.72;
        float f=1.25;
    
        //Hard limiting
        if(x >= 1.2) x = 1.2;
        if(x <= -1.12) x = -1.12;
    
        //Soft clipping
        if(x > thrs){
            x -= f*sqr(x - thrs);
        }
        if(x < nthrs){
            x += f*sqr(x - nthrs);
        }
    
    
        return x;
    }
    a month later

    I have uploaded the most current revision of my work on this so far:
    http://cackleberrypines.net/transmogrifox/src/bela/15_MultiDelay_29_June_2017.zip

    At this point it's a full-featured guitar effects processor.
    My TODO list includes this:
    LCD display on front -- user feedback is still debug messages in the console.
    Implement save/recall presets.
    Implement 12-button foot controller like my old Digitech RP-20 (that unit was really slick, in my mind)

    Feature list:
    Flange
    Chorus
    Delay
    ~(3 above have assignable envelope control to most parameters)~
    Reverb (Zita Rev1)
    Wah Modeler (the inductor wah model)
    6-band parametric EQ
    Tremolo
    Sustainer (from Rakarrack) (a littler more "open" sounding than the standard compressor)
    Compressor
    Envelope Filter (Well, much much more -- includes sample-hold and ADSR modes)
    Phaser

    2 years later

    Hi - sorry to resurrect an old-ish thread but I wondered if you had any kind of wiring diagram and/or BOM for this project?
    I'm just starting out with Bela and want to make a multi effects unit for use when DJing and this looked like a good place to start.

    Thanks

    PatchStorage has the closest thing to a wiring diagram. This project gives the general idea that you can modify to match the specific description below:
    https://patchstorage.com/dynamic-range-compressor-feedback-topology/
    Of course, the above project works as advertised if all you wanted was a dynamic range compressor.
    Based on the same wiring diagram, here are some other "broken out" effects that will work on the same wiring diagram:
    https://github.com/transmogrifox/Bela_Misc -- specifically "overdrive" and "klingon-tone"

    The interface for the whole FX processor is a bit crude for now since I currently depend on the console output to see which effect and parameter are being adjusted.

    Here is the most current code for the project:
    https://github.com/transmogrifox/transmogriFX_bela

    Here is some code that can help get started implementing LCD output and control if you want. Code I haven't pushed to gituhub implements some rudimentary I/O on the LCD so I'm not working totally blind without a computer connected to the IDE, but not good enough to push the code at this point. The audio level meter code has all the pieces needed to design a usable LCD interface.
    https://github.com/transmogrifox/Bela_Misc/tree/master/audio_level_meter

    The short description is this:
    -- Connect 6 pots (10k) between ADC ref pin and gnd with wipers going to Analog input channels 0-5.
    -- If you have a wah pedal, disconnect the pot from the wah circuit and connect the pot between ADC ref pin and ground with wiper going to Analog input channel 8.
    -- Connect 420 to 500 ohm resistor from 5V to Analog ref pin to make up the extra current drawn by the 10k pots. If you use 100k pots, then the resistor to 5V can be the 4.7k shown in the compressor diagram.
    -- Connect bypass pot to digital input 4, switching between 3.3V and GND.

    Then for switches, connect either:
    1) Normally closed momentary pushbutton switch between digital input pin to ground with 3.3k pull-up resistor to 3.3V.
    2) Normally open momentary pushbutton between digital input pin to 3.3V and 3.3k pull-down resistor to ground.

    Here are the definitions for what switch channels to use and what they do:

    //Control context 
    #define CONTROL_CONTEXT_SWITCH	3  //input 0 appears to be dead on dev's unit (maybe ESD? or just broken wire)
    #define CONTROL_EFFECT_SWITCH  	1
    #define EFFECT_BYPASS_SWITCH	2
    #define WAH_PEDAL_BYPASS	4

    I was using digital input channels 0-3, but one was broken so I am using 1-4. As the code is written:
    Digital input 1: Scrolls through list of FX, makes them active for control. (CONTROL_EFFECT_SWITCH)
    Digital input 2: Toggles on/bypass state of active effect. (EFFECT_BYPASS_SWITCH)
    Digital input 3: Scrolls through control pages on the effect, which assigns the pots to different sets of parameters.(CONTROL_CONTEXT_SWITCH)
    Digital input 4: Logic high (3.3V) wah is activated unconditionally, Logic low wah can be switched on/off with EFFECT_BYPASS_SWITCH if wah is the active effect selected by CONTROL_EFFECT_SWITCH.

    From there the audio path is intended to work like this:

    {Guitar} ----->[Bela CH0 IN] ...[Bela CH0 OUT] -->{External FX Chain(FX send/return)}--->[Bela CH1 IN]...[Bela CH1 OUT--->{Amplifier}

    Here are some hardware interface circuit ideas, but there is no PCB layout nor BOM:
    https://github.com/transmogrifox/Hardware/tree/master/Bela_Input_Buffer

    The user interface to this is very crude but all the pieces are there to build a nice FX processing unit. My plan is to abandon the current "render.cpp" and start over from scratch but at my current rate this will be a project of many years.

    a year later

    Built from the GiHub repo and deployed this successfully; it was enjoyable to play through, even if with only reverb active without an input buffer circuit. My question was going to be the one red_tin_dave already asked.
    Thanks for sharing.

    18 days later

    As I'm not good with hardware and lack supplies, I wanted to try controlling transmogriFX using OSC.
    So far, so good. The OSC API on Bela is a pleasure to use.
    I'm using M. Hexler's excellent TouchOSC as the controller.

    The bottom bank of faders is for the chorus module; the upper banks are not yet connected.
    The chorus fader settings are sent from Bela to TouchOSC, to provide correct initial settings.
    I'm connecting it up one-by-one and will probably do the compressor and the Klingon next.

    looking great! would you be able to share the code and the TouchOSC file? We are looking into adding some TouchOSC projects to the examples that come with the board.

    Absolutely; I'm working in a fork of ryjobil's repo on GitHub, and was going to include this code and a layout file as a new branch. Then anybody can clone that.

    OSC and a touchscreen device is really where it's at. The hardware controls I have in the works will be a lot like a guitar FX processor from the mid-90's (LCD and multi-function buttons).

    A video demo of the sliders working would be really cool to see too if you get to a point where you can demo something like that. I'm a sucker for "boring" videos of people making noises and operating controls 😃

    A video demo

    I will. It will be good practice for making a video. All the kids are doing it.

    Pushed code to that branch. There's a TouchOSC layout that exposes Klingon, Overdrive, Chorus and a little of Reverb. Knob values may be getting mangled if you wiggle a lot. Might be treating input domains as linear when they sometimes should be logarithmic.

    Check that same repo's Wiki for a recipe if you want to try it.
    https://github.com/rhaleblian/transmogriFX_bela/wiki

    Some observations:

    I started assuming that effects store an input value that was the knob's input after mapping from 0-1 to the input domain -- I cared because I want to send that value to the UI, as the controls are absolute. I didn't see that being the case after attempting to "wire" a pointer to an internal effect param to fetch its value to send back to the UI. And inverting the stored param value to the original input looked not easy in many cases. I dealt with it by storing the mapped input value in each of a Knob object, and never looking inside the effect. But now OSC and hardware knobs might not play nice together.

    What was the other thing? I already mentioned linear vs log. Well, maybe it was that it would be nice to read the layout file and generate code that could be dropped into a C++ project to provide objects to talk to using a small support library that is prepared for the generated code.

      plate-of-shrimp But now OSC and hardware knobs might not play nice together.

      it's hard to make that work smoothly without encoders and many LEDs ...

      plate-of-shrimp Well, maybe it was that it would be nice to read the layout file and generate code that could be dropped into a C++ project to provide objects to talk to using a small support library that is prepared for the generated code.

      not sure I understand what you mean there

      not sure I understand what you mean there

      Um, drop the 'small support library' bit, that probably confuses things. The idea is only to extract things from the layout and make C++ representations of them for convenience. Say, that a fader that goes from 0-7 and is called '/coolness/factor' becomes some code you don't have to repetitively write to help wire things up. Using OscReciever and OscSender are easy, and writing a receive callback is easy, so it may not worth the effort.

      7 days later

      Added delay line.
      https://github.com/rhaleblian/transmogriFX_bela/tree/osc
      Exposed effects:
      - compressor
      - klingontone
      - overdrive
      - chorus
      - delay
      - reverb (only partially)
      Sustainer has a layout but the wiring is not done.

      @giuliomoro the files
      https://github.com/rhaleblian/transmogriFX_bela/blob/osc/src/osc.cpp
      https://github.com/rhaleblian/transmogriFX_bela/blob/osc/src/osc_delay.cpp
      show a class abstraction for a virtual "faceplate".

      Re: TouchOSC examples, how about something that is in line with the existing examples but replaces eg a pot with a TouchOSC screen? I could make that.

      Nice !
      Out of curiosity, what makes you prefer TouchOSC over the Bela GUI?

      I should try the GUI. I suppose that if it runs in a browser it is portable, in the physical sense? On a phone or tablet?
      I may move from TouchOSC to a hardware controller if I see one that does OSC.
      Also brings up the question of stomp switch pedalboards, have not looked to see what's out there.
      I also got Trills in the mail recently...

        This video showing the screens came out not so well, but I hope it gives a sense.

        I'll record something with sound but it's a little too early here for lots of noise.

        plate-of-shrimp suppose that if it runs in a browser it is portable, in the physical sense? On a phone or tablet?

        yes! although I must say that your TouchOSC solution looks very good already.

        plate-of-shrimp a hardware controller if I see one that does OSC.

        nice, do they exist?

        plate-of-shrimp sound is bit high in the mix.

        indeed, but cool video anyhow

        plate-of-shrimp Also brings up the question of stomp switch pedalboards, have not looked to see what's out there.

        I know there are MIDI boards out there. I played with a Behringer FCB1010 using a USB-Midi converter in Rakarrack on a laptop. It would probably take some coding to pipe the USB-Midi device into Bela, but if you got that working then it would open up a lot of possibilities for HW controllers.

        Another idea i have tossed around is I have an Acer Spin5, which is plenty of screen to support a nice control interface, and is trivial to get MIDI messages through the standard Alsa driver. The control interface including control to a HW MIDI controller via USB in the laptop could send messages to Bela via OSC.

        I would think a tablet with a USB port could be used in the same way. For that matter a Raspberry pi could be used to bridge the MIDI->USB->Network interface and then you could turn any HW MIDI controller into a HW->OSC controller.

        Well there's some brain dump 😉 .

          2 years later