From 1aa351cecc62e9861cb5f205b7b7b2ff151e058d Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Sat, 8 Jun 2019 05:06:32 -0400 Subject: [PATCH] Add TSchmittTrigger. Update/clean up changelog. --- CHANGELOG.md | 19 ++++++++++--------- include/dsp/digital.hpp | 19 +++++++++++++++++++ include/dsp/midi.hpp | 2 +- src/app/MenuBar.cpp | 2 +- src/window.cpp | 10 +++++----- 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 471a04a7..fc05ce6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,9 @@ ### 1.0.0 (in development) -- Add undo/redo history - Add polyphonic cables - Add multithreading to engine +- Add undo/redo history - Add module expander support - Add parameter labels, units, and descriptions - Add parameter tooltips for quickly viewing parameter values @@ -33,22 +33,23 @@ - Add `-p X` flag for dumping a screenshot of each available module - Core - - Add Core CV-MIDI, CV-CC, and CV-Gate for sending MIDI to external devices - - Add Core MIDI-Map for mapping MIDI CC parameters directly to Rack parameters - - Add polyphony to Core MIDI-CV - - Add MPE mode to Core MIDI-CV + - Add Audio-16 with 16/16 inputs/outputs + - Add CV-MIDI, CV-CC, and CV-Gate for sending MIDI to external devices + - Add MIDI-Map for mapping MIDI CC parameters directly to Rack parameters + - Add polyphony to MIDI-CV + - Add MPE mode to MIDI-CV - Add "Panic" button to all MIDI modules to reset performance state - - Add Core Audio 16 -- API +- Plugin API + - Add [`helper.py`](helper.py) for creating and manipulating plugins with the command-line - Add [`simd.hpp`](include/dsp/simd.hpp) for generically handling arithmetic and math functions for vectors of floats, accelerated with SSE - Add `dsp::VuMeter2` - Add `dsp::Timer` and `dsp::Counter` - Overhaul event system with many new events - - **TODO** Make audio driver use the same RtAudio device for multiple audio ports - - etc + - etc. See more at https://vcvrack.com/manual/Migrate1.html. - Licenses + - Relicense Rack to GPLv3 with the VCV Rack Non-Commercial Plugin License Exception and a commercial licensing option. - Collect all license statements into new [LICENSE.md](LICENSE.md) file - License Core panel graphics under CC BY-NC-ND 4.0 diff --git a/include/dsp/digital.hpp b/include/dsp/digital.hpp index 02b235c8..066c56ac 100644 --- a/include/dsp/digital.hpp +++ b/include/dsp/digital.hpp @@ -61,6 +61,25 @@ struct SchmittTrigger { }; +template +struct TSchmittTrigger { + T state; + TSchmittTrigger() { + reset(); + } + void reset() { + state = T::mask(); + } + T process(T in) { + T on = (in >= 1.f); + T off = (in <= 0.f); + T triggered = ~state & on; + state = on | (state & ~off); + return triggered; + } +}; + + /** When triggered, holds a high value for a specified time before going low again */ struct PulseGenerator { float remaining = 0.f; diff --git a/include/dsp/midi.hpp b/include/dsp/midi.hpp index 2167fc7a..660ee221 100644 --- a/include/dsp/midi.hpp +++ b/include/dsp/midi.hpp @@ -116,7 +116,7 @@ struct MidiGenerator { if (ccs[id] == cc) return; ccs[id] = cc; - // Control change + // Continuous controller midi::Message m; m.setStatus(0xb); m.setNote(id); diff --git a/src/app/MenuBar.cpp b/src/app/MenuBar.cpp index ba00b127..ece55668 100644 --- a/src/app/MenuBar.cpp +++ b/src/app/MenuBar.cpp @@ -637,7 +637,7 @@ struct PluginsMenu : ui::Menu { loggedIn = true; UrlItem *manageItem = new UrlItem; - manageItem->text = "Manage"; + manageItem->text = "VCV Store"; manageItem->url = "https://vcvrack.com/plugins.html"; addChild(manageItem); diff --git a/src/window.cpp b/src/window.cpp index e2ef3f37..0b77b0cf 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -340,12 +340,12 @@ void Window::run() { } // Get desired scaling - float pixelRatio; - glfwGetWindowContentScale(win, &pixelRatio, NULL); - pixelRatio = std::floor(pixelRatio + 0.5); - if (pixelRatio != this->pixelRatio) { + float newPixelRatio; + glfwGetWindowContentScale(win, &newPixelRatio, NULL); + newPixelRatio = std::floor(newPixelRatio + 0.5); + if (newPixelRatio != pixelRatio) { APP->event->handleZoom(); - this->pixelRatio = pixelRatio; + pixelRatio = newPixelRatio; } // Get framebuffer/window ratio