Skip to content

Commit

Permalink
updated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Klang committed Apr 20, 2021
1 parent 86986b3 commit 4f0e3b9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 4 deletions.
8 changes: 4 additions & 4 deletions CPlusPlus/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,21 +73,21 @@ Output trigger/gates can be controlled with `setButton()`:


### Audio
The first class you should get familiar with is `FloatArray`, which contains a channel of audio. It is delivered to you in a `SampleBuffer` in the `processAudio()` callback.
The first class you should get familiar with is `FloatArray`, which contains a single channel of audio. It is delivered to you in an `AudioBuffer` which may hold several channels of audio, in the `processAudio()` callback.

```
void processAudio(AudioBuffer &buffer){
FloatArray left = buffer.getSamples(LEFT_CHANNEL);
FloatArray right = buffer.getSamples(RIGHT_CHANNEL);
```

`FloatArray` is written so that you can pretend that it is a an actual array of floats, or a `float*`.
`FloatArray` is written so that you can pretend that it is an array of floats, or a `float*`.

```
float sample = left[i];
```

The job of an OWL Patch is to replace the incoming audio samples with some new output audio. The same `FloatArray` object is used for both purposes: first you read the samples, then you write them. A simple stereo gain patch that simply multiplies each sample by a scalar could look like this:
The job of an OWL Patch is to replace the incoming audio samples with some new output audio. The same `FloatArray` object is used for both purposes: first you read the samples, then you write them. A simple stereo gain patch that multiplies each sample by a scalar could look like this:

```
class GainPatch : public Patch {
Expand All @@ -113,7 +113,7 @@ public:
```
left.multiply(gain);
```
to scale the level of every sample in the buffer. For more information see the [FloatArray API](https://www.rebeltech.org/docs/classFloatArray.html).
to scale every sample in the buffer. For more information see the [FloatArray API](https://www.rebeltech.org/docs/classFloatArray.html).

FloatArrays are also very useful for other things, like delay buffers, samples, filter coefficients. To allocate a new FloatArray on the heap, use its static `create()` and `destroy()` methods, and make sure to only do this within the call stack of the patch constructor and destructor. The same applies to many other classes in our library. On an embedded device, we don't want to allocate any memory in the audio processing functions, because this will lead to fragmentation and a heap of problems. So to speak. So instead we call our `create()` and `destroy()` functions like this:

Expand Down
32 changes: 32 additions & 0 deletions OWL_Patches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
## Creating OWL Patches

OWL patches can be programmed in any of the supported languages:
* [Pure Data](PureData)
* [FAUST](Faust)
* [C++](CPlusPlus)
* [Max Gen](MaxGen)
* [SOUL](Soul)
* [Maximilian](Maximilian)
* [DaisySP](DaisySP)

Regardless of language, there are primarily two ways [1] of creating and loading a patch. The easiest is to use our online patch library, but it is also quite straightforward to set up a local, i.e. offline, build environment with simple command line tools.

[1] For Max Gen, there is also an OWL Package available which makes it possible to compile and load patches from within Max. See the [Max Gen](MaxGen) instructions for more details.

### Online Instructions
To create an OWL patch using our online compiler, open the [Patch Library](https://www.rebeltech.org/patch-library/) with a Web MIDI enabled browser (e.g. Chrome), log in (create an account if necessary), go to [My Patches](https://www.rebeltech.org/patch-library/patches/my-patches/), and click Create patch. Now upload your patch files, which can be
* .cpp, .c, .hpp, .h for C++ patches
* .pd for Pure Data
* .dsp for FAUST
* .gendsp plus the generated .cpp and .h files produced by Max Gen
* .cpp for Maximilian
* .soul and optionally .soulpatch for SOUL

Make sure the correct 'main file' is selected. This should be where your C++ Patch class resides, or the Pure Data top level, or main, patch file. Select the appropriate compilation type, then click `Save and Compile`. Wait for compilation to finish, click `Connect To Device`, and then click `Load` to run the patch on the device. If you want to store it in a memory slot, click `Store` and select which slot to store it in.

To update the files, change the compilation type or main file, or remove patch files, simply click on the `+` icon next to the file tabs on the patch details page. Uploading files with the same name as an existing one will update that copy of the file on the server.

Instead of uploading files, you can also link directly to files in a GitHub repo. To do so, simply copy-paste a link to the file. The latest version of the linked files will be requested each time the patch is compiled.

### Offline Instructions
You can also compile OWL patches offline using [OwlProgram](https://github.com/pingdynasty/OwlProgram). For details on using OwlProgram, please see the [project readme](https://github.com/pingdynasty/OwlProgram/blob/develop/README.md).
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ The OWL platform is actively developed by [Rebel Technology](https://www.rebelte
* [OWL Modular](OWL_Modular)

### Patch Programming
* [Creating Patches](OWL_Patches)
* [Pure Data](PureData)
* [FAUST](Faust)
* [C++](CPlusPlus)
Expand Down

0 comments on commit 4f0e3b9

Please sign in to comment.