mirror of
https://github.com/AquaMorph/Droplets.git
synced 2025-04-30 01:35:34 +00:00
Updated libs
This commit is contained in:
parent
39338325e6
commit
77893f3e1e
3
Makefile
3
Makefile
@ -15,3 +15,6 @@ daisysp:
|
|||||||
cd $(DAISYSP_DIR) && make
|
cd $(DAISYSP_DIR) && make
|
||||||
lib: libdaisy daisysp
|
lib: libdaisy daisysp
|
||||||
deploy: lib all program
|
deploy: lib all program
|
||||||
|
updatelib:
|
||||||
|
cd $(LIBDAISY_DIR) && make clean && git pull origin master
|
||||||
|
cd $(DAISYSP_DIR) && make clean && git pull origin master
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 3ca6b0a73d835f568d9260e8110f7595f219f133
|
Subproject commit bb80c4c10b87dfce3835f6dfb42e7c789f91eef6
|
@ -1 +1 @@
|
|||||||
Subproject commit 73213d45086bee6d88533752740acdf01e1a9dda
|
Subproject commit 7a5ea84dbe0f64ac5dc9d93c40ad68bebaa9ec75
|
@ -34,7 +34,7 @@ size_t Droplet::GetChannelMax() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Droplet::DrawName(std::string name) {
|
void Droplet::DrawName(std::string name) {
|
||||||
WriteCenteredString(*patch, (screen_min + screen_max) / 2, 0,
|
WriteCenteredString(patch, (screen_min + screen_max) / 2, 0,
|
||||||
Font_6x8, name);
|
Font_6x8, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ public:
|
|||||||
* @param out the audio outputs for the patch
|
* @param out the audio outputs for the patch
|
||||||
* @param size the number of inputs and outputs
|
* @param size the number of inputs and outputs
|
||||||
*/
|
*/
|
||||||
virtual void Process(float** in,
|
virtual void Process(AudioHandle::InputBuffer in,
|
||||||
float** out,
|
AudioHandle::OutputBuffer out,
|
||||||
size_t size)=0;
|
size_t size)=0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -9,7 +9,7 @@ NoiseDroplet::NoiseDroplet(DaisyPatch* m_patch,
|
|||||||
|
|
||||||
void NoiseDroplet::Control() {}
|
void NoiseDroplet::Control() {}
|
||||||
|
|
||||||
void NoiseDroplet::Process(float** in, float** out, size_t size) {
|
void NoiseDroplet::Process(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size) {
|
||||||
for (size_t i = 0; i < size; i += 2) {
|
for (size_t i = 0; i < size; i += 2) {
|
||||||
float sig = noise.Process();
|
float sig = noise.Process();
|
||||||
for (size_t chn = GetChannelMin(); chn < GetChannelMax(); chn++) {
|
for (size_t chn = GetChannelMin(); chn < GetChannelMax(); chn++) {
|
||||||
|
@ -33,8 +33,8 @@ public:
|
|||||||
* @param out the audio outputs for the patch
|
* @param out the audio outputs for the patch
|
||||||
* @param size the number of inputs and outputs
|
* @param size the number of inputs and outputs
|
||||||
*/
|
*/
|
||||||
void Process(float** in,
|
void Process(AudioHandle::InputBuffer in,
|
||||||
float** out,
|
AudioHandle::OutputBuffer out,
|
||||||
size_t size);
|
size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -48,7 +48,7 @@ void VCODroplet::Control() {
|
|||||||
AdjustWaveShape(Patch()->encoder.Increment());
|
AdjustWaveShape(Patch()->encoder.Increment());
|
||||||
}
|
}
|
||||||
|
|
||||||
void VCODroplet::Process(float** in, float** out, size_t size) {
|
void VCODroplet::Process(AudioHandle::InputBuffer in, AudioHandle::OutputBuffer out, size_t size) {
|
||||||
float sig, freq, amp = 1.0;
|
float sig, freq, amp = 1.0;
|
||||||
|
|
||||||
Patch()->ProcessAnalogControls();
|
Patch()->ProcessAnalogControls();
|
||||||
@ -79,13 +79,13 @@ void VCODroplet::Process(float** in, float** out, size_t size) {
|
|||||||
void VCODroplet::Draw() {
|
void VCODroplet::Draw() {
|
||||||
SetWaveState(wave);
|
SetWaveState(wave);
|
||||||
if (GetState() == DropletState::kFull) {
|
if (GetState() == DropletState::kFull) {
|
||||||
WriteCenteredString(*Patch(),
|
WriteCenteredString(Patch(),
|
||||||
(GetScreenMax()-GetScreenMin())/2,
|
(GetScreenMax()-GetScreenMin())/2,
|
||||||
54,
|
54,
|
||||||
Font_6x8,
|
Font_6x8,
|
||||||
WaveToString(wave));
|
WaveToString(wave));
|
||||||
} else {
|
} else {
|
||||||
WriteDoubleCentered(*Patch(),
|
WriteDoubleCentered(Patch(),
|
||||||
GetScreenMin() +
|
GetScreenMin() +
|
||||||
(GetScreenMax()-GetScreenMin())/2,
|
(GetScreenMax()-GetScreenMin())/2,
|
||||||
54,
|
54,
|
||||||
|
@ -67,8 +67,8 @@ public:
|
|||||||
* @param out the audio outputs for the patch
|
* @param out the audio outputs for the patch
|
||||||
* @param size the number of inputs and outputs
|
* @param size the number of inputs and outputs
|
||||||
*/
|
*/
|
||||||
void Process(float** in,
|
void Process(AudioHandle::InputBuffer in,
|
||||||
float** out,
|
AudioHandle::OutputBuffer out,
|
||||||
size_t size);
|
size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -73,8 +73,8 @@ void ProcessOled() {
|
|||||||
patch.display.Update();
|
patch.display.Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void AudioThrough(float **in,
|
static void AudioThrough(AudioHandle::InputBuffer in,
|
||||||
float **out,
|
AudioHandle::OutputBuffer out,
|
||||||
size_t size) {
|
size_t size) {
|
||||||
droplet_left->Process(in, out, size);
|
droplet_left->Process(in, out, size);
|
||||||
if (manager->GetSplitMode()) {
|
if (manager->GetSplitMode()) {
|
||||||
|
@ -46,8 +46,8 @@ void ProcessOutputs();
|
|||||||
* @param out the audio outputs for the patch
|
* @param out the audio outputs for the patch
|
||||||
* @param size the number of inputs and outputs
|
* @param size the number of inputs and outputs
|
||||||
*/
|
*/
|
||||||
static void AudioThrough(float** in,
|
static void AudioThrough(AudioHandle::InputBuffer in,
|
||||||
float** out,
|
AudioHandle::OutputBuffer out,
|
||||||
size_t size);
|
size_t size);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -56,12 +56,12 @@ void Menu::CreateMenuItem(std::string text,
|
|||||||
bool highlighted) {
|
bool highlighted) {
|
||||||
text.insert(text.end(), MAX_CHAR_LENGTH-text.size(), ' ');
|
text.insert(text.end(), MAX_CHAR_LENGTH-text.size(), ' ');
|
||||||
if (highlighted) {
|
if (highlighted) {
|
||||||
DrawSolidRect(*patch, 0, MENU_Y[2],
|
DrawSolidRect(patch, 0, MENU_Y[2],
|
||||||
SSD1309_WIDTH, MENU_Y[2]+17, true);
|
SSD1309_WIDTH, MENU_Y[2]+17, true);
|
||||||
WriteString(*patch, MENU_X[position-1], MENU_Y[position-1],
|
WriteString(patch, MENU_X[position-1], MENU_Y[position-1],
|
||||||
Font_11x18, text, !highlighted);
|
Font_11x18, text, !highlighted);
|
||||||
} else {
|
} else {
|
||||||
WriteString(*patch, MENU_X[position-1], MENU_Y[position-1],
|
WriteString(patch, MENU_X[position-1], MENU_Y[position-1],
|
||||||
Font_7x10, text, !highlighted);
|
Font_7x10, text, !highlighted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
20
src/util.cpp
20
src/util.cpp
@ -1,27 +1,27 @@
|
|||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
void DrawSolidRect(DaisyPatch patch,
|
void DrawSolidRect(DaisyPatch* patch,
|
||||||
uint8_t x1,
|
uint8_t x1,
|
||||||
uint8_t y1,
|
uint8_t y1,
|
||||||
uint8_t x2,
|
uint8_t x2,
|
||||||
uint8_t y2,
|
uint8_t y2,
|
||||||
bool on) {
|
bool on) {
|
||||||
for (int i = std::min(y1, y2); i <= std::max(y1, y2); i++) {
|
for (int i = std::min(y1, y2); i <= std::max(y1, y2); i++) {
|
||||||
patch.display.DrawLine(x1, i, x2, i, on);
|
patch->display.DrawLine(x1, i, x2, i, on);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteString(DaisyPatch patch,
|
void WriteString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
std::string text,
|
std::string text,
|
||||||
bool on) {
|
bool on) {
|
||||||
patch.display.SetCursor(x, y);
|
patch->display.SetCursor(x, y);
|
||||||
patch.display.WriteString(&text[0], font, on);
|
patch->display.WriteString(&text[0], font, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteString(DaisyPatch patch,
|
void WriteString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -29,7 +29,7 @@ void WriteString(DaisyPatch patch,
|
|||||||
WriteString(patch, x, y, font, text, true);
|
WriteString(patch, x, y, font, text, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteCenteredString(DaisyPatch patch,
|
void WriteCenteredString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -40,7 +40,7 @@ void WriteCenteredString(DaisyPatch patch,
|
|||||||
WriteString(patch, x - (text_width / 2), y, font, text, on);
|
WriteString(patch, x - (text_width / 2), y, font, text, on);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteCenteredString(DaisyPatch patch,
|
void WriteCenteredString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -48,7 +48,7 @@ void WriteCenteredString(DaisyPatch patch,
|
|||||||
WriteCenteredString(patch, x, y, font, text, true);
|
WriteCenteredString(patch, x, y, font, text, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteDoubleCentered(DaisyPatch patch,
|
void WriteDoubleCentered(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
@ -85,7 +85,7 @@ void WriteDoubleCentered(DaisyPatch patch,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WriteDoubleCentered(DaisyPatch patch,
|
void WriteDoubleCentered(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
|
16
src/util.h
16
src/util.h
@ -9,6 +9,8 @@
|
|||||||
|
|
||||||
using namespace daisy;
|
using namespace daisy;
|
||||||
|
|
||||||
|
#define SSD1309_WIDTH 128
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Draws a solid rectangle on screen.
|
* Draws a solid rectangle on screen.
|
||||||
*
|
*
|
||||||
@ -19,7 +21,7 @@ using namespace daisy;
|
|||||||
* @param y2 y coordinate of the second point
|
* @param y2 y coordinate of the second point
|
||||||
* @param on draw screen on or off
|
* @param on draw screen on or off
|
||||||
*/
|
*/
|
||||||
void DrawSolidRect(DaisyPatch patch,
|
void DrawSolidRect(DaisyPatch* patch,
|
||||||
uint8_t x1,
|
uint8_t x1,
|
||||||
uint8_t y1,
|
uint8_t y1,
|
||||||
uint8_t x2,
|
uint8_t x2,
|
||||||
@ -36,7 +38,7 @@ void DrawSolidRect(DaisyPatch patch,
|
|||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
* @param on draw screen on or off
|
* @param on draw screen on or off
|
||||||
*/
|
*/
|
||||||
void WriteString(DaisyPatch patch,
|
void WriteString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -52,7 +54,7 @@ void WriteString(DaisyPatch patch,
|
|||||||
* @param font text font
|
* @param font text font
|
||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
*/
|
*/
|
||||||
void WriteString(DaisyPatch patch,
|
void WriteString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -68,7 +70,7 @@ void WriteString(DaisyPatch patch,
|
|||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
* @param on draw screen on or off
|
* @param on draw screen on or off
|
||||||
*/
|
*/
|
||||||
void WriteCenteredString(DaisyPatch patch,
|
void WriteCenteredString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -84,7 +86,7 @@ void WriteCenteredString(DaisyPatch patch,
|
|||||||
* @param font text font
|
* @param font text font
|
||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
*/
|
*/
|
||||||
void WriteCenteredString(DaisyPatch patch,
|
void WriteCenteredString(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
FontDef font,
|
FontDef font,
|
||||||
@ -101,7 +103,7 @@ void WriteCenteredString(DaisyPatch patch,
|
|||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
* @param on draw screen on or off
|
* @param on draw screen on or off
|
||||||
*/
|
*/
|
||||||
void WriteDoubleCentered(DaisyPatch patch,
|
void WriteDoubleCentered(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
@ -119,7 +121,7 @@ void WriteDoubleCentered(DaisyPatch patch,
|
|||||||
* @param font text font
|
* @param font text font
|
||||||
* @param text text to be written
|
* @param text text to be written
|
||||||
*/
|
*/
|
||||||
void WriteDoubleCentered(DaisyPatch patch,
|
void WriteDoubleCentered(DaisyPatch* patch,
|
||||||
int x,
|
int x,
|
||||||
int y,
|
int y,
|
||||||
int width,
|
int width,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user