It’s just an attempt to copy the really great ADDAC506 Stochastic Function Generator with Pure Data.

Here is the panel with the pots, buttons, in & out mapping. Keepping pressed (Env 1) button allow to change the last four pots / settings of Enveloppe 1, keeping pressed (Env 2) button allow…

And some features like:
- Rise & Fall time, if Min time > Max time then Max time = Min time, from 10 ms to 10 s
- Rise & Fall shapes from exponential to logarithmic, through linear.
- Min Amplitude setable
- Delay between two enveloppes from 0 to 10 s and stochastic (0 to 10 s) on full clockwise
- LED bargraph with viewable four enveloppes, four triggers and viewable four pressed buttons

Thanks a lot @giuliomoro for your priceless help with Else library installation, which is abusely used in this patch. (ELSE thanks to you Alexandre Torres Porres !)

alt text

Here is where to download it :
https://patchstorage.com/attac506-for-bela-pepper-rev2/

And yes, i speak bad english.

(Here is some noises where this patch will be usefull, driving feedbacks : https://jacobgaret.bandcamp.com/)

Looking forward to trying this out when you have something to share. I'm a big fan of Befaco Rampage and have always wanted two so this would actually be the perfect solution!

    bela_robert
    Great to see that this try could be used by others !
    It already works on Pepper, but I still have some (minor ?) things to set to take it to his minimum task.
    And with @giuliomoro advice, I have to set it to be less heavy for the CPU...
    I'm on it half day job, so I can dream about a first version in few days.
    Thanks !

    that looks like an amazing piece of kit, even with just the envelopes and no audio processing yet.
    keep us posted!

    Hi there
    I've got a first prototype to share but I would like to know how to share it, technically i mean (_main.pd + abstractions + Readme).
    Thanks.

    Hi there.

    To not share a too much poor prototype on Github or Patch storage, I need some help for some little things (beware : dumb questions here, first batch !):

    1/
    - Do the 8 pots are physically LOG or LIN ? They didn’t appears in the "CURRENT BOM for Rev2". Because I want to know if I need [pow~ 2] in Pd to turn it LOG.

    2/
    - Because I need the 8 pots to control parameters, it seems I’ve got to set the Bela via IDE/Project_settings_on "Analog Sample Rate" to 22050 Hz, because at 44100 Hz, only 4 "Analog Channels" are available. BUT, in test configuration, PEPPER powered by the rack and connected to my computer, I have set this "Analog Sample Rate" at 22050 Hz, and turned off the Bela, unplugged the USB and reboot it to tested it alone AND I have no more control with the 4 last pots, as if "Analog Sample Rate"_ went back to 44100 Hz setting. Any ideas ?

    (I have the last four CV OUT on DIGITAL mode, but I note that : "These can optionally be re-configured so that up to 4 of the CV-in sockets are repurposed as trigger inputs, connected to Bela's digital inputs, while the corresponding pots are still controlling Bela's analog inputs.")

    3/
    - I see many "Underrun detected: 1 blocks dropped" errors on IDE when I run my patch. (In IDE/Project_settings, I have set the Block size (audio frames) to 128.) Why ?

    4/
    - Adding "the --high-performance-mode flag to the User Command Line Arguments: field in the project settings, you will be able to use up to 99% of the CPU for the patch". How to remote the button that is on the Bela cape (which stop the running program and give you back access to the IDE) to the front panel for embedded use ? Is it a shortcut with buttons ? Or a hole in the panel with a new little button ?

    5/
    - Where to find the schematic of the Pepper Rev2 ?

    6/
    THANKS

      FatJak - Do the 8 pots are physically LOG or LIN ? They didn’t appears in the "CURRENT BOM for Rev2". Because I want to know if I need [pow~ 2] in Pd to turn it LOG.

      they are linear

      FatJak "_ went back to 44100 Hz setting. Any ideas ?

      it's a bug on applying those settings. In order to force applying them at boot you need to:

      • set boot program to •none•
      • set boot program back to your program

      FatJak I see many "Underrun detected: 1 blocks dropped" errors on IDE when I run my patch. (In IDE/Project_settings, I have set the Block size (audio frames) to 128.) Why ?

      You may be using too much CPU, either continuously or because of excess peak usage. How many do you get per second?

      FatJak . How to remote the button that is on the Bela cape (which stop the running program and give you back access to the IDE) to the front panel for embedded use ? Is it a shortcut with buttons ? Or a hole in the panel with a new little button ?

      Maybe the best option is to do no hardware change and instead the code so that pressing one of the buttons already on Pepper stops the currently running program. If you are using Pd, you can update your board to the latest version of the Bela code, you can send:

      [stop(
      |
      [s bela_control]

      to stop the program. So you can trigger that with some logic to one of the front-panel buttons.

      FatJak
      - Where to find the schematic of the Pepper Rev2 ?

      https://github.com/BelaPlatform/bela-pepper/tree/master/Design%20Files/rev2b

        giuliomoro

        Thanks for this package of informations !
        The bug in IDE/Projects_settings turned me mad last week-end ! I have desperately dig in my patch until I found only dark night.
        I will made the changes, put on test the patch again and send my second batch of dumb questions.
        Thanks again !

        13 days later

        Oups, already one mistake with the delay section wich doesn't work in stochastic mode, because of an error in the Pd subpatch [pd delay stochastic]. I have already fix it.
        But It alows me to discover that I can't reach the max value (1 in Pd) perhaps because the output max voltages from the CV out are not equals (from 4,20 to 4,55 V), so it seems that's why @Remork create the R-Conditioner, even it's for a 10 V input...
        I'll try to update the [ReadAnalog] with this patch to see if it change something.

        yeah, it's basically mapping the 'real' min-max input to wanted min-max output.
        it's pretty straightforward 🙂

          Remork Thanks !

          So, if I understand well:
          if I get (mini) 4,2 V instead of 5 V,
          and if Bela give a 1 with a 5 V value,
          I need to multiply by 20% my input values
          so:
          [*1200]
          |
          [int]
          |
          [clip 0 1000]
          |
          [change]
          |
          [/1000]

          It seems to work with this:
          #N canvas 50 47 212 440 12;
          #X obj 25 163 snapshot~;
          #N canvas 1 67 450 300 LowPass 0;
          #X obj 49 102 lop~ 10;
          #X obj 49 138 lop~ 10;
          #X obj 49 162 lop~ 10;
          #X obj 50 72 inlet~;
          #X obj 49 187 outlet~;
          #X connect 0 0 1 0;
          #X connect 1 0 2 0;
          #X connect 2 0 4 0;
          #X connect 3 0 0 0;
          #X restore 25 79 pd LowPass;
          #X obj 25 198 int;
          #X obj 25 260 / 1000;
          #X obj 25 289 change;
          #X obj 25 317 abs;
          #X obj 25 351 pow 2;
          #X obj 25 392 outlet;
          #X obj 25 48 *~ 1200;
          #X obj 25 226 clip 0 1000;
          #X obj 113 92 tgl 15 0 empty empty empty 17 7 0 10 #fcfcfc #000000
          #000000 0 1;
          #X obj 113 68 loadbang;
          #X obj 113 112 metro 20;
          #X obj 25 18 adc~;
          #X connect 0 0 2 0;
          #X connect 1 0 0 0;
          #X connect 2 0 9 0;
          #X connect 3 0 4 0;
          #X connect 4 0 5 0;
          #X connect 5 0 6 0;
          #X connect 6 0 7 0;
          #X connect 8 0 1 0;
          #X connect 9 0 3 0;
          #X connect 10 0 12 0;
          #X connect 11 0 10 0;
          #X connect 12 0 0 0;
          #X connect 13 0 8 0;

          or, in a graphical mode:
          [adc~ x]
          |
          [*~ 1200]
          |
          [pd LowPass (3x[lop~ 10])]
          |
          [snapshot~]—[metro 20]
          |
          [int]
          |
          [clip 0 1000]
          |
          [/ 1000]
          |
          [change]
          |
          [abs]
          |
          [pow 2]
          |
          [outlet]

          If somebody have a correction or a better proposition...

          i have a tendency to do the conditioning/calculations after smoothing the voltages - take 'raw' data, remove the jitter, and then see what there is to work with - but i guess the end result would be exactly the same 🙂

          as long as you reach 1000 or slightly more before the [clip]object, you should be fine.
          if the pot reading doesn't fully reach 0 on the other end, you can throw a minus offset in there as well.

            downloaded your patch, but still need to install the ELSE lib so can't try it out just now.

            looks like i'm missing three objects.
            i should think one can come up with a vanilla workaround for the [rescale] and [s2f~]objects, but i might be a tad optimistic here. 🙂
            any specific reason to use [brown](which i'm assuming is brown noise) over [random]?

              Remork
              Yes, the minus offset a good idea !
              And I'll set the conditioning/calculations after smoothing the voltages, as you said.
              It's still a little bit blurry for me how the Bela convert Voltage to 0-1 range because the real voltage values are not equals and not reaching 5 V, and perhaps not 0 V. So what do we get in Pd in these cases ? Do we have to consider that we could have for exemple 0.15-0.85 ranges in Pd instead of a 0-1 ?

                Remork
                About the (only !?) three objects:
                - [s2f~] is only used to visualise the envelope rise & fall ampltitude when you're working on the patch on your computer (see in [pd ENV (X)]), so you can run the ATTAC506 without it.
                - [rescale] I can't remember why I have use this objet, perhaps it could be replaced by [clip] (in [pd ENV (X)] replace [rescale 10 10000] by [clip 10 10000]. I'll try it today >>> EDIT: IT DOESN'T WORK OBVIOUSLY !
                - [brown] instead of [random] because if I paste some of the Alexandre Torres Porres Pd Help, we could understand that if we want to go stochastic, we need a ""Weighted random", where some random values have more probabilities of happening than others." And especially [brown] which is for ""brownian motion", which is a type of random walk. The difference to "drunkard" (an other object) is that we have the same probability to go up or down and when we reach the bounds the values are folded back." But I don't say you can't do it in an other way and I'm not saying I'm not wrong !