Mercurial > hg > beaglert
comparison projects/basic/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 |
comparison
equal
deleted
inserted
replaced
252:381f352c44eb | 269:ac8eb07afcf5 |
---|---|
1 /* | |
2 ____ _____ _ _ | |
3 | __ )| ____| | / \ | |
4 | _ \| _| | | / _ \ | |
5 | |_) | |___| |___ / ___ \ | |
6 |____/|_____|_____/_/ \_\.io | |
7 | |
8 */ | |
9 | |
1 /* | 10 /* |
2 * render.cpp | 11 * render.cpp |
3 * | 12 * |
4 * Created on: Oct 24, 2014 | 13 * Created on: Oct 24, 2014 |
5 * Author: parallels | 14 * Author: parallels |
6 */ | 15 */ |
16 | |
17 /** | |
18 \example 1_basic_helloworld | |
19 | |
20 Producing your first bleep! | |
21 --------------------------- | |
22 | |
23 This sketch is the hello world of embedded interactive audio. Better known as bleep, it | |
24 produces a sine tone. | |
25 | |
26 The frequency of the sine tone is determined by a global variable, `gFrequency` | |
27 (line 12). The sine tone is produced by incrementing the phase of a sin function | |
28 on every audio frame. | |
29 | |
30 The important thing to notice is the nested `for` loop structure. You will see | |
31 this in all Bela projects and in most digital audio applications. The first `for` | |
32 loop cycles through the audio frames, the second through each of the audio | |
33 channels (in this case left 0 and right 1). It is good to familiarise yourself | |
34 with this structure as it is fundamental to producing sound with the system. | |
35 */ | |
7 | 36 |
8 | 37 |
9 #include <BeagleRT.h> | 38 #include <BeagleRT.h> |
10 #include <cmath> | 39 #include <cmath> |
11 #include <Utilities.h> | 40 #include <Utilities.h> |
20 // | 49 // |
21 // userData holds an opaque pointer to a data structure that was passed | 50 // userData holds an opaque pointer to a data structure that was passed |
22 // in from the call to initAudio(). | 51 // in from the call to initAudio(). |
23 // | 52 // |
24 // Return true on success; returning false halts the program. | 53 // Return true on success; returning false halts the program. |
25 | |
26 bool setup(BeagleRTContext *context, void *userData) | 54 bool setup(BeagleRTContext *context, void *userData) |
27 { | 55 { |
28 // Retrieve a parameter passed in from the initAudio() call | 56 // Retrieve a parameter passed in from the initAudio() call |
29 if(userData != 0) | 57 if(userData != 0) |
30 gFrequency = *(float *)userData; | 58 gFrequency = *(float *)userData; |