From d54ea55ba7e891d3ead21ca2852a565fdeedff83 Mon Sep 17 00:00:00 2001 From: dennisppaul Date: Sat, 25 May 2024 07:52:51 +0200 Subject: [PATCH] Update ExampleDSP07Sampler.java updated comment --- .../src/wellen/examples/DSP/ExampleDSP07Sampler.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/processing-library/wellen/src/wellen/examples/DSP/ExampleDSP07Sampler.java b/processing-library/wellen/src/wellen/examples/DSP/ExampleDSP07Sampler.java index f24ef35..9a3deb1 100644 --- a/processing-library/wellen/src/wellen/examples/DSP/ExampleDSP07Sampler.java +++ b/processing-library/wellen/src/wellen/examples/DSP/ExampleDSP07Sampler.java @@ -17,6 +17,14 @@ public class ExampleDSP07Sampler extends PApplet { * * note that samples can either be played once or looped. if a sample is played once it must be rewound before it * can be played again. also note that a sample buffer can be cropped with `set_in()` + `set_out()`. + * + * samples can be loaded from external sources as *raw* bytes with `loadBytes(byte[])`. the raw format needs to be in + * the 32bit IEEE float format and only contain a single channel ( i.e mono ). tools like + * [Audacity](https://www.audacityteam.org) or [FFmpeg](https://ffmpeg.org) can be used to generate it. e.g the latter + * can be used to convert sound file to *raw* bytes with the following command where `INPUT_FILE`, `OUTPUT_FILE` and + * `OUTPUT_SAMPLLE_RATE` need to be adjusted: + * + * `ffmpeg -i $INPUT_FILE -f f32le -acodec pcm_f32le -ac 1 -ar $OUTPUT_SAMPLLE_RATE "$OUTPUT_FILE.raw"` */ private Sampler fSampler;