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
/* (Not so) simple synth based on Mozzi library and a bunch of pots. | |
* | |
* This code is derived from the public domain example of an 8 potentiometer | |
* synth from e-licktronic (https://www.youtube.com/watch?v=wH-xWqpa9P8). | |
* | |
* Severely edited for clarity and configurability, adjusted to run with modern | |
* versions of Mozzi, extended for polyphony by Thomas Friedrichsmeier. Also, | |
* this sketch will auto-generate fake MIDI events and random parameters, so | |
* you can start listening without connecting anything other than your | |
* headphones or amplifier. (Remove the FAKE_POTS and FAKE_MIDI defines, once |
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
/* Reading from a rotary encoder, with software debouncing. | |
* Works even on cheap quadrature encoders without any hardware debouncing, _reliably_. */ | |
#define ENCODER_PIN_A PA1 // Input pins. NOTE That these _must_ support intterupts, _and_ interrupts must not interfere with other pins | |
#define ENCODER_PIN_B PA2 // // (e.g. on STM32F103C8T6, PAx will interfere with PBx) | |
#define BOUNCE_TIMEOUT 2 // ms | |
#define USER_INPUT_HIGHER_RES 0 // You probably want this: Gives lower granularity at higher values | |
volatile uint16_t pin_a_change_time; | |
volatile uint16_t pin_b_change_time; |
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
<html> | |
<body> | |
<p> | |
The actual canvas, where drawing happens. Mouse over to move the green open circle object. | |
</p> | |
<canvas id="canvas" width=200 height=200></canvas> | |
<p id="result"> | |
</p> | |
<p id="timing"> |