No edit summary
No edit summary
Line 44: Line 44:


=== Multiply  ===
=== Multiply  ===
Multiplies two inputs. The Multiplier parameter can adjust the output gain.


=== Add        ===
=== Add        ===
Adds the two inputs


=== Subtract  ===
=== Subtract  ===
Subtracts the input A with input B


=== Clamp      ===
=== Clamp      ===
Clamps the input in the given range


=== Invert    ===
=== Invert    ===
Inverts the phase


=== ShiftScale ===
=== ShiftScale ===

Revision as of 21:58, 28 April 2023

Sampl is a powerful audio graph builder integrated in the Unity Editor. It allows

you to bake unique procedural audio clips from noise, trigonometric or instrument primitives,

coupled with mathematical operations, filters, etc.

Sampl works natively with any render pipeline on any Unity version above

2020.3

Setup

The whole package is contained in the Sampl folder resulting from the import. You can move it wherever you want, but it is recommended to keep the same folder structure.

Basics

You can create a new Sampl graph from the right-click context menu in the project window.

Sampl2.png


Each graph is saved as a SamplObject in a .asset file. You can recognize

them with the Sampl logo. You can change some parameters from the inspector such as sampling frequency and the length of the clip.

Sampl1.png

You can open a graph by double-clicking on it. The window will try to dock itself next to the scene window, otherwise it will appear as a floating window, that you can dock manually.

The provided procedural rain example

Navigation

The navigation in the main canvas is similar to other graph editors such as Shadergraph or the animator. You can zoom in/out using scroll wheel, move by click & drag on the mouse scroll wheel. Nodes can be selected by clicking on it, by drawing a selection rectangle, or by using Ctrl + click. You can drag selected nodes to move them.

You cannot select or interact with links: they are 100% visual. To add a link, you must click and drag from an output, links cannot be created backwards. To remove a link you must remove one of the nodes it connect, click the red cross on its left, or connect another link to the same output node. There is a header on the top of each window containing information and buttons to save, save as, reload the graph, export all the export nodes, or show/hide stats on each node.

To create a new node, just right click on the canvas and a context menu will appear. You can also start building a link and releasing the mouse left button in a free space, the same context menu will appear and the link will be associated with the first input (if there is any) of the added node. You can cancel by pressing ESC.


Some nodes contain one or several parameters. You can change their value as a text edit or as a slider with the mouse.

Once you are happy with a node's clip, you can export it as a static wav clip using an Export node. You can use as many Export nodes as you want. So far, Sampl only supports WAV export.

You can browse the path by clicking on the Folder icon. Make sure you select a path included in the Assets folder of your project.

Nodes list

Multiply

Multiplies two inputs. The Multiplier parameter can adjust the output gain.

Add

Adds the two inputs

Subtract

Subtracts the input A with input B

Clamp

Clamps the input in the given range

Invert

Inverts the phase

ShiftScale

Lerp

Warp

Reverse

Remap

Equalizer

Reverb

Delay

Maximize

Enveloppe

Resample

Fade

Widen

Constant

Noise

SineWave

Sawtooth

TriangleWave

SquareWave

SineRamp

DynamicSine

AudioClip

Outputs the given RenderTexture. If the render texture size is different than the one defined in the graph settings, the input texture will appear bigger/smaller accordingly on the children nodes.

Kick

Pad

Piano

Curve

Export

Troubleshooting

The graph is frozen, spams errors and no nodes are showing up

The Unity Editor can sometimes free up memory and delete some nodes audio clips. Try to change tab if it is docked, right click on the frozen sampl graph tab and select "close tab". Reopening the graph should solve the issue.

Contact

Feel free to contact me via e-mail: chaumartinleo@gmail.com