-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
07b3d6a
commit b9e96f1
Showing
22 changed files
with
358 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
processing-library/wellen/examples/basics/ExampleBasics07Sampler/ExampleBasics07Sampler.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import wellen.*; | ||
import wellen.dsp.*; | ||
|
||
/* | ||
* this example demonstrates how to load and play a sample with Tone. | ||
*/ | ||
Sampler mSampler; | ||
void settings() { | ||
size(640, 480); | ||
} | ||
void setup() { | ||
mSampler = Tone.load_sample(SampleDataSNARE.data); | ||
// alternatively load data with `loadBytes("audio.raw")` ( raw format, 32bit IEEE float ) | ||
} | ||
void draw() { | ||
background(255); | ||
fill(0); | ||
ellipse(width * 0.5f, height * 0.5f, mSampler.is_playing() ? 100 : 5, mSampler.is_playing() ? 100 : 5); | ||
} | ||
void keyPressed() { | ||
if (key == 'l') { | ||
mSampler.enable_loop(false); | ||
} | ||
if (key == 'L') { | ||
mSampler.enable_loop(true); | ||
mSampler.set_loop_all(); | ||
} | ||
} | ||
void mousePressed() { | ||
mSampler.trigger(); | ||
} | ||
void mouseReleased() { | ||
mSampler.stop(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.