Drag and drop to open .sosci, apply smoothing and flip to sweep

pull/281/head
James H Ball 2025-02-01 18:45:35 +00:00
rodzic 146cd27a29
commit 200fc1775a
4 zmienionych plików z 35 dodań i 22 usunięć

Wyświetl plik

@ -86,7 +86,8 @@ bool SosciPluginEditor::isInterestedInFileDrag(const juce::StringArray& files) {
file.hasFileExtension("mp3") ||
file.hasFileExtension("aiff") ||
file.hasFileExtension("flac") ||
file.hasFileExtension("ogg");
file.hasFileExtension("ogg") ||
file.hasFileExtension("sosci");
}
void SosciPluginEditor::filesDropped(const juce::StringArray& files, int x, int y) {
@ -94,7 +95,12 @@ void SosciPluginEditor::filesDropped(const juce::StringArray& files, int x, int
return;
}
juce::File file(files[0]);
audioProcessor.loadAudioFile(file);
if (file.hasFileExtension("sosci")) {
openProject(file);
} else {
audioProcessor.loadAudioFile(file);
}
}
void SosciPluginEditor::visualiserFullScreenChanged() {

Wyświetl plik

@ -189,6 +189,21 @@ void VisualiserComponent::runTask(const std::vector<OsciPoint>& points) {
ySamples.clear();
zSamples.clear();
auto applyEffects = [&](OsciPoint point) {
for (auto& effect : settings.parameters.audioEffects) {
point = effect->apply(0, point);
}
#if SOSCI_FEATURES
if (settings.isFlippedHorizontal()) {
point.x = -point.x;
}
if (settings.isFlippedVertical()) {
point.y = -point.y;
}
#endif
return point;
};
if (settings.isSweepEnabled()) {
double sweepIncrement = getSweepIncrement();
long samplesPerSweep = sampleRate * settings.getSweepSeconds();
@ -196,14 +211,12 @@ void VisualiserComponent::runTask(const std::vector<OsciPoint>& points) {
double triggerValue = settings.getTriggerValue();
bool belowTrigger = false;
for (auto& point : points) {
OsciPoint smoothPoint = settings.parameters.smoothEffect->apply(0, point);
for (const OsciPoint& point : points) {
long samplePosition = sampleCount - lastTriggerPosition;
double startPoint = 1.135;
double sweep = samplePosition * sweepIncrement * 2 * startPoint - startPoint;
double value = smoothPoint.x;
double value = point.x;
if (sweep > startPoint && belowTrigger && value >= triggerValue) {
lastTriggerPosition = sampleCount;
@ -211,25 +224,19 @@ void VisualiserComponent::runTask(const std::vector<OsciPoint>& points) {
belowTrigger = value < triggerValue;
xSamples.push_back(sweep);
ySamples.push_back(value);
OsciPoint sweepPoint = {sweep, value, 1};
sweepPoint = applyEffects(sweepPoint);
xSamples.push_back(sweepPoint.x);
ySamples.push_back(sweepPoint.y);
zSamples.push_back(1);
sampleCount++;
}
} else {
for (OsciPoint point : points) {
for (auto& effect : settings.parameters.audioEffects) {
point = effect->apply(0, point);
}
#if SOSCI_FEATURES
if (settings.isFlippedHorizontal()) {
point.x = -point.x;
}
if (settings.isFlippedVertical()) {
point.y = -point.y;
}
#endif
for (const OsciPoint& rawPoint : points) {
OsciPoint point = applyEffects(rawPoint);
xSamples.push_back(point.x);
ySamples.push_back(point.y);
zSamples.push_back(point.z);

Wyświetl plik

@ -4,7 +4,7 @@
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginCharacteristicsValue="pluginWantsMidiIn"
pluginManufacturer="jameshball" aaxIdentifier="sh.ball.oscirender"
cppLanguageStandard="20" projectLineFeed="&#10;" headerPath="./include"
version="2.4.5.1" companyName="James H Ball" companyWebsite="https://osci-render.com"
version="2.4.5.2" companyName="James H Ball" companyWebsite="https://osci-render.com"
companyEmail="james@ball.sh" defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;SOSCI_FEATURES=1"
pluginAUMainType="'aumf'">
<MAINGROUP id="j5Ge2T" name="osci-render">

Wyświetl plik

@ -3,7 +3,7 @@
<JUCERPROJECT id="HH2E72" name="sosci" projectType="audioplug" useAppConfig="0"
addUsingNamespaceToJuceHeader="0" jucerFormatVersion="1" pluginManufacturer="jameshball"
aaxIdentifier="sh.ball.sosci" cppLanguageStandard="20" projectLineFeed="&#10;"
headerPath="./include" version="1.0.5.1" companyName="James H Ball"
headerPath="./include" version="1.0.5.2" companyName="James H Ball"
companyWebsite="https://osci-render.com" companyEmail="james@ball.sh"
defines="NOMINMAX=1&#10;INTERNET_FLAG_NO_AUTO_REDIRECT=0&#10;SOSCI_FEATURES=1"
pluginManufacturerCode="Jhba" pluginCode="Sosc" pluginAUMainType="'aufx'">