-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ff1b62d
commit e132eb6
Showing
5 changed files
with
59 additions
and
1 deletion.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include "DashedLineEffect.h" | ||
|
||
DashedLineEffect::DashedLineEffect() {} | ||
|
||
DashedLineEffect::~DashedLineEffect() {} | ||
|
||
Point DashedLineEffect::apply(int index, Point vector, const std::vector<double>& values, double sampleRate) { | ||
// dash length in seconds | ||
double dashLength = values[0] / 400; | ||
int dashLengthSamples = (int)(dashLength * sampleRate); | ||
dashLengthSamples = juce::jmin(dashLengthSamples, MAX_BUFFER); | ||
|
||
if (dashIndex >= dashLengthSamples) { | ||
dashIndex = 0; | ||
bufferIndex = 0; | ||
} | ||
|
||
buffer[bufferIndex] = vector; | ||
bufferIndex++; | ||
|
||
vector = buffer[dashIndex]; | ||
|
||
if (index % 2 == 0) { | ||
dashIndex++; | ||
} | ||
|
||
return vector; | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#pragma once | ||
#include "EffectApplication.h" | ||
#include "../shape/Point.h" | ||
|
||
class DashedLineEffect : public EffectApplication { | ||
public: | ||
DashedLineEffect(); | ||
~DashedLineEffect(); | ||
|
||
Point apply(int index, Point input, const std::vector<double>& values, double sampleRate) override; | ||
|
||
private: | ||
const static int MAX_BUFFER = 192000; | ||
std::vector<Point> buffer = std::vector<Point>(MAX_BUFFER); | ||
int dashIndex = 0; | ||
int bufferIndex = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
pluginCharacteristicsValue="pluginProducesMidiOut,pluginWantsMidiIn" | ||
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender" | ||
cppLanguageStandard="20" projectLineFeed=" " headerPath="./include" | ||
version="2.0.8" companyName="James H Ball" companyWebsite="https://osci-render.com" | ||
version="2.1.0" companyName="James H Ball" companyWebsite="https://osci-render.com" | ||
companyEmail="[email protected]" defines="NOMINMAX=1"> | ||
<MAINGROUP id="j5Ge2T" name="osci-render"> | ||
<GROUP id="{5ABCED88-0059-A7AF-9596-DBF91DDB0292}" name="Resources"> | ||
|
@@ -141,6 +141,10 @@ | |
<FILE id="uvMCNC" name="CustomEffect.cpp" compile="1" resource="0" | ||
file="Source/audio/CustomEffect.cpp"/> | ||
<FILE id="qFZDUh" name="CustomEffect.h" compile="0" resource="0" file="Source/audio/CustomEffect.h"/> | ||
<FILE id="JtasnQ" name="DashedLineEffect.cpp" compile="1" resource="0" | ||
file="Source/audio/DashedLineEffect.cpp"/> | ||
<FILE id="I7B78q" name="DashedLineEffect.h" compile="0" resource="0" | ||
file="Source/audio/DashedLineEffect.h"/> | ||
<FILE id="e6SZox" name="DelayEffect.cpp" compile="1" resource="0" file="Source/audio/DelayEffect.cpp"/> | ||
<FILE id="kpI9pv" name="DelayEffect.h" compile="0" resource="0" file="Source/audio/DelayEffect.h"/> | ||
<FILE id="DiIoN4" name="DistortEffect.cpp" compile="1" resource="0" | ||
|