Can anyone point me to pd / bela documentation? I have got to the point where I can run a pd patch (as _main.pd) and now the next step for me would be to reach the hardware I/O so I can add switches, pots, etc. How do I access the hardware I/O via pd?

dac~ goes to the audio output, that much is clear.

Also Bela/examples/08-PureData/gettingStarted/ exemplifies all of this in a Pd patch

Encountering some roadblocks with the information at
https://github.com/BelaPlatform/Bela/wiki/Running-Puredata-patches-on-Bela

<quote>Navigate to the scripts folder cd /path/to/folder/scripts</quote>
Which scripts folder? Is this the scripts folder included in the archive at github? If so...

<quote> If running for the first time sh setup_board.sh</quote>
Where is this file?
sh: setup_board.sh: No such file or directory

<quote>5. Compile your first project!

./build_pd_heavy.sh -i ../projects/heavy/pd/hello-world/ </quote>

Error: unknown option -i

This may be because I've gone down a python rabbit hole with multiple layers of installation. pip install requests? oh, requests doesn't exist? go this this other guide and install homebrew. python isn't truly install-installed so do that. wait. your PATH environment variable isn't set? You're using 10.11? In that case... jumps off cliff

I'm really trying to get started. I can handle making pd patches and the promise of running pd patches on the bela is what brought me here but the reality of setting up this development environment with python/homebrew/requests is apparently beyond my abilities.

    stretta to run a pure data patch on Bela, plug in the board and click here to open the IDE. Then click 'new project' in the project manager tab and choose the option to open a pure data project.

    You can now drag and drop your pure data patch file onto the browser window and it will be uploaded to the board. You should be able to see it in the browser. Then simply click the run button.

    The other instructions you are quoting are for compiling pd patches using Heavy, which significantly increases their performance, but is a more complicated process.

      Yeah, as Liam said it is easy to get started with PD on Bela via the browser-based IDE. This is using libpd. There are many puredata specific examples found in the righthand menu showing how to address analog and digital I/O plus how to use the scope with PD.

      When you need to squeeze all the performance you can out of Bela with Pd then it's better to use Heavy which you need to use the scripts for. You seem pretty at home with the terminal so if this is your preferred strategy then you can do everything you need with them and use your editor of choice to code.

      A detailed guide to using the scripts can be found here: https://github.com/BelaPlatform/Bela/wiki/Interact-with-Bela-using-the-Bela-scripts

      All the scripts have a --help option that will explain their usage. Execute the script with the --help option to find out more.

      $ ./stop_running.sh --help
      Usage: stop_running.sh
          This script stops the Bela program which is running on the
          board regardless of how it was started.

      The -i argument on that Heavy script was from an older revision and shouldn't have been on the guide, thanks for catching that, it's now removed from the Wiki.

      LiamDonovan I've done that, but I'm past that point now and want to use the board I/O to add interactivity, which is the subject of this forum post. From reading the documentation, in order to do that, I need to move beyond the drag and drop IDE functionality and compile my patch.

      <quote> You can directly address the analog ins and outs from within PD (note that you have to compile and run the patch onto the BeagleBone to receive the data) </quote>

      Is this not true?

        stretta that quote is technically true, but a little misleading in this context and should probably be reworded.

        There are two routes to using PD on Bela, one is through libpd, and the other is through Heavy.

        With the libpd route, you take your patch, upload it to the board through the IDE, and click run. The patch is then compiled on the board using libpd, and run.

        For Heavy, you use the scripts provided to send the patch off to a remote server, where it is turned into optimised C++ code before being sent back and compiled on the board.

        So both methods do require compiling, but when using libpd the IDE effectively takes care of it for you, so all you need to do is drag+drop then click run.

          A few other documentation notes that I suggest:

          1) some popular browsers, like Safari on MacOS, don't support drag and drop in the IDE. If drag and drop is not working for you, try Chrome.

          2) When you follow your instructions, the creation of a new project, automatically creates a main.pd file. You can drag and drop new files in as much as you like. but " Then simply click the run button." will just keep playing the test tone main.pd file. You must delete this file and rename your uploaded file _main.pd for your patch to work. It took me a while to figure this out.

          LiamDonovan I understand the difference between heavy and compiling with libpd. The reason I was focused on heavy is because I got roadblocked with the libpd method for some reason.

          But heavy is really cool. I really like that I can turn a pd patch into something that can be embedded on a web page. I'm wondering why I can't just use the compiled C file they provide on their web interface and copy this over to the bela image. Seems way easier than what I've been going through.

            stretta Yeah Heavy is very cool, and can give a significant performance boost vs libpd. We tried to incorporate a workflow for it into the IDE because the script workflow can be a little temperamental at times as you have found, but we came across problems with cross-origin resource sharing so we went with libpd in the IDE instead.

            Thanks for the suggestions about documentation, we're still working on it and other perspectives are helpful!

            Have you managed to get this working now or are you still having problems (with libpd or Heavy)?

            I now have a potentiometer working as a volume control by using adc3. I'm currently trying to get an LED to blink. I'll report back later.

            Here's a weird one. If your pd patch contains an empty comment object, the IDE can't render the patch.

            just following up on stretta's questuon about the location of the 'setup_board.sh' script, it would be useful to clarify in the documentation whether this is meant to be found in the downloaded Bela-master folder, or on the board itself. I am struggling to locate it!

            hope I updated the wiki appropriately now, can you let me know if it is any better?

            Short answer is the file setup_board.sh does not exist any more . It is now called "update_board" and it can be found in Bela/scripts

            Incidentally, if you find small mistakes in the wiki, you can fix them yourself: if you are logged into github you should see an "edit" button at the top of the page. With great power comes great responsibility 🙂

            sick! will give that a go - thanks for the quick response.

            Apologies for the silence. That's good. I've been happily bela-ing since.

            Is it true there is a multiplexer available? I've poked around the site and haven't located it.

            At some point I I'll still have to sort out the heavy toolchain because I'm going to need the efficiency.

            I'll direct future software issues to the correct place :\ sorry.

            The edit-pd patch / save / drag into IDE / delete main.pd / rename as main.pd gets old really quickly. I wish there were a more streamlined process.

            some documentation suggestions:
            The holes on the laser cut plate are oriented such that mounting the board is obviously incorrect (hanging over one side / not centered / not matching with the engraving) or lined up/centered correctly, but upside down from all the documentation examples. I wish I did it the lopsided way so it wouldn't be upside down.

            In the start up documentation, you might want to mention locating the card, and where to insert it on the board. I know it seems obvious to you, but if people are following your instructions, they might not know to do this.

            thanks

              stretta
              A multiplexer capelet was made available during the kickstarter campaign after we reached one of our stretch goals. Schematics are here, if you want to build your own, otherwise more will be available for sale later this summer.

              It looks like your toolchain is ready to go, the error you were getting

              Error: unknown option -i

              was due to the fact that the code has been updated and the -i option has been removed (basically you can now omit it). After your post, we updated the wiki accordingly

              The edit-pd patch / save / drag into IDE / delete main.pd / rename as main.pd gets old really quickly. I wish there were a more streamlined process.

              You do not need to delete _main.pd and rename a _main.pd. You can simply name the file _main.pd on your computer, at which point a single drag and drop will get rid of the old _main.pd on the board and replace it with the new one. This is as good as it can get using the IDE: the browser cannot have access to the files on your computer. As you will understand, it would be a serious security concern if it was allowed to.

              A more streamlined workflow can be achieved using libpd or Heavy through the scripts. At this page you find the documentation on how to use build_project.sh (to use libpd) and build_pd_heavy.sh (to use heavy). In both cases you need to invoke the script with the -b (background) and --watch (waits for modifications in the source folder), so for instance

              $ ./build_project.sh path/to/my/belaTestProject -b --watch

              will run the project and refresh it every time you change a file in the folder path/to/my/belaTestProject . Note: the -b option will make it run in the background, that is you will not be able to see the text output from your program. While this may not be an issue in many cases (e.g.: if you are using the scope to debug your program), in case you need to see the output of your program, run (from another terminal window):

              $ ./connect_to_project.sh

              Thanks for the other observations.

              a month later

              Is it possible to access the I2C ports in Pd? For example, to hook up a sensor like the SparkFun Capacitive Touch Sensor Breakout - MPR121?