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
/* | |
* File: smplefm.cpp | |
* | |
* Simple FM Synthesis | |
* | |
*/ | |
#include "userosc.h" | |
typedef struct State { |
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
#include "userosc.h" | |
typedef struct State { | |
float w0; | |
float phase; | |
uint8_t flags; | |
} State; | |
enum { | |
k_flags_none = 0, |
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
#include "audio_provider.h" | |
#include "micro_features/micro_model_settings.h" | |
#include <Arduino.h> | |
#include <M5Stack.h> | |
#include <driver/i2s.h> | |
#define ADC_INPUT ADC1_CHANNEL_6 //pin 34, for M5Stack Fire | |
#define PIN_MICROPHONE 34 | |
#define ADC_OFFSET (ADC_INPUT * 0x1000 + 0xFFF) | |
#define BACKLIGHT 32 |
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
#include "command_responder.h" | |
#include <M5Stack.h> | |
#include <Avatar.h> | |
using namespace m5avatar; | |
Avatar avatar; | |
void InitResponder() { | |
M5.begin(); | |
M5.Lcd.fillScreen(BLACK); |
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
[env:m5stack-fire] | |
platform = espressif32 | |
board = m5stack-fire | |
framework = arduino | |
monitor_speed = 115200 | |
build_flags = -DARDUINOSTL_M_H -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include -Ilib/tfmicro/third_party/kissfft |
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
#include "output_handler.h" | |
#include <Arduino.h> | |
#include <M5Stack.h> | |
void DrawWing() { | |
int x = 60; | |
int y = 20; | |
int w = 200; | |
int h = 200; | |
int t = 20; |
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
void loop() { | |
// Attempt to read new data from the accelerometer | |
bool got_data = ReadAccelerometer(error_reporter, model_input->data.f, | |
input_length, should_clear_buffer); | |
// Don't try to clear the buffer again | |
should_clear_buffer = false; | |
// If there was no new data, wait until next time | |
if (!got_data) return; | |
// Run inference, and report any error | |
TfLiteStatus invoke_status = interpreter->Invoke(); |
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
import tensorflow as tf | |
seq_length = 128 | |
model = tf.keras.Sequential([ | |
tf.keras.layers.Conv2D( | |
8, (4, 3), | |
padding="same", | |
activation="relu", | |
input_shape=(seq_length, 3, 1)), # output_shape=(batch, 128, 3, 8) |
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
[env:m5stack-fire] | |
platform = espressif32 | |
board = m5stack-fire | |
framework = arduino | |
monitor_speed = 115200 | |
build_flags = -DARDUINOSTL_M_H -Ilib/tfmicro/third_party/gemmlowp -Ilib/tfmicro/third_party/flatbuffers/include |
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
extern TfLiteStatus SetupAccelerometer(tflite::ErrorReporter* error_reporter); | |
extern bool ReadAccelerometer(tflite::ErrorReporter* error_reporter, | |
float* input, int length, bool reset_buffer); |
NewerOlder