Mercurial > hg > beaglert
diff projects/basic_passthru/render.cpp @ 269:ac8eb07afcf5
Oxygen text added to each render.cpp file for the default projects. Text includes project explanation from Wiki, edited in places.
Empty project added as a default project.
Doxyfile updated. Each of the project locations added to INPUT configuration option. Consider just watching the whole project file so all new projects are automatically pulled through.
author | Robert Jack <robert.h.jack@gmail.com> |
---|---|
date | Tue, 17 May 2016 15:40:16 +0100 |
parents | 07cfd337ad18 |
children | 5433c83ce04e |
line wrap: on
line diff
--- a/projects/basic_passthru/render.cpp Wed May 11 10:29:23 2016 +0100 +++ b/projects/basic_passthru/render.cpp Tue May 17 15:40:16 2016 +0100 @@ -1,10 +1,50 @@ /* + ____ _____ _ _ +| __ )| ____| | / \ +| _ \| _| | | / _ \ +| |_) | |___| |___ / ___ \ +|____/|_____|_____/_/ \_\.io + + */ + + /* * render.cpp * * Created on: Oct 24, 2014 * Author: parallels */ +/** +\example 1_basic_audio_passthrough + +Audio passthrough: input to output +----------------------------------------- + +This sketch demonstrates the simplest possible case of using audio: it passes +audio input straight to audio output. + +Note the nested `for` loop structure. You will see this in all Bela projects. The +first `for` loop cycles through the audio frames, the second through each of the +audio channels (in this case left 0 and right 1). + + +We write samples to the audio output buffer like this: +`context->audioOut[n * context->audioChannels + ch]` where `n` is the current audio +frame and `ch` is the current channel, both provided by the nested for loop structure. + +We can access samples in the audio input buffer in a similar way, like this: +`context->audioIn[n * context->audioChannels + ch]`. + +So a simple audio pass through is achieved by setting output buffer equal to +input buffer: +`context->audioOut[n * context->audioChannels + ch] = context->audioIn[n * context->audioChannels + ch]`. + + +*/ + + + + #include <BeagleRT.h> #include <Utilities.h>