Compare commits

...

6 Commits
master ... gui

Author SHA1 Message Date
Gordon JC Pearce
d512c6b4ff peacock graphics 2024-12-31 21:52:21 +00:00
Gordon JC Pearce
3260430800 deleted file 2024-09-12 20:19:21 +01:00
Gordon JC Pearce
47dc94531f removed aboutwindow 2024-09-12 17:13:05 +01:00
Gordon JC Pearce
0f0a592295 removed file 2024-09-12 17:03:13 +01:00
Gordon JC Pearce
c722ee7e96 initial attempt at GUI 2024-09-12 16:23:48 +01:00
Gordon JC Pearce
cdca13f412 workingish highpass filter 2024-09-12 15:10:16 +01:00
11 changed files with 35543 additions and 5 deletions

View File

@ -28,6 +28,7 @@
#define DISTRHO_PLUGIN_IS_RT_SAFE 1
#define DISTRHO_PLUGIN_WANT_PROGRAMS 1
#define DISTRHO_PLUGIN_HAS_UI 1
enum Parameters {
paramProg,

View File

@ -15,9 +15,17 @@ FILES_DSP = \
chassis.cpp \
voice.cpp
FILES_UI = \
peacock.cpp \
ui.cpp
UI_TYPE = generic
USE_FILE_BROWSER = false
SKIP_NATIVE_AUDIO_FALLBACK = true
include ../dpf/Makefile.plugins.mk
TARGETS += jack lv2
TARGETS += jack lv2_sep
all: $(TARGETS)

19800
plugin/back.cpp Normal file

File diff suppressed because it is too large Load Diff

11
plugin/back.hpp Normal file
View File

@ -0,0 +1,11 @@
#ifndef _BACK_HPP
#define _BACK_HPP
namespace Artwork {
extern const char *backgroundData;
const unsigned int backgroundDataSize = 677980;
const unsigned int backgroundWidth = 545;
const unsigned int backgroundHeight = 311;
} // namespace Artwork
#endif

View File

@ -159,6 +159,27 @@ void Chassis::run(const float **, float **outputs, uint32_t frames, const MidiEv
s.blockLeft -= sizeThisTime;
}
// highpass filter
float tmp = s.hptmp;
float smp, flt=0;
float cut_tbl[4] = {0.91245, 0.97097, 1, 0.99088};
float cut = cut_tbl[(s.patchRam.switch2 & 0x18) >> 3];
float gain_tbl[4] = {-1, -1, 0, 4};
float gain = gain_tbl[(s.patchRam.switch2 & 0x18) >> 3];
// printf("hp= %02x\n", (s.patchRam.switch2 & 0x18)>>3);
for (uint32_t i = 0; i < frames; i++) {
smp = outputs[0][i];
flt = ((tmp - smp) * cut) + smp;
tmp = flt;
outputs[0][i] = ((flt * gain) + smp);
}
s.hptmp = flt;
// copy left to right
memmove(outputs[1], outputs[0], sizeof(float) * frames);
// outputs[1][1]=1;

View File

@ -149,7 +149,7 @@ void Chassis::initParameter(uint32_t index, Parameter& parameter) {
parameter.name = "HPF";
parameter.symbol = "ch_hpf";
parameter.ranges.min = 0.0f;
parameter.ranges.max = 3.0f;
parameter.ranges.max = 3.9f;
parameter.ranges.def = 0.0f;
parameter.midiCC = 20;
break;
@ -397,9 +397,10 @@ void Chassis::setParameterValue(uint32_t index, float value) {
case paramHPF: // bits 3-4 of switch 2
// doesn't look great in Carla because of odd behaviour with small integer knobs
printf("setPV %d %f\n", index, value);
if (value > 3) value = 3;
s.patchRam.switch2 &= 0xf3;
s.patchRam.switch2 |= (int)value << 3;
s.patchRam.switch2 &= 0xe7;
s.patchRam.switch2 |= (3-(int)value )<< 3;
break;
case paramModWheel:
@ -452,7 +453,7 @@ float Chassis::getParameterValue(uint32_t index) const {
return s.patchRam.noise;
break;
case paramHPF:
return (s.patchRam.switch2 & 0x18) >> 3;
return 3-((s.patchRam.switch2 & 0x18) >> 3);
break;
case paramVCFFreq:
return s.patchRam.vcfFreq;

15620
plugin/peacock.cpp Normal file

File diff suppressed because it is too large Load Diff

15
plugin/peacock.hpp Normal file
View File

@ -0,0 +1,15 @@
#pragma once
namespace Artwork {
/*
extern const char *orangeData;
const uint32_t orangeDataSize = 38*17*3;
const uint32_t orangeWidth = 38;
const uint32_t orangeHeight = 17;
*/
extern const char *backgroundData;
const unsigned int backgroundDataSize = 700*400*3;
const unsigned int backgroundWidth = 700;
const unsigned int backgroundHeight = 400;
} // namespace Artwork

32
plugin/ui.cpp Normal file
View File

@ -0,0 +1,32 @@
#include "ui.hpp"
#include "chassis.hpp"
START_NAMESPACE_DISTRHO
namespace Art = Artwork;
DistrhoUIchassis::DistrhoUIchassis() : UI(Art::backgroundWidth, Art::backgroundHeight, true),
// UI
fImgBackground(Art::backgroundData, Art::backgroundWidth, Art::backgroundHeight, kImageFormatRGB)
{
}
void DistrhoUIchassis::programLoaded(uint32_t index) {
//printf("in programLoaded %d\n", index);
}
void DistrhoUIchassis::parameterChanged(uint32_t index, float value) {
//printf("in parameterchanged %d %f\n", index, value);
}
void DistrhoUIchassis::onDisplay() {
const GraphicsContext& context(getGraphicsContext());
fImgBackground.draw(context);
};
UI* createUI() {
return new DistrhoUIchassis();
}
END_NAMESPACE_DISTRHO

28
plugin/ui.hpp Normal file
View File

@ -0,0 +1,28 @@
#ifndef _UI_HPP
#define _UI_HPP
#include "DistrhoUI.hpp"
#include "ImageWidgets.hpp"
#include "peacock.hpp"
START_NAMESPACE_DISTRHO
class DistrhoUIchassis : public UI {
public:
DistrhoUIchassis();
protected:
void parameterChanged(uint32_t index, float value) override;
void programLoaded(uint32_t index) override;
void onDisplay() override;
private:
Image fImgBackground;
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(DistrhoUIchassis)
// ImageAboutWindow fAboutWindow;
};
END_NAMESPACE_DISTRHO
#endif

View File

@ -133,6 +133,7 @@ class Synth {
} patchRam;
float pitchCV[104];
float hptmp;
void runLFO();
void lfoDelay();