Skip to content

Commit

Permalink
renaming and first major update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwaterschoot committed Jan 27, 2024
1 parent 8b7d97d commit 73f836d
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
---
layout: default
title: What is Plugdata
nav_order: 99
nav_order: 2
---

# What is Plugdata

From the [Plugdata website](https://plugdata.org/):

{: .note }
> A visual programming environment for audio experimentation, prototyping and education.
> Plugdata is a free/open-source visual programming environment based on pure-data. It is available for a wide range of operating systems, and can be used both as a standalone app, or as a VST3, LV2, CLAP or AU plugin.
> plugdata allows you to create and manipulate audio systems using visual elements, rather than writing code. Think of it as building with virtual blocks – simply connect them together to design your unique audio setups. It's a user-friendly and intuitive way to experiment with audio and programming.
>
> Plugdata allows you to create and manipulate audio systems using visual elements, rather than writing code. Think of it as building with virtual blocks – simply connect them together to design your unique audio setups. It's a user-friendly and intuitive way to experiment with audio and programming.
## About visual / modular programming

Read this if you don’t know these terms: Pure Data, Plugdata, Pd, flavours, modular, visual programming. I've written a short intro on the concept.

{: .highlight }
> 💡 If you know what Plugdata is and how it’s different from Pure Data > skip this part.
### Pure Data
Expand All @@ -27,32 +29,55 @@ Pure Data goes back many years and was made as a tool to help artists create (in

### Pure Data - “flavours”

{: .highlight }
> **Pure Data** (or just "Pd") is an open source visual programming language for multimedia. Pure Data is developed by Miller Puckette since 1996 and you can find it on [his official website](https://msp.ucsd.edu/) along with the official documentation and other related resources. This is the official "Pd" or "main distribution" and it is also known as "Pd Vanilla", but there are other forks or "flavours".
source: intro on puredata.info
>
> source: intro on puredata.info

### The modular approach

There are many tools out there that use this approach to programming or building electronic stuff, be it analog or digital. In 3D software like e.g. Blender they’re called nodes, Touchdesigner and [Cables.gl](http://Cables.gl) are both examples of tools that heavily rely on the approach of connecting blocks with virtual cables.
There are many tools out there that use this approach to programming or building electronic stuff, be it analog or digital.

In 3D software like e.g. Blender they’re called nodes, Touchdesigner and [Cables.gl](http://Cables.gl) are both examples of tools that heavily rely on the approach of connecting blocks with virtual cables.

Maybe you've seen the DAW Bitwig and how the grid can be used to build your own effect or synth.

{: .attention }
> The common idea is using cables to connect pieces to interact.
You could go far with this analogy as **all things are a whole of parts**, yet for sake of this document let’s just keep the connecting of different parts as the main concept.

You could go far with this analogy as all things are a whole of parts, yet for sake of this document let’s just keep the connecting of different parts as the main concept.
If you are guitar player or seen one then you've certainly seen them using pedals to add effects. These pedals are our objects in Plugdata, sometimes our patches are inside the pedal adding extra functions, **tweaking circuits**, other times we just **plug the pedal in without knowing it's inner magic**.

### Eurorack

Coming from the music world you might be familiar with modular Eurorack synths. Maybe you’ve even used synths or kits that use Daisy. Or maybe you’ve seen the virtual eurorack systems like VCV rack or Cherry Audio Voltage Modular and many others ([See some listed in this article on attackmagazine.](https://www.attackmagazine.com/reviews/the-best/ten-of-the-best-modular-software/) )

### VCV a virtual eurorack cable spaghetti maker:



https://youtu.be/NPErDUlwSlg?list=PL7NZKetd80yrCyyQ2-1J8fad420gL8MAf

### Modular coding
### *Modular* coding or patching

Seeing you’ve stumbled upon this page, you might already be familiar or knowledgeable on the concept of using code and libraries.

It's often a way to prevent us from reinventing the wheel. But also a huge help for starters as we don't need every piece of complex code, we can just reference a certain function that's easily accessible for us.

In Plugdata we'll use a block (object), with the word `myknob`, and through the use of several other files, when we save or rather compile to the Daisy microcontroller the software will use these behind the curtains info to write the correct code.

This gives two advantages:
- it's easy to use the functions it provides
- we keep our own code / patch clean and tidy making it easier to write and read

Seeing you’ve stumbled upon this page, you’re probably already interested or knowledgeable on the concept of using code and libraries. I have been tinkering with Arduino microcontrollers before and most code I’ve used relied heavily on the work of others, not only the builders of the hardware and it’s software, but also people who’ve made pieces of code often called libraries that you refer to in your own piece of code. Or sometimes it’s just pieces you could copy paste at the bottom etc. …
E.g. case in point of using Daisy seed and knob connected to one of the pins:
1. We put a few lines in a separate file that describes our board and how it's connected (custom json)
2. The necessary code to talk to the sensor, the code to read the sensor, and the implementation into Plugdata is all being done through various tools, libraries.
3. As an end user we can just put a block that says “knob1”, etc.

Plugdata can be seen as a similar thing of this modular programming approach you write names of functions or tools; e.g. an oscillator, you don’t know how the oscillator is itself in turn made of smaller components. You just put a block that says give me an oscillator with the frequency 440.

- So you can use links or refer to these pre-made pieces of functions and tools inside your own code that get compiled or run in the background.
- E.g. case in point of this page referring to Daisy seed and the mpr121: you link to the mpr121 touch sensor, and in pure data all you need to do is refer to the touch points, without actually knowing how it works.
- The necessary code to talk to the sensor, the code to read the sensor, and the implementation into plugdata is all being done through various tools, libraries.
- As an end user we can just put a block that says “knob1”, etc.
- Pure Data can be seen as a similar thing of being a modular programming approach you write names of functions or tools; e.g. an oscillator, you don’t know how the oscillator is itself in turn made of smaller components. You just put a block that says give me an oscillator with the frequency 440.
- We don’t always have to know how to make paint, brushes and canvas to be a proficient painter
{: .new }
We don’t need to know how to make paint, brushes and a canvas to be a proficient painter. We use tools all the time that we couldn't build ourselves.
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
---
layout: default
title: Installing Plugdata and the toolchain
nav_order: 99
nav_order: 3
---
toc

tldr;
- install plugdata and the toolchain
- create a custom json
- compile using heavy
{: .new }
>On this page:
>- Install plugdata and the toolchain
>- describe your custom Daisy setup and create a custom json
>- compile using Heavy
# [](#compiling_workflow)Compiling workflow

To get up and running you need to understand the basic workflow for getting your Patches from Plugdata compiled onto the Daisy seed microcontroler.

{: .note }
> In short:
> 1. Make a compatible Plugdata patch
> 2. Setup a custom json file that describes to which pins our components are connected
> 2. Use the compile menu to upload to Daisy.
{: .attention }
> In short the workflow to go from patch to Daisy:
> 1. Make a **compatible** Plugdata patch
> 2. Setup a **custom json** file that describes to which pins our components are connected
> 2. Use the **compile** menu to upload to Daisy.
- Heavy does the translating.

There are some caveats, things to consider. Daisy isn't your computer, a patch made for one device won't just automagically work on your device. We need to look at some software details and we need to compare the hardware.

{: .highlight }
> 💡 Not all existing patches work as is; they get converted; Many of the fancy visual stuff is useless for Daisy, many patches rely on stuff that isn’t supported, and Daisy also has limited CPU power compared to a computer.
Expand All @@ -37,6 +38,8 @@ A method that was already made for converting regular pure data patches was made
However Plugdata has a few advantages over doing this manually via pd2dsy:
- Installing the needed toolchain is done for you when opening the compile window
- when using Plugdata in "compile" mode you get instant feedback when something is not compatible by and autocomplete won't show unsupported objects.
- if you've already setup the Arduino ide to program your Daisy you might be surprised how little setup is needed. Plugdata will fetch everything you need as the Toolchain.
- The arduino serial monitor can be a handy tool to debug or read signals that you send to `print`.

{: .highlight }
> **Using compile mode in Plugdata**, you'll instantly see when you use incompatible objects.
Expand All @@ -47,31 +50,40 @@ However Plugdata has a few advantages over doing this manually via pd2dsy:

<sub>Object error indication when using an unsupported object in Compilation Mode</sub>


<img width="251" alt="PlugData Compilation Mode - unsupported object console warning" src="img/heavy_unsupported_warning.png">

<sub>Console error warning when using an unsupported object in Compilation Mode</sub>

# [](#installing-1)Installing instructions

# [](#installing-1)Installation instructions

Install Plugdata for your platform via the [Plugdata website](https://plugdata.org).

After completing the installation go to the compile menu via `Menu > Compile`

{: .highlight }
The first time you open the compile window the program will automatically begin downloading the toolchain.

The download might take a while but is a one time event, so once the toolchain has completed the download this window will always open instantly.

# [](custom_json)Telling the patch to which pins our hardware components are connected

In Plugdata you'll be referring to your connected components with an object that looks like this `r my_custom_knob @hv.param`
In Plugdata you'll be referring to your connected components with an object that looks like this:
> `r my_custom_knob @hv.param`
Typing this into an object in Plugdata will create a block with an outlet that outputs a value from `0 to 1` (e.g. 0.1 or 0.891)

In the compile window we'll point to a custom json file where we list our hardware setup.

![compile window custom board](img\compile_custom_json.png)
<sub>Note that there are a few other settings that aren't discussed here yet, like 'Patch size' or memory allocations, when starting leave them at the defaults, more info will be shown in the full examples.</sub>

{: .note }
> In the next chapter there's a full example and more elaborate info on setting up this json file.
>Note that there are a few other settings that aren't discussed here yet, like 'Patch size' or memory allocations.
>
>When starting leave them at the defaults, more info will be shown in the full examples.
>
>In the next chapter there's a full example and more elaborate info on setting up this json file.
For now, here's a small example of the content of the json file that's linked to our example
> `r my_custom_knob @hv.param`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,44 @@
---
layout: default
title: Setting up a custom json
nav_order: 99
nav_order: 4
---
# Setting up a custom json file to describe your daisy pin setup

There's a [Guide for pd2dsy](https://forum.electro-smith.com/t/quick-guide-on-setting-up-a-custom-json-file-for-pd2dsy-oopsy/4021) by Takumi Ogata on the Daisy forum.

As we're compiling from Plugdata the workflow is quasi the same. But just a bit easier as we do the compile process from within Plugdata. We do need to make a separate file that we select in the compile window: the custom json. And that has to follow the same principles.

{: .attention }
> The Heavy compiler will output an error when there are spaces in the path or in the file names. This also aplies to any subpatches you might use, or if you are exporting you're compiled patch to disk.
>{: .warning }
> - Do not use spaces in file names or in the paths
> - Do not use capital letters in your custom components names
## Custom json for a custom Daisy setup
The custom json file will be used in the compile screen where we select it as our custom board under “Target board”.

There are already some board configurations available in the presets, e.g. Electrosmith's own Pod, Patch(init), there's also a Synthux Simple board.

On this page we'll use the Synthux Simple PCB as the example. Note that your build doesn't need to use the exact naming of the components, the custom json can have any name.

1. We make a custom json file (you can do this in a text editor)
2. In this file we tell the compiler to which pins our components are connected.
3. We specify what kind of component we're using (fader, switch, ...)

***

```json
example components
```
Link to Daisy Github going over the components and types
***

## Pin numbers
[ ] Insert link to pin spreadsheet

***

callouts:
note:
color: grey-dk
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
layout: default
title: What is Plugdata
nav_order: 1
---
# Documentation in this folder:

* [What is Plugdata](01_install_setup_plugdata\01_what_is_plugdata\01_what_is_plugdata.mdhttps:/)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
title: Potentiometer Plugdata example
nav_order: 10
---

# Potentiometer Plugdata example

Template structure for parts:
1. Name
2. function - what can it do
3. what it looks like
4. Pins
5. Components json
6. PD example(s)
7. links / references / sources
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
title: Toggle switches and buttons Plugdata examples
nav_order: 11
---

# Toggle switches and buttons

Template structure for parts:
1. Name
2. function - what can it do
3. what it looks like
4. Pins
5. Components json
6. PD example(s)
7. links / references / sources
18 changes: 18 additions & 0 deletions 02_components_pd_examples/03_LEDs/LED_plugdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: default
title: LED Plugdata example
nav_order: 12
---

# LED's

To fade or not to fade

Template structure for parts:
1. Name
2. function - what can it do
3. what it looks like
4. Pins
5. Components json
6. PD example(s)
7. links / references / sources
16 changes: 16 additions & 0 deletions 02_components_pd_examples/04_sensors/sensors_plugdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
title: Sensors Plugdata examples
nav_order: 13
---

# Toggle switches and buttons

Template structure for parts:
1. Name
2. function - what can it do
3. what it looks like
4. Pins
5. Components json
6. PD example(s)
7. links / references / sources
18 changes: 18 additions & 0 deletions 02_components_pd_examples/05_midi/midi_plugdata.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
layout: default
title: Midi Plugdata examples
nav_order: 14
---

# Midi

USB - UART - TRS - ...

Template structure for parts:
1. Name
2. function - what can it do
3. what it looks like
4. Pins
5. Components json
6. PD example(s)
7. links / references / sources
16 changes: 16 additions & 0 deletions 02_components_pd_examples/components_plugdata_examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
layout: default
title: Components Plugdata examples
nav_order: 5
---
# Plugdata components examples

This folder contains the examples. There are 6 parts, however some parts are more complex so the info won't be as complete.

1. Potentiometers
2. Toggle switches and buttons
3. LED's
4. Sensors (complex)
5. midi (usb or via pins)
6. CV control voltage (To do)
7. Screens (To do)

0 comments on commit 73f836d

Please sign in to comment.