Skip to content

Commit acdbffa

Browse files
authored
Merge pull request #102 from pingdynasty/feature/ci-build-patches
Feature/ci build patches
2 parents 71200e9 + 9ab6b73 commit acdbffa

26 files changed

Lines changed: 4687 additions & 22 deletions

.github/workflows/c-cpp.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ jobs:
2323
uses: mymindstorm/setup-emsdk@v7
2424
with:
2525
version: 2.0.10
26+
- name: Setup python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: 2.7
2630
- name: make
2731
run: make
2832
- name: make check

.gitmodules

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
path = Libraries/DaisySP
33
url = https://github.com/electro-smith/DaisySP.git
44
branch = master
5+
[submodule "Tools/hvcc"]
6+
path = Tools/hvcc
7+
url = https://github.com/pingdynasty/hvcc.git
8+
branch = develop

GenSource/GenPatch.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "Patch.h"
55
#include "gen.h"
6+
#include "genlib.h"
67
#include "PatchMetadata.h"
78

89
#if __has_include("metadata.h")
@@ -105,8 +106,8 @@ class GenParameter : public GenParameterBase {
105106
public:
106107
PatchParameterId pid;
107108
int8_t index;
108-
float min = 0.0;
109-
float max = 1.0;
109+
float min = 0.0f;
110+
float max = 1.0f;
110111
GenParameter(Patch* patch, CommonState *context, const char* name, PatchParameterId id, int8_t idx) : pid(id), index(idx) {
111112
#ifndef OWL_METADATA
112113
patch->registerParameter(id, name);
@@ -222,7 +223,7 @@ class GenPatch : public Patch {
222223
for(int ch=channels; ch<gen::num_outputs(); ++ch)
223224
buffers[ch] = new float[getBlockSize()];
224225

225-
size_t nof_outs = gen::num_outputs()-min(gen::num_outputs(), channels);
226+
size_t nof_outs = gen::num_outputs()-std::min((size_t)gen::num_outputs(), channels);
226227
// debugMessage("outs", (int)channels, nof_outs, sizeof(OutputParameter[nof_outs]));
227228
if(nof_outs > 0)
228229
outputs = SimpleArray<OutputParameter>(new OutputParameter[nof_outs], nof_outs);

GenSource/genlib.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,4 +463,17 @@ short genlib_setstate(CommonState *cself, const char *state, setparameter_method
463463

464464
return 0;
465465
}
466+
#else
467+
short genlib_setstate(CommonState *cself, const char *state, setparameter_method setmethod)
468+
{
469+
return 0;
470+
}
471+
short genlib_getstate(CommonState *cself, char *state, getparameter_method getmethod)
472+
{
473+
return 0;
474+
}
475+
size_t genlib_getstatesize(CommonState *cself, getparameter_method getmethod)
476+
{
477+
return 0;
478+
}
466479
#endif

HISTORY.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Block based SineOscillator::generate() with FM
2+
* Added test patches for automatic CI builds
13
* Automatically add '>' to end of gen~ output parameters
24
* Updated to use C++17
35
* Use std::min/max/abs/clamp instead of macros for C++

LibSource/AbstractSynth.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,31 +70,31 @@ class AbstractSynth : public Synth, public MidiProcessor, public VelocityCurve {
7070
mod_range = range / 127.0f;
7171
}
7272
// MIDI handlers
73-
virtual void noteOn(MidiMessage msg) override {
73+
virtual void noteOn(MidiMessage msg) {
7474
setNote(msg.getNote());
7575
setFrequency(noteToFrequency(note+pb));
7676
setGain(velocityToGain(msg.getVelocity()));
7777
gate(true);
7878
}
79-
virtual void noteOff(MidiMessage msg) override {
79+
virtual void noteOff(MidiMessage msg) {
8080
gate(false);
8181
}
82-
virtual void controlChange(MidiMessage msg) override {
82+
virtual void controlChange(MidiMessage msg) {
8383
if(msg.getControllerNumber() == MIDI_CC_MODULATION)
8484
setModulation(msg.getControllerValue()/128.0f);
8585
else if(msg.getControllerNumber() == MIDI_ALL_NOTES_OFF)
8686
allNotesOff();
8787
}
88-
virtual void channelPressure(MidiMessage msg) override {
88+
virtual void channelPressure(MidiMessage msg) {
8989
setPressure(msg.getChannelPressure()/128.0f);
9090
}
91-
virtual void polyKeyPressure(MidiMessage msg) override {
91+
virtual void polyKeyPressure(MidiMessage msg) {
9292
setPressure(msg.getPolyKeyPressure()/128.0f);
9393
}
94-
virtual void modulate(MidiMessage msg) override {
94+
virtual void modulate(MidiMessage msg) {
9595
setModulation(mod_range * msg.getControllerValue());
9696
}
97-
virtual void pitchbend(MidiMessage msg) override {
97+
virtual void pitchbend(MidiMessage msg) {
9898
setPitchBend(pb_range * msg.getPitchBend());
9999
}
100100
virtual void allNotesOff(){

LibSource/MonochromeScreenPatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ void MonochromeScreenBuffer::fade(uint16_t steps){
8888

8989
template<>
9090
void MonochromeScreenBuffer::fill(Colour c) {
91-
memset(pixels, c, height*width/8);
91+
memset(pixels, c == WHITE ? 0xff : 0x00, height*width/8);
9292
// for(unsigned int i=0; i<height*width; ++i)
9393
// pixels[i] = c;
9494
}

LibSource/ShortFastFourierTransform.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void ShortFastFourierTransform::ifft(ComplexShortArray in, ShortArray out){
3434
arm_rfft_q15(&instance, (int16_t*)in.getData(), (int16_t*)out.getData());
3535
}
3636

37-
int ShortFastFourierTransform::getSize(){
37+
size_t ShortFastFourierTransform::getSize(){
3838
return len;
3939
}
4040

@@ -78,7 +78,7 @@ void ShortFastFourierTransform::ifft(ComplexShortArray input, ShortArray output)
7878
}
7979
}
8080

81-
int ShortFastFourierTransform::getSize(){
81+
size_t ShortFastFourierTransform::getSize(){
8282
return temp.getSize();
8383
}
8484

LibSource/ShortFastFourierTransform.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class ShortFastFourierTransform {
7373
* Get the size of the FFT
7474
* @return The size of the FFT
7575
*/
76-
int getSize();
76+
size_t getSize();
7777
};
7878

7979
#endif // __ShortFastFourierTransform_h__

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ PATCHNAME ?= $(SOUL)
4545
PATCHCLASS ?= SoulPatch
4646
PATCHFILE ?= SoulPatch.hpp
4747
SOULCLASS ?= $(SOUL)
48+
ifneq ("$(wildcard $(PATCHSOURCE)/$(SOUL).soulpatch)","")
4849
SOULFILE ?= $(SOUL).soulpatch
50+
else
51+
SOULFILE ?= $(SOUL).soul
52+
endif
4953
SOULHPP ?= $(SOUL).hpp
5054
DEPS += soul
5155
else ifdef TEST
@@ -181,10 +185,17 @@ run: $(DEPS) ## run patch natively
181185
grind: $(DEPS) ## run valgrind on patch natively
182186
@$(MAKE) -s -f native.mk grind
183187

184-
check: ## run test patches and unit tests natively
188+
check: ## run test patches and unit tests
185189
@for nm in $(TESTS) ; do \
186190
$(MAKE) -s TEST=$$nm test || exit;\
187191
done
192+
@unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/CppTest PATCHNAME=CppTest clean patch web run
193+
@unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/GenTest GEN=MIDItestMinMax clean patch web run
194+
# @unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/FaustTest FAUST=FaustTest clean patch web run # FAUST is not installed for CI
195+
@cp FaustSource/*.h TestPatches/FaustTest && unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/FaustTest PATCHNAME=Faust clean patch web run
196+
# @unset PATCHNAME PATCHCLASS PATCHFILE SOULCLASS SOULFILE SOULHPP && $(MAKE) PATCHSOURCE=TestPatches/SoulTest SOUL=SineSynth clean patch web run # SOUL is not installed for CI
197+
@unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/SoulTest PATCHNAME=Soul clean patch web run
198+
@pip install -r Tools/hvcc/requirements.txt && unset PATCHNAME PATCHCLASS PATCHFILE && $(MAKE) PATCHSOURCE=TestPatches/HeavyTest HEAVY=HeavyTest clean patch web run
188199

189200
help: ## show this help
190201
@echo 'Usage: make [target] ...'

0 commit comments

Comments
 (0)