Compare commits
45 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
68861678f6 | ||
|
|
60b93e331e | ||
|
|
59da243fed | ||
|
|
376f11a6c0 | ||
|
|
88d0c59903 | ||
|
|
c1db55c56a | ||
|
|
5f377ecdf2 | ||
|
|
6eb708ccee | ||
|
|
edb540da52 | ||
|
|
89078c09a2 | ||
|
|
5662ef9d44 | ||
|
|
2e7e09fd6b | ||
|
|
2900e13dac | ||
|
|
03fcc1b5fc | ||
|
|
50bb56da05 | ||
|
|
39010a12a3 | ||
|
|
59242adadc | ||
|
|
a6ae31a08e | ||
|
|
1a09828ad4 | ||
|
|
14f41fe7b3 | ||
|
|
6899c8378c | ||
|
|
67ca4d73f6 | ||
|
|
0fc20dffd3 | ||
|
|
e5bc77f4c3 | ||
|
|
60758172b0 | ||
|
|
21f19f018b | ||
|
|
4712804b28 | ||
|
|
8c1019cdae | ||
|
|
3e4b824daf | ||
|
|
5977041b6e | ||
|
|
132ab41e5d | ||
|
|
b3b290f6dd | ||
|
|
7f63351ca6 | ||
|
|
9215800114 | ||
|
|
cacc0d6c3e | ||
|
|
0bcd267063 | ||
|
|
9af89ec862 | ||
|
|
f4976adcd7 | ||
|
|
774a97f31a | ||
|
|
d57b20ff2f | ||
|
|
63c1928f57 | ||
|
|
b65cf661a2 | ||
|
|
4d645b335d | ||
|
|
c6051e76b4 | ||
|
|
d60e4d48b3 |
@@ -15,7 +15,7 @@ INCLUDE(FindPkgConfig)
|
||||
|
||||
SET(VERSION_MAJOR "0")
|
||||
SET(VERSION_MINOR "4")
|
||||
SET(VERSION_PATCH "12")
|
||||
SET(VERSION_PATCH "13")
|
||||
#SET(VERSION_SUFFIX "")
|
||||
SET(VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}")
|
||||
IF(VERSION_SUFFIX)
|
||||
@@ -322,7 +322,7 @@ ENDIF(LMMS_BUILD_WIN32)
|
||||
|
||||
# check for libsamplerate
|
||||
IF(WANT_SYSTEM_SR)
|
||||
PKG_CHECK_MODULES(SAMPLERATE samplerate>=0.1.7)
|
||||
PKG_CHECK_MODULES(SAMPLERATE samplerate>=0.1.8)
|
||||
IF(SAMPLERATE_FOUND)
|
||||
SET(LMMS_HAVE_SAMPLERATE TRUE)
|
||||
ENDIF(SAMPLERATE_FOUND)
|
||||
@@ -450,6 +450,7 @@ IF(LMMS_BUILD_WIN32)
|
||||
${MINGW_PREFIX}/bin/libfftw3f-3.dll
|
||||
${MINGW_PREFIX}/bin/libFLAC-8.dll
|
||||
${MINGW_PREFIX}/bin/libportaudio-2.dll
|
||||
${MINGW_PREFIX}/bin/libpng15-15.dll
|
||||
${MINGW_PREFIX}/bin/SDL.dll
|
||||
${MINGW_PREFIX}/bin/libglib-2.0-0.dll
|
||||
${MINGW_PREFIX}/bin/libgthread-2.0-0.dll
|
||||
|
||||
4
README
@@ -1,7 +1,7 @@
|
||||
Linux MultiMedia Studio 0.4.12
|
||||
Linux MultiMedia Studio 0.4.13
|
||||
===============================
|
||||
|
||||
Copyright (c) 2004-2011 by LMMS-developers
|
||||
Copyright (c) 2004-2012 by LMMS-developers
|
||||
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -12,6 +12,7 @@ SET(MINGW_TOOL_PREFIX ${MINGW_PREFIX}/bin/${CMAKE_SYSTEM_PROCESSOR}-w64-mingw32
|
||||
# specify the cross compiler
|
||||
SET(CMAKE_C_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
||||
SET(CMAKE_CXX_COMPILER ${MINGW_TOOL_PREFIX}g++)
|
||||
SET(CMAKE_RC_COMPILER ${MINGW_TOOL_PREFIX}gcc)
|
||||
|
||||
IF(WIN64)
|
||||
# specify the cross compiler
|
||||
@@ -24,6 +25,7 @@ ENDIF()
|
||||
SET(STRIP ${MINGW_TOOL_PREFIX}strip)
|
||||
SET(WINDRES ${MINGW_TOOL_PREFIX}windres)
|
||||
SET(PKG_CONFIG_EXECUTABLE ${MINGW_TOOL_PREFIX}pkg-config)
|
||||
SET(PKG_CONFIG_FOUND TRUE)
|
||||
|
||||
SET(QT_BINARY_DIR ${MINGW_PREFIX}/bin)
|
||||
SET(QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake)
|
||||
|
||||
@@ -39,15 +39,15 @@
|
||||
<source>Current language not translated (or native English).
|
||||
|
||||
If you're interested in translating LMMS in another language or want to improve existing translations, you're welcome to help us! Simply contact the maintainer!</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Deutsche Übersetzung von Tobias Doerffel.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>License</source>
|
||||
<translation>Lizenz</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Copyright (c) 2004-2010, LMMS developers</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<source>Copyright (c) 2004-2012, LMMS developers</source>
|
||||
<translation>Copyright (c) 2004-2012, LMMS-Entwickler</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -242,19 +242,19 @@ If you're interested in translating LMMS in another language or want to imp
|
||||
<name>AudioJack</name>
|
||||
<message>
|
||||
<source>JACK client restarted</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>JACK-Client neugestartet</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>LMMS was kicked by JACK for some reason. Therefore the JACK backend of LMMS has been restarted. You will have to make manual connections again.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>LMMS wurde aus irgendeinem Grund von JACK verbannt. Aus diesem Grund wurde das JACK-Backend von LMMS neu gestartet. Sie müssen manuelle Verbindungen erneut vornehmen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>JACK server down</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>JACK-Server nicht erreichbar</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>The JACK server seems to have been shutdown and starting a new instance failed. Therefore LMMS is unable to proceed. You should save your project and restart JACK and LMMS.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
<translation>Der JACK-Server scheint heruntergefahren worden zu sein und es war nicht möglich, eine neue Instanz zu starten. LMMS ist daher nicht in der Lage, fortzufahren. Sie sollten Ihr Projekt speichern und JACK und LMMS neustarten.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -1628,6 +1628,34 @@ Right clicking will bring up a context menu where you can change the order in wh
|
||||
<source>2x LowPass</source>
|
||||
<translation>2x Tiefpass</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC LowPass 12dB</source>
|
||||
<translation>RC-Tiefpass 12dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC BandPass 12dB</source>
|
||||
<translation>RC-Bandpass 12dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC HighPass 12dB</source>
|
||||
<translation>RC-Hochpass 12dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC LowPass 24dB</source>
|
||||
<translation>RC-Tiefpass 24dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC BandPass 24dB</source>
|
||||
<translation>RC-Bandpass 24dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>RC HighPass 24dB</source>
|
||||
<translation>RC-Hochpass 24dB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vocal Formant Filter</source>
|
||||
<translation>Vokalformant-Filter</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>InstrumentSoundShapingView</name>
|
||||
@@ -2249,6 +2277,22 @@ Bitte besuchen Sie http://lmms.sf.net/wiki für Dokumentationen über LMMS.</tra
|
||||
<source>Root directory</source>
|
||||
<translation>Wurzelverzeichnis</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Project recovery</source>
|
||||
<translation>Projektwiederherstellung</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>It looks like the last session did not end properly. Do you want to recover the project of this session?</source>
|
||||
<translation>Es sieht so aus, als ob die letzte Sitzung nicht ordentlich beendet wurde. Möchten Sie das Projekt dieser Sitzung wiederherstellen?</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Configuration file</source>
|
||||
<translation>Konfigurationsdatei</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Error while parsing configuration file at line %1:%2: %3</source>
|
||||
<translation>Fehler beim Parsen der Konfigurationsdatei in Zeile %1:%2: %3</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>MeterDialog</name>
|
||||
@@ -2844,7 +2888,7 @@ Grund: "%2"</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to open another VST-plugin. After clicking on this button, a file-open-dialog appears and you can select your file.</source>
|
||||
<translation>Klicken Sie hier, wenn Sie ein anderes VST-Plugin öffnen möchten. Nachdem Sie auf diesen Button geklickt haben, erscheint ein Datei-öffnen-Dialog und Sie können Ihre Datei wählen.</translation>
|
||||
<translation>Klicken Sie hier, um ein anderes VST-Plugin zu öffnen. Nachdem Sie auf diesen Button geklickt haben, erscheint ein Datei-öffnen-Dialog und Sie können Ihre Datei wählen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Show/hide GUI</source>
|
||||
@@ -2878,6 +2922,50 @@ Grund: "%2"</translation>
|
||||
<source>by</source>
|
||||
<translation>von</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Control VST-plugin from LMMS host</source>
|
||||
<translation>VST-Plugin von LMMS fernsteuern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to control VST-plugin from host.</source>
|
||||
<translation>Klicken Sie hier, um das VST-Plugin von LMMS aus fernzusteuern.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open VST-plugin preset</source>
|
||||
<translation>VST-Plugin-Preset öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to open another *.fxp, *.fxb VST-plugin preset.</source>
|
||||
<translation>Klicken Sie hier, um eine andere *.fxp, *.fxb-Preset-Datei für das VST-Plugin zu laden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Previous (-)</source>
|
||||
<translation>Vorheriges (-)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save preset</source>
|
||||
<translation>Preset speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Next (+)</source>
|
||||
<translation>Nächstes (+)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here to select presets that are currently loaded in VST.</source>
|
||||
<translation>Klicken Sie hier, um aktuell geladene VST-Presets auszuwählen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Preset</source>
|
||||
<translation>Preset</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to switch to another VST-plugin preset program.</source>
|
||||
<translation>Klicken Sie hier, um zu einem anderen VST-Plugin-Presetprogramm zu wechseln.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to save current VST-plugin preset program.</source>
|
||||
<translation>Klicken Sie hier, um das aktuelle VST-Plugin-Presetprogramm zu speichern.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>VstEffectControlDialog</name>
|
||||
@@ -2885,6 +2973,46 @@ Grund: "%2"</translation>
|
||||
<source>Show/hide VST FX GUI</source>
|
||||
<translation>VST-Effekt-GUI anzeigen/verbergen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Control VST-plugin from LMMS host</source>
|
||||
<translation>VST-Plugin von LMMS fernsteuern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to control VST-plugin from host.</source>
|
||||
<translation>Klicken Sie hier, um das VST-Plugin von LMMS aus fernzusteuern.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open VST-plugin preset</source>
|
||||
<translation>VST-Plugin-Preset öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to open another *.fxp, *.fxb VST-plugin preset.</source>
|
||||
<translation>Klicken Sie hier, um eine andere *.fxp, *.fxb-Preset-Datei für das VST-Plugin zu laden.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Previous (-)</source>
|
||||
<translation>Vorheriges (-)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Next (+)</source>
|
||||
<translation>Nächstes (+)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here to select presets that are currently loaded in VST.</source>
|
||||
<translation>Klicken Sie hier, um aktuell geladene VST-Presets auszuwählen.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save preset</source>
|
||||
<translation>Preset speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to switch to another VST-plugin preset program.</source>
|
||||
<translation>Klicken Sie hier, um zu einem anderen VST-Plugin-Presetprogramm zu wechseln.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here, if you want to save current VST-plugin preset program.</source>
|
||||
<translation>Klicken Sie hier, um das aktuelle VST-Plugin-Presetprogramm zu speichern.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>VstPlugin</name>
|
||||
@@ -2906,6 +3034,46 @@ If it runs with other VST-software under Linux, please contact an LMMS-developer
|
||||
<translation>Das VST-Plugin %1 konnte aus irgendeinem Grund nicht geladen werden.
|
||||
Wenn es mit anderer VST-Software unter Linux funktioniert, kontaktieren Sie bitte einen LMMS-Entwickler!</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Open Preset</source>
|
||||
<translation>Preset öffnen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Vst Plugin Preset (*.fxp *.fxb)</source>
|
||||
<translation>VST-Plugin-Preset (*.fxp *.fxb)</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>: default</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>"</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>'</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Save Preset</source>
|
||||
<translation>Preset speichern</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>.fxp</source>
|
||||
<translation>.fxp</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>.FXP</source>
|
||||
<translation>.FXP</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>.FXB</source>
|
||||
<translation>.FXB</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>.fxb</source>
|
||||
<translation>.fxb</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>ZynAddSubFxInstrument</name>
|
||||
@@ -3106,7 +3274,7 @@ Wenn es mit anderer VST-Software unter Linux funktioniert, kontaktieren Sie bitt
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here to stop playing of current beat/bassline.</source>
|
||||
<translation>Klicken Sie hier, um das Abspielen des aktuellen Beats/Bassline zu stoppen (Leertaste)</translation>
|
||||
<translation>Klicken Sie hier, um das Abspielen des aktuellen Beats/Bassline zu stoppen (Leertaste).</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
@@ -3628,7 +3796,7 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here for an exponential wave.</source>
|
||||
<translation>Klick für eine Exponential-Welle</translation>
|
||||
<translation>Klick für eine Exponential-Welle.</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here for white-noise.</source>
|
||||
@@ -4003,6 +4171,28 @@ Double clicking any of the plugins will bring up information on the ports.</sour
|
||||
<translation>Vibrato:</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>manageVSTEffectView</name>
|
||||
<message>
|
||||
<source>VST Sync</source>
|
||||
<translation>VST-Sync</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here if you want to synchronize all parameters with VST plugin.</source>
|
||||
<translation>Klicken Sie hier, um alle Parameter mit dem VST-Plugin zu synchronisieren.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>manageVestigeInstrumentView</name>
|
||||
<message>
|
||||
<source>VST Sync</source>
|
||||
<translation>VST-Sync</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Click here if you want to synchronize all parameters with VST plugin.</source>
|
||||
<translation>Klicken Sie hier, um alle Parameter mit dem VST-Plugin zu synchronisieren.</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>nineButtonSelector</name>
|
||||
<message>
|
||||
@@ -4489,7 +4679,7 @@ Lautstärke eines Steps kann mit Mausrad geändert werden</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Note Volume</source>
|
||||
<translation>Notenlautstärke</translation>
|
||||
<translation>Noten-lautstärke</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Note Panning</source>
|
||||
@@ -4515,6 +4705,30 @@ Lautstärke eines Steps kann mit Mausrad geändert werden</translation>
|
||||
<source>Click here and detune mode will be activated. In this mode you can click a note to open its automation detuning. You can utilize this to slide notes from one to another. You can also press 'Shift+T' on your keyboard to activate this mode.</source>
|
||||
<translation type="unfinished"></translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mark/unmark current semitone</source>
|
||||
<translation>Aktuellen Halbton markieren/demarkieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mark current scale</source>
|
||||
<translation>Aktuelle Tonleite markieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Mark current chord</source>
|
||||
<translation>Aktuellen Akkord markieren</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Unmark all</source>
|
||||
<translation>Alles Markierungen entfernen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No scale</source>
|
||||
<translation>Keine Tonleiter</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>No chord</source>
|
||||
<translation>Kein Akkord</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>pluginBrowser</name>
|
||||
@@ -5043,6 +5257,14 @@ Latenz: %2 ms</translation>
|
||||
<source>One instrument track window mode</source>
|
||||
<translation>Instrumente im Ein-Fenster-Modus</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Compact track buttons</source>
|
||||
<translation>Kompakte Track-Buttons</translation>
|
||||
</message>
|
||||
<message>
|
||||
<source>Smooth scroll in Song Editor</source>
|
||||
<translation>Weiches Scrollen im Song-Editor</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
<name>sf2Instrument</name>
|
||||
|
||||
BIN
data/locale/pl.qm
Normal file
6295
data/locale/pl.ts
Normal file
BIN
data/themes/default/chord.png
Normal file
|
After Width: | Height: | Size: 1006 B |
BIN
data/themes/default/scale.png
Normal file
|
After Width: | Height: | Size: 1006 B |
BIN
data/themes/default/stepper-down-press.png
Normal file
|
After Width: | Height: | Size: 510 B |
BIN
data/themes/default/stepper-down.png
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
data/themes/default/stepper-left-press.png
Normal file
|
After Width: | Height: | Size: 514 B |
BIN
data/themes/default/stepper-left.png
Normal file
|
After Width: | Height: | Size: 548 B |
BIN
data/themes/default/stepper-right-press.png
Normal file
|
After Width: | Height: | Size: 519 B |
BIN
data/themes/default/stepper-right.png
Normal file
|
After Width: | Height: | Size: 491 B |
BIN
data/themes/default/stepper-up-press.png
Normal file
|
After Width: | Height: | Size: 516 B |
BIN
data/themes/default/stepper-up.png
Normal file
|
After Width: | Height: | Size: 528 B |
@@ -268,6 +268,11 @@ signals:
|
||||
return AutomatableModel::value<type>( _frameOffset ); \
|
||||
} \
|
||||
\
|
||||
inline type initValue() const \
|
||||
{ \
|
||||
return AutomatableModel::initValue<type>(); \
|
||||
} \
|
||||
\
|
||||
inline type minValue() const \
|
||||
{ \
|
||||
return AutomatableModel::minValue<type>(); \
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* ComboBoxModel.h - declaration of class ComboBoxModel
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -57,9 +57,9 @@ public:
|
||||
|
||||
int findText( const QString & _txt ) const;
|
||||
|
||||
inline const QString & currentText() const
|
||||
inline QString currentText() const
|
||||
{
|
||||
return m_items[value()].first;
|
||||
return ( size() > 0 && value() < size() ) ? m_items[value()].first : QString();
|
||||
}
|
||||
|
||||
inline const PixmapLoader * currentData() const
|
||||
|
||||
@@ -36,12 +36,17 @@ class InstrumentTrack;
|
||||
class notePlayHandle;
|
||||
|
||||
|
||||
const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
|
||||
class ChordCreator : public Model, public JournallingObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static const int MAX_CHORD_POLYPHONY = 10;
|
||||
|
||||
private:
|
||||
typedef Sint8 ChordSemiTones [MAX_CHORD_POLYPHONY];
|
||||
|
||||
public:
|
||||
ChordCreator( Model * _parent );
|
||||
virtual ~ChordCreator();
|
||||
@@ -58,22 +63,84 @@ public:
|
||||
}
|
||||
|
||||
|
||||
static struct Chord
|
||||
struct Chord
|
||||
{
|
||||
const QString name;
|
||||
Sint8 interval[MAX_CHORD_POLYPHONY];
|
||||
} s_chordTable[];
|
||||
private:
|
||||
QString m_name;
|
||||
ChordSemiTones m_semiTones;
|
||||
int m_size;
|
||||
|
||||
public:
|
||||
Chord() : m_size( 0 ) {}
|
||||
|
||||
static inline int getChordSize( Chord & _c )
|
||||
{
|
||||
int idx = 0;
|
||||
while( _c.interval[idx] != -1 )
|
||||
Chord( const char * n, const ChordSemiTones & semi_tones );
|
||||
|
||||
int size() const
|
||||
{
|
||||
++idx;
|
||||
return m_size;
|
||||
}
|
||||
return idx;
|
||||
}
|
||||
|
||||
bool isScale() const
|
||||
{
|
||||
return size() > 6;
|
||||
}
|
||||
|
||||
bool isEmpty() const
|
||||
{
|
||||
return size() == 0;
|
||||
}
|
||||
|
||||
bool hasSemiTone( Sint8 semi_tone ) const;
|
||||
|
||||
Sint8 last() const
|
||||
{
|
||||
return m_semiTones[size() - 1];
|
||||
}
|
||||
|
||||
const QString & getName() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
Sint8 operator [] ( int n ) const
|
||||
{
|
||||
return m_semiTones[n];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
struct ChordTable : public QVector<Chord>
|
||||
{
|
||||
private:
|
||||
ChordTable();
|
||||
|
||||
struct Init
|
||||
{
|
||||
const char * m_name;
|
||||
ChordSemiTones m_semiTones;
|
||||
};
|
||||
|
||||
static Init s_initTable[];
|
||||
|
||||
public:
|
||||
static const ChordTable & getInstance()
|
||||
{
|
||||
static ChordTable inst;
|
||||
return inst;
|
||||
}
|
||||
|
||||
const Chord & getByName( const QString & name, bool is_scale = false ) const;
|
||||
|
||||
const Chord & getScaleByName( const QString & name ) const
|
||||
{
|
||||
return getByName( name, true );
|
||||
}
|
||||
|
||||
const Chord & getChordByName( const QString & name ) const
|
||||
{
|
||||
return getByName( name, false );
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -509,6 +509,11 @@ enum RemoteMessageIDs
|
||||
IdSaveSettingsToFile,
|
||||
IdLoadSettingsFromString,
|
||||
IdLoadSettingsFromFile,
|
||||
IdLoadChunkFromPresetFile,
|
||||
IdRotateProgram,
|
||||
IdLoadPrograms,
|
||||
IdSavePreset,
|
||||
IdSetParameter,
|
||||
IdLoadPresetFromFile,
|
||||
IdDebugMessage,
|
||||
IdUserBase = 64
|
||||
|
||||
@@ -180,7 +180,7 @@ public:
|
||||
class VstParameterProperties
|
||||
{
|
||||
public:
|
||||
float stepFloat;
|
||||
/* float stepFloat;
|
||||
char label[64];
|
||||
int flags;
|
||||
int minInteger;
|
||||
@@ -189,7 +189,24 @@ public:
|
||||
char shortLabel[8];
|
||||
int category;
|
||||
char categoryLabel[24];
|
||||
char empty[128];
|
||||
char empty[128];*/
|
||||
|
||||
float stepFloat;
|
||||
float smallStepFloat;
|
||||
float largeStepFloat;
|
||||
char label[64];
|
||||
unsigned int flags;
|
||||
unsigned int minInteger;
|
||||
unsigned int maxInteger;
|
||||
unsigned int stepInteger;
|
||||
unsigned int largeStepInteger;
|
||||
char shortLabel[8];
|
||||
unsigned short displayIndex;
|
||||
unsigned short category;
|
||||
unsigned short numParametersInCategory;
|
||||
unsigned short reserved;
|
||||
char categoryLabel[24];
|
||||
char future[16];
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* original file by ???
|
||||
* modified and enhanced by Tobias Doerffel
|
||||
*
|
||||
* Copyright (c) 2004-2008 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -40,6 +40,8 @@
|
||||
#include "templates.h"
|
||||
#include "lmms_constants.h"
|
||||
|
||||
//#include <iostream>
|
||||
//#include <cstdlib>
|
||||
|
||||
template<ch_cnt_t CHANNELS/* = DEFAULT_CHANNELS*/>
|
||||
class basicFilters
|
||||
@@ -54,6 +56,14 @@ public:
|
||||
Notch,
|
||||
AllPass,
|
||||
Moog,
|
||||
DoubleLowPass,
|
||||
Lowpass_RC12,
|
||||
Bandpass_RC12,
|
||||
Highpass_RC12,
|
||||
Lowpass_RC24,
|
||||
Bandpass_RC24,
|
||||
Highpass_RC24,
|
||||
Formantfilter,
|
||||
NumFilters
|
||||
} ;
|
||||
|
||||
@@ -69,14 +79,16 @@ public:
|
||||
|
||||
inline void setFilterType( const int _idx )
|
||||
{
|
||||
m_doubleFilter = _idx >= NumFilters;
|
||||
m_doubleFilter = _idx == DoubleLowPass;
|
||||
if( !m_doubleFilter )
|
||||
{
|
||||
m_type = static_cast<FilterTypes>( _idx );
|
||||
return;
|
||||
}
|
||||
m_type = static_cast<FilterTypes>( LowPass + _idx -
|
||||
NumFilters );
|
||||
|
||||
// Double lowpass mode, backwards-compat for the goofy
|
||||
// Add-NumFilters to signify doubleFilter stuff
|
||||
m_type = static_cast<FilterTypes>( LowPass );
|
||||
if( m_subFilter == NULL )
|
||||
{
|
||||
m_subFilter = new basicFilters<CHANNELS>(
|
||||
@@ -92,6 +104,9 @@ public:
|
||||
m_b2a0( 0.0f ),
|
||||
m_a1a0( 0.0f ),
|
||||
m_a2a0( 0.0f ),
|
||||
m_rca( 0.0f ),
|
||||
m_rcb( 1.0f ),
|
||||
m_rcc( 0.0f ),
|
||||
m_doubleFilter( false ),
|
||||
m_sampleRate( (float) _sample_rate ),
|
||||
m_subFilter( NULL )
|
||||
@@ -112,10 +127,18 @@ public:
|
||||
// reset in/out history for simple filters
|
||||
m_ou1[_chnl] = m_ou2[_chnl] = m_in1[_chnl] =
|
||||
m_in2[_chnl] = 0.0f;
|
||||
// reset in/out historey for moog-filter
|
||||
|
||||
// reset in/out history for moog-filter
|
||||
m_y1[_chnl] = m_y2[_chnl] = m_y3[_chnl] = m_y4[_chnl] =
|
||||
m_oldx[_chnl] = m_oldy1[_chnl] =
|
||||
m_oldy2[_chnl] = m_oldy3[_chnl] = 0.0f;
|
||||
|
||||
// reset in/out history for RC-filters
|
||||
m_rclp0[_chnl] = m_rcbp0[_chnl] = m_rchp0[_chnl] = m_rclast0[_chnl] = 0.0f;
|
||||
m_rclp1[_chnl] = m_rcbp1[_chnl] = m_rchp1[_chnl] = m_rclast1[_chnl] = 0.0f;
|
||||
|
||||
for(int i=0; i<6; i++)
|
||||
m_vflp[i][_chnl] = m_vfbp[i][_chnl] = m_vfhp[i][_chnl] = m_vflast[i][_chnl] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,6 +179,284 @@ public:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// 4-times oversampled simulation of an active RC-Bandpass,-Lowpass,-Highpass-
|
||||
// Filter-Network as it was used in nearly all modern analog synthesizers. This
|
||||
// can be driven up to self-oscillation (BTW: do not remove the limits!!!).
|
||||
// (C) 1998 ... 2009 S.Fendt. Released under the GPL v2.0 or any later version.
|
||||
|
||||
case Lowpass_RC12:
|
||||
case Bandpass_RC12:
|
||||
case Highpass_RC12:
|
||||
{
|
||||
sample_t lp, hp, bp;
|
||||
|
||||
sample_t in;
|
||||
|
||||
// 4-times oversampled... (even the moog-filter would benefit from this)
|
||||
for( int n = 4; n != 0; --n )
|
||||
{
|
||||
in = _in0 + m_rcbp0[_chnl] * m_rcq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_rcb + m_rclp0[_chnl] * m_rca;
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_rcc * ( m_rchp0[_chnl] + in - m_rclast0[_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_rcb + m_rcbp0[_chnl] * m_rca;
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_rclast0[_chnl] = in;
|
||||
m_rclp0[_chnl] = lp;
|
||||
m_rchp0[_chnl] = hp;
|
||||
m_rcbp0[_chnl] = bp;
|
||||
}
|
||||
|
||||
if( m_type == Lowpass_RC12 )
|
||||
out = lp;
|
||||
else if( m_type == Bandpass_RC12 )
|
||||
out = bp;
|
||||
else
|
||||
out = hp;
|
||||
|
||||
return( out );
|
||||
break;
|
||||
}
|
||||
|
||||
case Lowpass_RC24:
|
||||
case Bandpass_RC24:
|
||||
case Highpass_RC24:
|
||||
{
|
||||
sample_t lp, hp, bp;
|
||||
|
||||
sample_t in;
|
||||
|
||||
for( int n = 4; n != 0; --n )
|
||||
{
|
||||
// first stage is as for the 12dB case...
|
||||
in = _in0 + m_rcbp0[_chnl] * m_rcq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_rcb + m_rclp0[_chnl] * m_rca;
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_rcc * ( m_rchp0[_chnl] + in - m_rclast0[_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_rcb + m_rcbp0[_chnl] * m_rca;
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_rclast0[_chnl] = in;
|
||||
m_rclp0[_chnl] = lp;
|
||||
m_rchp0[_chnl] = hp;
|
||||
m_rcbp0[_chnl] = bp;
|
||||
|
||||
// second stage gets the output of the first stage as input...
|
||||
if( m_type == Lowpass_RC24 )
|
||||
{
|
||||
in = lp + m_rcbp1[_chnl] * m_rcq;
|
||||
}
|
||||
else if( m_type == Bandpass_RC24 )
|
||||
{
|
||||
in = bp + m_rcbp1[_chnl] * m_rcq;
|
||||
}
|
||||
else
|
||||
{
|
||||
in = hp + m_rcbp1[_chnl] * m_rcq;
|
||||
}
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_rcb + m_rclp1[_chnl] * m_rca;
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_rcc * ( m_rchp1[_chnl] + in - m_rclast1[_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_rcb + m_rcbp1[_chnl] * m_rca;
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_rclast1[_chnl] = in;
|
||||
m_rclp1[_chnl] = lp;
|
||||
m_rchp1[_chnl] = hp;
|
||||
m_rcbp1[_chnl] = bp;
|
||||
}
|
||||
|
||||
// output is second stage-lowpass...
|
||||
if( m_type == Lowpass_RC24 )
|
||||
{
|
||||
out = lp;
|
||||
}
|
||||
else if( m_type == Bandpass_RC24 )
|
||||
{
|
||||
out = bp;
|
||||
}
|
||||
else
|
||||
{
|
||||
out = hp;
|
||||
}
|
||||
|
||||
return out;
|
||||
break;
|
||||
}
|
||||
|
||||
case Formantfilter:
|
||||
{
|
||||
sample_t lp, hp, bp, in;
|
||||
|
||||
out = 0;
|
||||
for(int o=0; o<4; o++)
|
||||
{
|
||||
// first formant
|
||||
in = _in0 + m_vfbp[0][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[0] + m_vflp[0][_chnl] * m_vfa[0];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[0] * ( m_vfhp[0][_chnl] + in - m_vflast[0][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[0] + m_vfbp[0][_chnl] * m_vfa[0];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[0][_chnl] = in;
|
||||
m_vflp[0][_chnl] = lp;
|
||||
m_vfhp[0][_chnl] = hp;
|
||||
m_vfbp[0][_chnl] = bp;
|
||||
|
||||
in = bp + m_vfbp[2][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[0] + m_vflp[2][_chnl] * m_vfa[0];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[0] * ( m_vfhp[2][_chnl] + in - m_vflast[2][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[0] + m_vfbp[2][_chnl] * m_vfa[0];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[2][_chnl] = in;
|
||||
m_vflp[2][_chnl] = lp;
|
||||
m_vfhp[2][_chnl] = hp;
|
||||
m_vfbp[2][_chnl] = bp;
|
||||
|
||||
in = bp + m_vfbp[4][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[0] + m_vflp[4][_chnl] * m_vfa[0];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[0] * ( m_vfhp[4][_chnl] + in - m_vflast[4][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[0] + m_vfbp[4][_chnl] * m_vfa[0];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[4][_chnl] = in;
|
||||
m_vflp[4][_chnl] = lp;
|
||||
m_vfhp[4][_chnl] = hp;
|
||||
m_vfbp[4][_chnl] = bp;
|
||||
|
||||
out += bp;
|
||||
|
||||
// second formant
|
||||
in = _in0 + m_vfbp[0][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[1] + m_vflp[1][_chnl] * m_vfa[1];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[1] * ( m_vfhp[1][_chnl] + in - m_vflast[1][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[1] + m_vfbp[1][_chnl] * m_vfa[1];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[1][_chnl] = in;
|
||||
m_vflp[1][_chnl] = lp;
|
||||
m_vfhp[1][_chnl] = hp;
|
||||
m_vfbp[1][_chnl] = bp;
|
||||
|
||||
in = bp + m_vfbp[3][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[1] + m_vflp[3][_chnl] * m_vfa[1];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[1] * ( m_vfhp[3][_chnl] + in - m_vflast[3][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[1] + m_vfbp[3][_chnl] * m_vfa[1];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[3][_chnl] = in;
|
||||
m_vflp[3][_chnl] = lp;
|
||||
m_vfhp[3][_chnl] = hp;
|
||||
m_vfbp[3][_chnl] = bp;
|
||||
|
||||
in = bp + m_vfbp[5][_chnl] * m_vfq;
|
||||
in = (in > +1.f) ? +1.f : in;
|
||||
in = (in < -1.f) ? -1.f : in;
|
||||
|
||||
lp = in * m_vfb[1] + m_vflp[5][_chnl] * m_vfa[1];
|
||||
lp = (lp > +1.f) ? +1.f : lp;
|
||||
lp = (lp < -1.f) ? -1.f : lp;
|
||||
|
||||
hp = m_vfc[1] * ( m_vfhp[5][_chnl] + in - m_vflast[5][_chnl] );
|
||||
hp = (hp > +1.f) ? +1.f : hp;
|
||||
hp = (hp < -1.f) ? -1.f : hp;
|
||||
|
||||
bp = hp * m_vfb[1] + m_vfbp[5][_chnl] * m_vfa[1];
|
||||
bp = (bp > +1.f) ? +1.f : bp;
|
||||
bp = (bp < -1.f) ? -1.f : bp;
|
||||
|
||||
m_vflast[5][_chnl] = in;
|
||||
m_vflp[5][_chnl] = lp;
|
||||
m_vfhp[5][_chnl] = hp;
|
||||
m_vfbp[5][_chnl] = bp;
|
||||
|
||||
out += bp;
|
||||
}
|
||||
|
||||
return( out/2.0f );
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
// filter
|
||||
out = m_b0a0*_in0 +
|
||||
@@ -163,7 +464,7 @@ public:
|
||||
m_b2a0*m_in2[_chnl] -
|
||||
m_a1a0*m_ou1[_chnl] -
|
||||
m_a2a0*m_ou2[_chnl];
|
||||
|
||||
|
||||
// push in/out buffers
|
||||
m_in2[_chnl] = m_in1[_chnl];
|
||||
m_in1[_chnl] = _in0;
|
||||
@@ -191,6 +492,66 @@ public:
|
||||
// bad noise out of the filter...
|
||||
_q = qMax( _q, minQ() );
|
||||
|
||||
if( m_type == Lowpass_RC12 ||
|
||||
m_type == Bandpass_RC12 ||
|
||||
m_type == Highpass_RC12 ||
|
||||
m_type == Lowpass_RC24 ||
|
||||
m_type == Bandpass_RC24 ||
|
||||
m_type == Highpass_RC24 )
|
||||
{
|
||||
if( _freq < 50.f )
|
||||
{
|
||||
_freq = 50.f;
|
||||
}
|
||||
|
||||
m_rca = 1.0f - (1.0f/(m_sampleRate*4)) / ( (1.0f/(_freq*2.0f*M_PI)) + (1.0f/(m_sampleRate*4)) );
|
||||
m_rcb = 1.0f - m_rca;
|
||||
m_rcc = (1.0f/(_freq*2.0f*M_PI)) / ( (1.0f/(_freq*2.0f*M_PI)) + (1.0f/(m_sampleRate*4)) );
|
||||
|
||||
// Stretch Q/resonance, as self-oscillation reliably starts at a q of ~2.5 - ~2.6
|
||||
m_rcq = _q/4.f;
|
||||
}
|
||||
|
||||
if( m_type == Formantfilter )
|
||||
{
|
||||
// formats for a, e, i, o, u, a
|
||||
const float _f[5][2] = { { 1000, 1400 }, { 500, 2300 },
|
||||
{ 320, 3200 },
|
||||
{ 500, 1000 },
|
||||
{ 320, 800 } };
|
||||
|
||||
// Stretch Q/resonance
|
||||
m_vfq = _q/4.f;
|
||||
|
||||
// frequency in lmms ranges from 1Hz to 14000Hz
|
||||
const int vowel = (int)( floor( _freq/14000.f * 4.f ) );
|
||||
const float fract = ( _freq/14000.f * 4.f ) -
|
||||
(float)vowel;
|
||||
|
||||
// interpolate between formant frequencies
|
||||
const float f0 = _f[vowel+0][0] * ( 1.0f - fract ) +
|
||||
_f[vowel+1][0] * ( fract );
|
||||
|
||||
const float f1 = _f[vowel+0][1] * ( 1.0f - fract ) +
|
||||
_f[vowel+1][1] * ( fract );
|
||||
|
||||
m_vfa[0] = 1.0f - (1.0f/(m_sampleRate*4)) /
|
||||
( (1.0f/(f0*2.0f*M_PI)) +
|
||||
(1.0f/(m_sampleRate*4)) );
|
||||
m_vfb[0] = 1.0f - m_vfa[0];
|
||||
m_vfc[0] = (1.0f/(f0*2.0f*M_PI)) /
|
||||
( (1.0f/(f0*2.0f*M_PI)) +
|
||||
(1.0f/(m_sampleRate*4)) );
|
||||
|
||||
m_vfa[1] = 1.0f - (1.0f/(m_sampleRate*4)) /
|
||||
( (1.0f/(f1*2.0f*M_PI)) +
|
||||
(1.0f/(m_sampleRate*4)) );
|
||||
m_vfb[1] = 1.0f - m_vfa[1];
|
||||
m_vfc[1] = (1.0f/(f1*2.0f*M_PI)) /
|
||||
( (1.0f/(f1*2.0f*M_PI)) +
|
||||
(1.0f/(m_sampleRate*4)) );
|
||||
}
|
||||
|
||||
if( m_type == Moog )
|
||||
{
|
||||
// [ 0 - 0.5 ]
|
||||
@@ -207,7 +568,6 @@ public:
|
||||
m_subFilter->m_k = m_k;
|
||||
}
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
// other filters
|
||||
@@ -281,6 +641,12 @@ private:
|
||||
// coeffs for moog-filter
|
||||
float m_r, m_p, m_k;
|
||||
|
||||
// coeffs for RC-type-filters
|
||||
float m_rca, m_rcb, m_rcc, m_rcq;
|
||||
|
||||
// coeffs for formant-filters
|
||||
float m_vfa[4], m_vfb[4], m_vfc[4], m_vfq;
|
||||
|
||||
typedef sample_t frame[CHANNELS];
|
||||
|
||||
// in/out history
|
||||
@@ -288,7 +654,14 @@ private:
|
||||
|
||||
// in/out history for moog-filter
|
||||
frame m_y1, m_y2, m_y3, m_y4, m_oldx, m_oldy1, m_oldy2, m_oldy3;
|
||||
|
||||
// in/out history for RC-type-filters
|
||||
frame m_rcbp0, m_rclp0, m_rchp0, m_rclast0;
|
||||
frame m_rcbp1, m_rclp1, m_rchp1, m_rclast1;
|
||||
|
||||
// in/out history for Formant-filters
|
||||
frame m_vfbp[6], m_vflp[6], m_vfhp[6], m_vflast[6];
|
||||
|
||||
FilterTypes m_type;
|
||||
bool m_doubleFilter;
|
||||
|
||||
|
||||
@@ -151,6 +151,8 @@ private:
|
||||
QPoint m_origMousePos;
|
||||
bool m_buttonPressed;
|
||||
|
||||
int m_magneticDecay;
|
||||
|
||||
float m_totalAngle;
|
||||
int m_angle;
|
||||
QImage m_cache;
|
||||
|
||||
@@ -240,10 +240,7 @@ public:
|
||||
|
||||
void removePlayHandles( track * _track );
|
||||
|
||||
inline bool hasPlayHandles() const
|
||||
{
|
||||
return !m_playHandles.empty();
|
||||
}
|
||||
bool hasNotePlayHandles();
|
||||
|
||||
|
||||
// methods providing information for other classes
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* note_play_handle.h - declaration of class notePlayHandle which is needed
|
||||
* by LMMS-Play-Engine
|
||||
*
|
||||
* Copyright (c) 2004-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2004-2012 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -192,6 +192,16 @@ public:
|
||||
void processMidiTime( const midiTime & _time );
|
||||
void resize( const bpm_t _new_tempo );
|
||||
|
||||
void setSongGlobalParentOffset( const midiTime &offset )
|
||||
{
|
||||
m_songGlobalParentOffset = offset;
|
||||
}
|
||||
|
||||
const midiTime &songGlobalParentOffset() const
|
||||
{
|
||||
return m_songGlobalParentOffset;
|
||||
}
|
||||
|
||||
#ifdef LMMS_SINGERBOT_SUPPORT
|
||||
int patternIndex()
|
||||
{
|
||||
@@ -263,6 +273,7 @@ private:
|
||||
float m_unpitchedFrequency;
|
||||
|
||||
BaseDetuning * m_baseDetuning;
|
||||
midiTime m_songGlobalParentOffset;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -139,8 +139,16 @@ protected slots:
|
||||
|
||||
void zoomingChanged();
|
||||
void quantizeChanged();
|
||||
|
||||
|
||||
void updateSemiToneMarkerMenu();
|
||||
|
||||
void changeNoteEditMode( int i );
|
||||
void markSemiTone( int i );
|
||||
|
||||
|
||||
signals:
|
||||
void semiToneMarkerMenuScaleSetEnabled(bool);
|
||||
void semiToneMarkerMenuChordSetEnabled(bool);
|
||||
|
||||
|
||||
private:
|
||||
@@ -170,6 +178,14 @@ private:
|
||||
NoteEditCount // make sure this one is always last
|
||||
};
|
||||
|
||||
enum semiToneMarkerAction
|
||||
{
|
||||
stmaUnmarkAll,
|
||||
stmaMarkCurrentSemiTone,
|
||||
stmaMarkCurrentScale,
|
||||
stmaMarkCurrentChord,
|
||||
};
|
||||
|
||||
enum pianoRollKeyTypes
|
||||
{
|
||||
PR_WHITE_KEY_SMALL,
|
||||
@@ -179,7 +195,9 @@ private:
|
||||
|
||||
QVector<QString> m_nemStr; // gui names of each edit mode
|
||||
QMenu * m_noteEditMenu; // when you right click below the key area
|
||||
QSignalMapper * m_signalMapper; // to keep track of edit mode events
|
||||
|
||||
QList<int> m_markedSemiTones;
|
||||
QMenu * m_semiToneMarkerMenu; // when you right click on the key area
|
||||
|
||||
pianoRoll();
|
||||
pianoRoll( const pianoRoll & );
|
||||
@@ -204,7 +222,7 @@ private:
|
||||
inline int noteEditRight() const;
|
||||
inline int noteEditLeft() const;
|
||||
|
||||
void dragNotes( int x, int y, bool alt );
|
||||
void dragNotes( int x, int y, bool alt, bool shift );
|
||||
|
||||
static const int cm_scrollAmtHoriz = 10;
|
||||
static const int cm_scrollAmtVert = 1;
|
||||
@@ -240,10 +258,14 @@ private:
|
||||
comboBox * m_zoomingComboBox;
|
||||
comboBox * m_quantizeComboBox;
|
||||
comboBox * m_noteLenComboBox;
|
||||
comboBox * m_scaleComboBox;
|
||||
comboBox * m_chordComboBox;
|
||||
|
||||
ComboBoxModel m_zoomingModel;
|
||||
ComboBoxModel m_quantizeModel;
|
||||
ComboBoxModel m_noteLenModel;
|
||||
ComboBoxModel m_scaleModel;
|
||||
ComboBoxModel m_chordModel;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -106,6 +106,7 @@ private slots:
|
||||
void toggleManualChPiano( bool _enabled );
|
||||
void toggleSmoothScroll( bool _enabled );
|
||||
void toggleOneInstrumentTrackWindow( bool _enabled );
|
||||
void toggleCompactTrackButtons( bool _enabled );
|
||||
|
||||
|
||||
private:
|
||||
@@ -152,6 +153,7 @@ private:
|
||||
bool m_manualChPiano;
|
||||
bool m_smoothScroll;
|
||||
bool m_oneInstrumentTrackWindow;
|
||||
bool m_compactTrackButtons;
|
||||
|
||||
typedef QMap<QString, AudioDevice::setupWidget *> AswMap;
|
||||
typedef QMap<QString, MidiClient::setupWidget *> MswMap;
|
||||
|
||||
@@ -52,10 +52,14 @@ class trackView;
|
||||
|
||||
typedef QWidget trackSettingsWidget;
|
||||
|
||||
|
||||
|
||||
const int DEFAULT_SETTINGS_WIDGET_WIDTH = 224;
|
||||
const int TRACK_OP_WIDTH = 78;
|
||||
// This shaves 150-ish pixels off track buttons,
|
||||
// ruled from config: ui.compacttrackbuttons
|
||||
const int DEFAULT_SETTINGS_WIDGET_WIDTH_COMPACT = 96;
|
||||
const int TRACK_OP_WIDTH_COMPACT = 60;
|
||||
|
||||
|
||||
const int TCO_BORDER_WIDTH = 1;
|
||||
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ lmmsicon ICON data/lmms.ico
|
||||
#include <windows.h>
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,4,12,0
|
||||
FILEVERSION 0,4,13,0
|
||||
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
|
||||
FILEOS VOS_NT_WINDOWS32
|
||||
FILETYPE VFT_APP
|
||||
@@ -17,7 +17,7 @@ BEGIN
|
||||
VALUE "CompanyName", "LMMS Developers\0"
|
||||
VALUE "FileDescription", "Linux MultiMedia Studio\0"
|
||||
VALUE "FileVersion", "@VERSION@\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2011 LMMS Developers\0"
|
||||
VALUE "LegalCopyright", "Copyright (c) 2004-2012 LMMS Developers\0"
|
||||
VALUE "OriginalFilename", "lmms.exe\0"
|
||||
VALUE "ProductName", "LMMS\0"
|
||||
VALUE "ProductVersion", "@VERSION@\0"
|
||||
|
||||
@@ -7,8 +7,10 @@ Torben Hohn <torbenh@gmx.de>
|
||||
Markus Schmidt <schmidt@boomshop.net>
|
||||
Tom Szilagyi <tomszilagyi@gmail.com>
|
||||
Damien Zammit <damien.zammit@gmail.com>
|
||||
Christian Holschuh
|
||||
|
||||
Additional bugfixes/enhancement patches:
|
||||
David Täht <d@teklibre.com>
|
||||
Dave Robillard <dave@drobilla.net>
|
||||
Alexandre Prokoudine <alexandre.prokoudine@gmail.com>
|
||||
Carl Hetherington <cth@carlh.net>
|
||||
|
||||
@@ -15,12 +15,15 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <calf/audio_fx.h>
|
||||
#include <calf/giface.h>
|
||||
#include <stdlib.h>
|
||||
#include <time.h>
|
||||
#include <math.h>
|
||||
|
||||
using namespace calf_plugins;
|
||||
using namespace dsp;
|
||||
@@ -37,7 +40,7 @@ simple_phaser::simple_phaser(int _max_stages, float *x1vals, float *y1vals)
|
||||
state = 0;
|
||||
cnt = 0;
|
||||
stages = 0;
|
||||
set_stages(_max_stages);
|
||||
set_stages(_max_stages);
|
||||
}
|
||||
|
||||
void simple_phaser::set_stages(int _stages)
|
||||
@@ -74,7 +77,7 @@ void simple_phaser::control_step()
|
||||
v ^= sign;
|
||||
// triangle wave, range from 0 to INT_MAX
|
||||
double vf = (double)((v >> 16) * (1.0 / 16384.0) - 1);
|
||||
|
||||
|
||||
float freq = base_frq * pow(2.0, vf * mod_depth / 1200.0);
|
||||
freq = dsp::clip<float>(freq, 10.0, 0.49 * sample_rate);
|
||||
stage1.set_ap_w(freq * (M_PI / 2.0) * odsr);
|
||||
@@ -98,7 +101,7 @@ void simple_phaser::process(float *buf_out, float *buf_in, int nsamples)
|
||||
for (int j = 0; j < stages; j++)
|
||||
fd = stage1.process_ap(fd, x1[j], y1[j]);
|
||||
state = fd;
|
||||
|
||||
|
||||
float sdry = in * gs_dry.get();
|
||||
float swet = fd * gs_wet.get();
|
||||
*buf_out++ = sdry + swet;
|
||||
@@ -110,14 +113,14 @@ float simple_phaser::freq_gain(float freq, float sr) const
|
||||
typedef std::complex<double> cfloat;
|
||||
freq *= 2.0 * M_PI / sr;
|
||||
cfloat z = 1.0 / exp(cfloat(0.0, freq)); // z^-1
|
||||
|
||||
|
||||
cfloat p = cfloat(1.0);
|
||||
cfloat stg = stage1.h_z(z);
|
||||
|
||||
|
||||
for (int i = 0; i < stages; i++)
|
||||
p = p * stg;
|
||||
|
||||
p = p / (cfloat(1.0) - cfloat(fb) * p);
|
||||
|
||||
p = p / (cfloat(1.0) - cfloat(fb) * p);
|
||||
return std::abs(cfloat(gs_dry.get_last()) + cfloat(gs_wet.get_last()) * p);
|
||||
}
|
||||
|
||||
@@ -138,7 +141,7 @@ void biquad_filter_module::calculate_filter(float freq, float q, int mode, float
|
||||
order = mode - mode_6db_br + 1;
|
||||
left[0].set_br_rbj(freq, order * 0.1 * q, srate, gain);
|
||||
}
|
||||
|
||||
|
||||
right[0].copy_coeffs(left[0]);
|
||||
for (int i = 1; i < order; i++) {
|
||||
left[i].copy_coeffs(left[0]);
|
||||
@@ -168,16 +171,16 @@ int biquad_filter_module::process_channel(uint16_t channel_no, const float *in,
|
||||
case 0:
|
||||
filter = left;
|
||||
break;
|
||||
|
||||
|
||||
case 1:
|
||||
filter = right;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
assert(false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
if (inmask) {
|
||||
switch(order) {
|
||||
case 1:
|
||||
@@ -288,10 +291,10 @@ void reverb::update_times()
|
||||
tl[5] = 1577 << 16, tr[5] = 1881 << 16;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
float fDec=1000 + 2400.f * diffusion;
|
||||
for (int i = 0 ; i < 6; i++) {
|
||||
ldec[i]=exp(-float(tl[i] >> 16) / fDec),
|
||||
ldec[i]=exp(-float(tl[i] >> 16) / fDec),
|
||||
rdec[i]=exp(-float(tr[i] >> 16) / fDec);
|
||||
}
|
||||
}
|
||||
@@ -311,11 +314,11 @@ void reverb::reset()
|
||||
void reverb::process(float &left, float &right)
|
||||
{
|
||||
unsigned int ipart = phase.ipart();
|
||||
|
||||
|
||||
// the interpolated LFO might be an overkill here
|
||||
int lfo = phase.lerp_by_fract_int<int, 14, int>(sine.data[ipart], sine.data[ipart+1]) >> 2;
|
||||
phase += dphase;
|
||||
|
||||
|
||||
left += old_right;
|
||||
left = apL1.process_allpass_comb_lerp16(left, tl[0] - 45*lfo, ldec[0]);
|
||||
left = apL2.process_allpass_comb_lerp16(left, tl[1] + 47*lfo, ldec[1]);
|
||||
@@ -337,7 +340,7 @@ void reverb::process(float &left, float &right)
|
||||
right = apR6.process_allpass_comb_lerp16(right, tr[5] - 46*lfo, rdec[5]);
|
||||
old_right = lp_right.process(right * fb);
|
||||
sanitize(old_right);
|
||||
|
||||
|
||||
left = out_left, right = out_right;
|
||||
}
|
||||
|
||||
@@ -351,6 +354,8 @@ tap_distortion::tap_distortion()
|
||||
is_active = false;
|
||||
srate = 0;
|
||||
meter = 0.f;
|
||||
prev_med = prev_out = 0.f;
|
||||
drive_old = blend_old = -1.f;
|
||||
}
|
||||
|
||||
void tap_distortion::activate()
|
||||
@@ -381,7 +386,7 @@ void tap_distortion::set_params(float blend, float drive)
|
||||
an = rbdr*rbdr / sq;
|
||||
imr = 2.0f * knb + D(2.0f * kna + 4.0f * an - 1.0f);
|
||||
pwrq = 2.0f / (imr + 1.0f);
|
||||
|
||||
|
||||
drive_old = drive;
|
||||
blend_old = blend;
|
||||
}
|
||||
@@ -530,3 +535,295 @@ bool simple_lfo::get_dot(float &x, float &y, int &size, cairo_iface *context) co
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// Lookahead Limiter by Christian Holschuh and Markus Schmidt
|
||||
|
||||
lookahead_limiter::lookahead_limiter() {
|
||||
is_active = false;
|
||||
channels = 2;
|
||||
id = 0;
|
||||
buffer_size = 0;
|
||||
overall_buffer_size = 0;
|
||||
att = 1.f;
|
||||
att_max = 1.0;
|
||||
pos = 0;
|
||||
delta = 0.f;
|
||||
_delta = 0.f;
|
||||
peak = 0.f;
|
||||
over_s = 0;
|
||||
over_c = 1.f;
|
||||
attack = 0.005;
|
||||
use_multi = false;
|
||||
weight = 1.f;
|
||||
_sanitize = false;
|
||||
auto_release = false;
|
||||
asc_active = false;
|
||||
nextiter = 0;
|
||||
nextlen = 0;
|
||||
asc = 0.f;
|
||||
asc_c = 0;
|
||||
asc_pos = -1;
|
||||
asc_changed = false;
|
||||
asc_coeff = 1.f;
|
||||
}
|
||||
|
||||
void lookahead_limiter::activate()
|
||||
{
|
||||
is_active = true;
|
||||
pos = 0;
|
||||
|
||||
}
|
||||
|
||||
void lookahead_limiter::set_multi(bool set) { use_multi = set; }
|
||||
|
||||
void lookahead_limiter::deactivate()
|
||||
{
|
||||
is_active = false;
|
||||
}
|
||||
|
||||
float lookahead_limiter::get_attenuation()
|
||||
{
|
||||
float a = att_max;
|
||||
att_max = 1.0;
|
||||
return a;
|
||||
}
|
||||
|
||||
void lookahead_limiter::set_sample_rate(uint32_t sr)
|
||||
{
|
||||
srate = sr;
|
||||
// rebuild buffer
|
||||
overall_buffer_size = (int)(srate * (100.f / 1000.f) * channels) + channels; // buffer size attack rate multiplied by 2 channels
|
||||
buffer = (float*) calloc(overall_buffer_size, sizeof(float));
|
||||
memset(buffer, 0, overall_buffer_size * sizeof(float)); // reset buffer to zero
|
||||
pos = 0;
|
||||
|
||||
nextpos = (int*) calloc(overall_buffer_size, sizeof(int));
|
||||
nextdelta = (float*) calloc(overall_buffer_size, sizeof(float));
|
||||
memset(nextpos, -1, overall_buffer_size * sizeof(int));
|
||||
}
|
||||
|
||||
void lookahead_limiter::set_params(float l, float a, float r, float w, bool ar, float arc, bool d)
|
||||
{
|
||||
limit = l;
|
||||
attack = a / 1000.f;
|
||||
release = r / 1000.f;
|
||||
auto_release = ar;
|
||||
asc_coeff = arc;
|
||||
debug = d;
|
||||
weight = w;
|
||||
}
|
||||
|
||||
void lookahead_limiter::reset() {
|
||||
int bs = (int)(srate * attack * channels);
|
||||
buffer_size = bs - bs % channels; // buffer size attack rate
|
||||
_sanitize = true;
|
||||
pos = 0;
|
||||
nextpos[0] = -1;
|
||||
nextlen = 0;
|
||||
nextiter = 0;
|
||||
delta = 0.f;
|
||||
att = 1.f;
|
||||
reset_asc();
|
||||
}
|
||||
|
||||
void lookahead_limiter::reset_asc() {
|
||||
asc = 0.f;
|
||||
asc_c = 0;
|
||||
asc_pos = pos;
|
||||
asc_changed = true;
|
||||
}
|
||||
|
||||
void lookahead_limiter::process(float &left, float &right, float * multi_buffer)
|
||||
{
|
||||
// PROTIP: harming paying customers enough to make them develop a competing
|
||||
// product may be considered an example of a less than sound business practice.
|
||||
|
||||
// fill lookahead buffer
|
||||
if(_sanitize) {
|
||||
// if we're sanitizing (zeroing) the buffer on attack time change,
|
||||
// don't write the samples to the buffer
|
||||
buffer[pos] = 0.f;
|
||||
buffer[pos + 1] = 0.f;
|
||||
} else {
|
||||
buffer[pos] = left;
|
||||
buffer[pos + 1] = right;
|
||||
}
|
||||
|
||||
// are we using multiband? get the multiband coefficient or use 1.f
|
||||
float multi_coeff = (use_multi) ? multi_buffer[pos] : 1.f;
|
||||
|
||||
// input peak - impact higher in left or right channel?
|
||||
peak = fabs(left) > fabs(right) ? fabs(left) : fabs(right);
|
||||
|
||||
// calc the real limit including weight and multi coeff
|
||||
float _limit = limit * multi_coeff * weight;
|
||||
|
||||
// add an eventually appearing peak to the asc fake buffer if asc active
|
||||
if(auto_release and peak > _limit) {
|
||||
asc += peak;
|
||||
asc_c ++;
|
||||
}
|
||||
|
||||
if(peak > _limit or multi_coeff < 1.0) {
|
||||
float _multi_coeff = 1.f;
|
||||
float _peak;
|
||||
|
||||
// calc the attenuation needed to reduce incoming peak
|
||||
float _att = std::min(_limit / peak, 1.f);
|
||||
|
||||
|
||||
// calc a release delta from this attenuation
|
||||
float _rdelta = (1.0 - _att) / (srate * release);
|
||||
if(auto_release and asc_c > 0) {
|
||||
// check if releasing to average level of peaks is steeper than
|
||||
// releasing to 1.f
|
||||
float _delta = std::max((limit * weight) / (asc_coeff * asc) * (float)asc_c - _att, 0.000001f) / (srate * release);
|
||||
if(_delta < _rdelta) {
|
||||
asc_active = true;
|
||||
_rdelta = _delta;
|
||||
}
|
||||
}
|
||||
|
||||
// calc the delta for walking to incoming peak attenuation
|
||||
float _delta = (_limit / peak - att) / buffer_size * channels;
|
||||
|
||||
if(_delta < delta) {
|
||||
// is the delta more important than the actual one?
|
||||
// if so, we can forget about all stored deltas (because they can't
|
||||
// be more important - we already checked that earlier) and use this
|
||||
// delta now. and we have to create a release delta in nextpos buffer
|
||||
nextpos[0] = pos;
|
||||
nextpos[1] = -1;
|
||||
nextdelta[0] = _rdelta;
|
||||
nextlen = 1;
|
||||
nextiter = 0;
|
||||
delta = _delta;
|
||||
} else {
|
||||
// we have a peak on input its delta is less important than the
|
||||
// actual delta. But what about the stored deltas we're following?
|
||||
bool _found = false;
|
||||
int i = 0;
|
||||
for(i = nextiter; i < nextiter + nextlen; i++) {
|
||||
// walk through our nextpos buffer
|
||||
int j = i % buffer_size;
|
||||
// calculate a delta for the next stored peak
|
||||
// are we using multiband? then get the multi_coeff for the
|
||||
// stored position
|
||||
_multi_coeff = (use_multi) ? multi_buffer[nextpos[j]] : 1.f;
|
||||
// is the left or the right channel on this position more
|
||||
// important?
|
||||
_peak = fabs(buffer[nextpos[j]]) > fabs(buffer[nextpos[j] + 1]) ? fabs(buffer[nextpos[j]]) : fabs(buffer[nextpos[j] + 1]);
|
||||
// calc a delta to use to reach our incoming peak from the
|
||||
// stored position
|
||||
_delta = (_limit / peak - (limit * _multi_coeff * weight) / _peak) / (((buffer_size - nextpos[j] + pos) % buffer_size) / channels);
|
||||
if(_delta < nextdelta[j]) {
|
||||
// if the buffered delta is more important than the delta
|
||||
// used to reach our peak from the stored position, store
|
||||
// the new delta at that position and stop the loop
|
||||
nextdelta[j] = _delta;
|
||||
_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(_found) {
|
||||
// there was something more important in the next-buffer.
|
||||
// throw away any position and delta after the important
|
||||
// position and add a new release delta
|
||||
nextlen = i - nextiter + 1;
|
||||
nextpos[(nextiter + nextlen) % buffer_size] = pos;
|
||||
nextdelta[(nextiter + nextlen) % buffer_size] = _rdelta;
|
||||
// set the next following position value to -1 (cleaning up the
|
||||
// nextpos buffer)
|
||||
nextpos[(nextiter + nextlen + 1) % buffer_size] = -1;
|
||||
// and raise the length of our nextpos buffer for keeping the
|
||||
// release value
|
||||
nextlen ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// switch left and right pointers in buffer to output position
|
||||
left = buffer[(pos + channels) % buffer_size];
|
||||
right = buffer[(pos + channels + 1) % buffer_size];
|
||||
|
||||
// if a peak leaves the buffer, remove it from asc fake buffer
|
||||
// but only if we're not sanitizing asc buffer
|
||||
float _peak = fabs(left) > fabs(right) ? fabs(left) : fabs(right);
|
||||
float _multi_coeff = (use_multi) ? multi_buffer[(pos + channels) % buffer_size] : 1.f;
|
||||
if(pos == asc_pos and !asc_changed) {
|
||||
asc_pos = -1;
|
||||
}
|
||||
if(auto_release and asc_pos == -1 and _peak > (limit * weight * _multi_coeff)) {
|
||||
asc -= _peak;
|
||||
asc_c --;
|
||||
}
|
||||
|
||||
// change the attenuation level
|
||||
att += delta;
|
||||
|
||||
// ...and calculate outpout from it
|
||||
left *= att;
|
||||
right *= att;
|
||||
|
||||
if((pos + channels) % buffer_size == nextpos[nextiter]) {
|
||||
// if we reach a buffered position, change the actual delta and erase
|
||||
// this (the first) element from nextpos and nextdelta buffer
|
||||
delta = nextdelta[nextiter];
|
||||
nextlen = (nextlen - 1) % buffer_size;
|
||||
nextpos[nextiter] = -1;
|
||||
nextiter = (nextiter + 1) % buffer_size;
|
||||
}
|
||||
|
||||
if (att > 1.0f) {
|
||||
// release time seems over, reset attenuation and delta
|
||||
att = 1.0f;
|
||||
delta = 0.0f;
|
||||
}
|
||||
|
||||
// main limiting party is over, let's cleanup the puke
|
||||
|
||||
if(_sanitize) {
|
||||
// we're sanitizing? then send 0.f as output
|
||||
left = 0.f;
|
||||
right = 0.f;
|
||||
}
|
||||
|
||||
// security personnel pawing your values
|
||||
if(att <= 0.f) {
|
||||
// if this happens we're doomed!!
|
||||
// may happen on manually lowering attack
|
||||
att = 0.0000000000001;
|
||||
delta = (1.0f - att) / (srate * release);
|
||||
}
|
||||
|
||||
if(att != 1.f and 1 - att < 0.0000000000001) {
|
||||
// denormalize att
|
||||
att = 1.f;
|
||||
}
|
||||
|
||||
if(delta != 0.f and fabs(delta) < 0.00000000000001) {
|
||||
// denormalize delta
|
||||
delta = 0.f;
|
||||
}
|
||||
|
||||
// post treatment (denormal, limit)
|
||||
denormal(&left);
|
||||
denormal(&right);
|
||||
|
||||
// store max attenuation for meter output
|
||||
att_max = (att < att_max) ? att : att_max;
|
||||
|
||||
// step forward in our sample ring buffer
|
||||
pos = (pos + channels) % buffer_size;
|
||||
|
||||
// sanitizing is always done after a full cycle through the lookahead buffer
|
||||
if(_sanitize and pos == 0) _sanitize = false;
|
||||
|
||||
asc_changed = false;
|
||||
}
|
||||
|
||||
bool lookahead_limiter::get_asc() {
|
||||
if(!asc_active) return false;
|
||||
asc_active = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#ifndef CALF_AUDIOFX_H
|
||||
@@ -60,7 +60,7 @@ public:
|
||||
}
|
||||
void set_rate(float rate) {
|
||||
this->rate = rate;
|
||||
dphase = rate/sample_rate*4096;
|
||||
dphase = rate/sample_rate*4096;
|
||||
}
|
||||
float get_wet() const {
|
||||
return wet;
|
||||
@@ -118,21 +118,21 @@ public:
|
||||
return stages;
|
||||
}
|
||||
void set_stages(int _stages);
|
||||
|
||||
|
||||
float get_mod_depth() const {
|
||||
return mod_depth;
|
||||
}
|
||||
void set_mod_depth(float _mod_depth) {
|
||||
mod_depth = _mod_depth;
|
||||
}
|
||||
|
||||
|
||||
float get_fb() const {
|
||||
return fb;
|
||||
}
|
||||
void set_fb(float fb) {
|
||||
this->fb = fb;
|
||||
}
|
||||
|
||||
|
||||
virtual void setup(int sample_rate) {
|
||||
modulation_effect::setup(sample_rate);
|
||||
reset();
|
||||
@@ -181,7 +181,7 @@ class simple_chorus: public chorus_base
|
||||
{
|
||||
protected:
|
||||
simple_delay<MaxDelay,T> delay;
|
||||
public:
|
||||
public:
|
||||
simple_chorus() {
|
||||
rate = 0.63f;
|
||||
dry = 0.5f;
|
||||
@@ -206,7 +206,7 @@ public:
|
||||
for (int i=0; i<nsamples; i++) {
|
||||
phase += dphase;
|
||||
unsigned int ipart = phase.ipart();
|
||||
|
||||
|
||||
float in = *buf_in++;
|
||||
int lfo = phase.lerp_by_fract_int<int, 14, int>(sine.data[ipart], sine.data[ipart+1]);
|
||||
int v = mds + (mdepth * lfo >> 6);
|
||||
@@ -265,16 +265,16 @@ public:
|
||||
unsigned int ipart = this->phase.ipart();
|
||||
int lfo = phase.lerp_by_fract_int<int, 14, int>(this->sine.data[ipart], this->sine.data[ipart+1]);
|
||||
delay_pos = mds + (mdepth * lfo >> 6);
|
||||
|
||||
|
||||
if (delay_pos != last_delay_pos || ramp_pos < 1024)
|
||||
{
|
||||
if (delay_pos != last_delay_pos) {
|
||||
// we need to ramp from what the delay tap length actually was,
|
||||
// we need to ramp from what the delay tap length actually was,
|
||||
// not from old (ramp_delay_pos) or desired (delay_pos) tap length
|
||||
ramp_delay_pos = last_actual_delay_pos;
|
||||
ramp_pos = 0;
|
||||
}
|
||||
|
||||
|
||||
int64_t dp = 0;
|
||||
for (int i=0; i<nsamples; i++) {
|
||||
float in = *buf_in++;
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
typedef std::complex<double> cfloat;
|
||||
freq *= 2.0 * M_PI / sr;
|
||||
cfloat z = 1.0 / exp(cfloat(0.0, freq)); // z^-1
|
||||
|
||||
|
||||
float ldp = last_delay_pos / 65536.0;
|
||||
float fldp = floor(ldp);
|
||||
cfloat zn = std::pow(z, fldp); // z^-N
|
||||
@@ -352,7 +352,7 @@ class reverb: public audio_effect
|
||||
float time, fb, cutoff, diffusion;
|
||||
int tl[6], tr[6];
|
||||
float ldec[6], rdec[6];
|
||||
|
||||
|
||||
int sr;
|
||||
public:
|
||||
reverb()
|
||||
@@ -443,17 +443,17 @@ class biquad_filter_module: public filter_module_iface
|
||||
private:
|
||||
dsp::biquad_d1<float> left[3], right[3];
|
||||
int order;
|
||||
|
||||
public:
|
||||
|
||||
public:
|
||||
uint32_t srate;
|
||||
|
||||
enum { mode_12db_lp = 0, mode_24db_lp = 1, mode_36db_lp = 2,
|
||||
|
||||
enum { mode_12db_lp = 0, mode_24db_lp = 1, mode_36db_lp = 2,
|
||||
mode_12db_hp = 3, mode_24db_hp = 4, mode_36db_hp = 5,
|
||||
mode_6db_bp = 6, mode_12db_bp = 7, mode_18db_bp = 8,
|
||||
mode_6db_br = 9, mode_12db_br = 10, mode_18db_br = 11,
|
||||
mode_count
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
biquad_filter_module()
|
||||
: order(0) {}
|
||||
@@ -481,14 +481,14 @@ public:
|
||||
lowcut.reset();
|
||||
highcut.reset();
|
||||
}
|
||||
|
||||
|
||||
inline float process(float v)
|
||||
{
|
||||
v = dsp::lerp(lowcut.process_hp(v), v, low_gain);
|
||||
v = dsp::lerp(highcut.process_lp(v), v, high_gain);
|
||||
return v;
|
||||
}
|
||||
|
||||
|
||||
inline void copy_coeffs(const two_band_eq &src)
|
||||
{
|
||||
lowcut.copy_coeffs(src.lowcut);
|
||||
@@ -496,13 +496,13 @@ public:
|
||||
low_gain = src.low_gain;
|
||||
high_gain = src.high_gain;
|
||||
}
|
||||
|
||||
|
||||
void sanitize()
|
||||
{
|
||||
lowcut.sanitize();
|
||||
highcut.sanitize();
|
||||
}
|
||||
|
||||
|
||||
void set(float _low_freq, float _low_gain, float _high_freq, float _high_gain, float sr)
|
||||
{
|
||||
lowcut.set_hp(_low_freq, sr);
|
||||
@@ -565,6 +565,58 @@ public:
|
||||
bool get_dot(float &x, float &y, int &size, calf_plugins::cairo_iface *context) const;
|
||||
};
|
||||
|
||||
|
||||
/// Lookahead Limiter by Markus Schmidt and Christian Holschuh
|
||||
class lookahead_limiter {
|
||||
private:
|
||||
public:
|
||||
float limit, attack, release, weight;
|
||||
uint32_t srate;
|
||||
float att; // a coefficient the output is multiplied with
|
||||
float att_max; // a memory for the highest attenuation - used for display
|
||||
unsigned int pos; // where we are actually in our sample buffer
|
||||
unsigned int buffer_size;
|
||||
unsigned int overall_buffer_size;
|
||||
bool is_active;
|
||||
bool debug;
|
||||
bool auto_release;
|
||||
bool asc_active;
|
||||
float *buffer;
|
||||
int channels;
|
||||
float delta;
|
||||
float _delta;
|
||||
float peak;
|
||||
unsigned int over_s;
|
||||
float over_c;
|
||||
bool use_multi;
|
||||
unsigned int id;
|
||||
bool _sanitize;
|
||||
int nextiter;
|
||||
int nextlen;
|
||||
int * nextpos;
|
||||
float * nextdelta;
|
||||
int asc_c;
|
||||
float asc;
|
||||
int asc_pos;
|
||||
bool asc_changed;
|
||||
float asc_coeff;
|
||||
static inline void denormal(volatile float *f) {
|
||||
*f += 1e-18;
|
||||
*f -= 1e-18;
|
||||
}
|
||||
void reset();
|
||||
void reset_asc();
|
||||
bool get_asc();
|
||||
lookahead_limiter();
|
||||
void set_multi(bool set);
|
||||
void process(float &left, float &right, float *multi_buffer);
|
||||
void set_sample_rate(uint32_t sr);
|
||||
void set_params(float l, float a, float r, float weight = 1.f, bool ar = false, float arc = 1.f, bool d = false);
|
||||
float get_attenuation();
|
||||
void activate();
|
||||
void deactivate();
|
||||
};
|
||||
|
||||
#if 0
|
||||
{ to keep editor happy
|
||||
#endif
|
||||
|
||||
@@ -429,6 +429,11 @@ struct biquad_d2: public biquad_coeffs<Coeff>
|
||||
/// direct II form with two state variables
|
||||
inline T process(T in)
|
||||
{
|
||||
dsp::sanitize_denormal(in);
|
||||
dsp::sanitize(in);
|
||||
dsp::sanitize(w1);
|
||||
dsp::sanitize(w2);
|
||||
|
||||
T tmp = in - w1 * b1 - w2 * b2;
|
||||
T out = tmp * a0 + w1 * a1 + w2 * a2;
|
||||
w2 = w1;
|
||||
|
||||
@@ -92,7 +92,7 @@ struct simple_delay {
|
||||
*/
|
||||
template<class U>
|
||||
inline void get_interp(U &odata, int delay, float udelay) {
|
||||
// assert(delay >= 0 && delay < N-1);
|
||||
// assert(delay >= 0 && delay <= N-1);
|
||||
int ppos = wrap_around<N>(pos + N - delay);
|
||||
int pppos = wrap_around<N>(ppos + N - 1);
|
||||
odata = lerp(data[ppos], data[pppos], udelay);
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <lv2.h>
|
||||
#include <calf/giface.h>
|
||||
#include <calf/lv2_event.h>
|
||||
#include <calf/lv2_persist.h>
|
||||
#include <calf/lv2_state.h>
|
||||
#include <calf/lv2_progress.h>
|
||||
#include <calf/lv2_uri_map.h>
|
||||
#include <string.h>
|
||||
@@ -86,17 +86,17 @@ struct lv2_instance: public plugin_ctl_iface, public progress_report_iface
|
||||
void send_configures(send_configure_iface *sci) {
|
||||
module->send_configures(sci);
|
||||
}
|
||||
void impl_restore(LV2_Persist_Retrieve_Function retrieve, void *callback_data)
|
||||
void impl_restore(LV2_State_Retrieve_Function retrieve, void *callback_data)
|
||||
{
|
||||
const char *const *vars = module->get_metadata_iface()->get_configure_vars();
|
||||
if (!vars)
|
||||
return;
|
||||
assert(uri_map);
|
||||
uint32_t string_type = uri_map->uri_to_id(uri_map, NULL, "http://lv2plug.in/ns/ext/atom#String");
|
||||
uint32_t string_type = uri_map->uri_to_id(uri_map->callback_data, NULL, "http://lv2plug.in/ns/ext/atom#String");
|
||||
assert(string_type);
|
||||
for (unsigned int i = 0; vars[i]; i++)
|
||||
{
|
||||
const uint32_t key = uri_map->uri_to_id(uri_map, NULL, vars[i]);
|
||||
const uint32_t key = uri_map->uri_to_id(uri_map->callback_data, NULL, vars[i]);
|
||||
size_t len = 0;
|
||||
uint32_t type = 0;
|
||||
uint32_t flags = 0;
|
||||
@@ -182,7 +182,7 @@ struct lv2_wrapper
|
||||
typedef lv2_instance instance;
|
||||
static LV2_Descriptor descriptor;
|
||||
static LV2_Calf_Descriptor calf_descriptor;
|
||||
static LV2_Persist persist;
|
||||
static LV2_State_Interface state_iface;
|
||||
std::string uri;
|
||||
|
||||
lv2_wrapper()
|
||||
@@ -197,8 +197,8 @@ struct lv2_wrapper
|
||||
descriptor.deactivate = cb_deactivate;
|
||||
descriptor.cleanup = cb_cleanup;
|
||||
descriptor.extension_data = cb_ext_data;
|
||||
persist.save = cb_persist_save;
|
||||
persist.restore = cb_persist_restore;
|
||||
state_iface.save = cb_state_save;
|
||||
state_iface.restore = cb_state_restore;
|
||||
calf_descriptor.get_pci = cb_get_pci;
|
||||
}
|
||||
|
||||
@@ -294,16 +294,18 @@ struct lv2_wrapper
|
||||
{
|
||||
if (!strcmp(URI, "http://foltman.com/ns/calf-plugin-instance"))
|
||||
return &calf_descriptor;
|
||||
if (!strcmp(URI, LV2_PERSIST_URI))
|
||||
return &persist;
|
||||
if (!strcmp(URI, LV2_STATE_INTERFACE_URI))
|
||||
return &state_iface;
|
||||
return NULL;
|
||||
}
|
||||
static void cb_persist_save(LV2_Handle Instance, LV2_Persist_Store_Function store, void *callback_data)
|
||||
static void cb_state_save(LV2_Handle Instance,
|
||||
LV2_State_Store_Function store, LV2_State_Handle handle,
|
||||
uint32_t flags, const LV2_Feature *const * features)
|
||||
{
|
||||
instance *const inst = (instance *)Instance;
|
||||
struct store_state: public send_configure_iface
|
||||
{
|
||||
LV2_Persist_Store_Function store;
|
||||
LV2_State_Store_Function store;
|
||||
void *callback_data;
|
||||
instance *inst;
|
||||
uint32_t string_data_type;
|
||||
@@ -311,24 +313,26 @@ struct lv2_wrapper
|
||||
virtual void send_configure(const char *key, const char *value)
|
||||
{
|
||||
(*store)(callback_data,
|
||||
inst->uri_map->uri_to_id(inst->uri_map, NULL, key),
|
||||
inst->uri_map->uri_to_id(inst->uri_map->callback_data, NULL, key),
|
||||
value,
|
||||
strlen(value) + 1,
|
||||
string_data_type,
|
||||
LV2_PERSIST_IS_POD|LV2_PERSIST_IS_PORTABLE);
|
||||
LV2_STATE_IS_POD|LV2_STATE_IS_PORTABLE);
|
||||
}
|
||||
};
|
||||
// A host that supports Persist MUST support URI-Map as well.
|
||||
// A host that supports State MUST support URI-Map as well.
|
||||
assert(inst->uri_map);
|
||||
store_state s;
|
||||
s.store = store;
|
||||
s.callback_data = callback_data;
|
||||
s.callback_data = handle;
|
||||
s.inst = inst;
|
||||
s.string_data_type = inst->uri_map->uri_to_id(inst->uri_map, NULL, "http://lv2plug.in/ns/ext/atom#String");
|
||||
s.string_data_type = inst->uri_map->uri_to_id(inst->uri_map->callback_data, NULL, "http://lv2plug.in/ns/ext/atom#String");
|
||||
|
||||
inst->send_configures(&s);
|
||||
}
|
||||
static void cb_persist_restore(LV2_Handle Instance, LV2_Persist_Retrieve_Function retrieve, void *callback_data)
|
||||
static void cb_state_restore(LV2_Handle Instance,
|
||||
LV2_State_Retrieve_Function retrieve, LV2_State_Handle callback_data,
|
||||
uint32_t flags, const LV2_Feature *const * features)
|
||||
{
|
||||
instance *const inst = (instance *)Instance;
|
||||
inst->impl_restore(retrieve, callback_data);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
/// A multitap stereo chorus thing - metadata
|
||||
struct multichorus_metadata: public plugin_metadata<multichorus_metadata>
|
||||
{
|
||||
public:
|
||||
public:
|
||||
enum { par_delay, par_depth, par_rate, par_stereo, par_voices, par_vphase, par_amount, par_dryamount, par_freq, par_freq2, par_q, par_overlap, param_count };
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, rt_capable = true, support_midi = false, require_midi = false };
|
||||
PLUGIN_NAME_ID_LABEL("multichorus", "multichorus", "Multi Chorus")
|
||||
@@ -106,12 +106,12 @@ struct monosynth_metadata: public plugin_metadata<monosynth_metadata>
|
||||
{
|
||||
enum { wave_saw, wave_sqr, wave_pulse, wave_sine, wave_triangle, wave_varistep, wave_skewsaw, wave_skewsqr, wave_test1, wave_test2, wave_test3, wave_test4, wave_test5, wave_test6, wave_test7, wave_test8, wave_count };
|
||||
enum { flt_lp12, flt_lp24, flt_2lp12, flt_hp12, flt_lpbr, flt_hpbr, flt_bp6, flt_2bp6 };
|
||||
enum { par_wave1, par_wave2, par_pw1, par_pw2, par_detune, par_osc2xpose, par_oscmode, par_oscmix, par_filtertype, par_cutoff, par_resonance, par_cutoffsep, par_env1tocutoff, par_env1tores, par_env1toamp,
|
||||
par_env1attack, par_env1decay, par_env1sustain, par_env1fade, par_env1release,
|
||||
par_keyfollow, par_legato, par_portamento, par_vel2filter, par_vel2amp, par_master, par_pwhlrange,
|
||||
enum { par_wave1, par_wave2, par_pw1, par_pw2, par_detune, par_osc2xpose, par_oscmode, par_oscmix, par_filtertype, par_cutoff, par_resonance, par_cutoffsep, par_env1tocutoff, par_env1tores, par_env1toamp,
|
||||
par_env1attack, par_env1decay, par_env1sustain, par_env1fade, par_env1release,
|
||||
par_keyfollow, par_legato, par_portamento, par_vel2filter, par_vel2amp, par_master, par_pwhlrange,
|
||||
par_lforate, par_lfodelay, par_lfofilter, par_lfopitch, par_lfopw, par_mwhl_lfo, par_scaledetune,
|
||||
par_env2tocutoff, par_env2tores, par_env2toamp,
|
||||
par_env2attack, par_env2decay, par_env2sustain, par_env2fade, par_env2release,
|
||||
par_env2tocutoff, par_env2tores, par_env2toamp,
|
||||
par_env2attack, par_env2decay, par_env2sustain, par_env2fade, par_env2release,
|
||||
par_stretch1, par_window1,
|
||||
par_lfo1trig, par_lfo2trig,
|
||||
par_lfo2rate, par_lfo2delay,
|
||||
@@ -144,9 +144,9 @@ struct monosynth_metadata: public plugin_metadata<monosynth_metadata>
|
||||
moddest_count,
|
||||
};
|
||||
PLUGIN_NAME_ID_LABEL("monosynth", "monosynth", "Monosynth")
|
||||
|
||||
|
||||
mod_matrix_metadata mm_metadata;
|
||||
|
||||
|
||||
monosynth_metadata();
|
||||
/// Lookup of table edit interface
|
||||
virtual const table_metadata_iface *get_table_metadata_iface(const char *key) const { if (!strcmp(key, "mod_matrix")) return &mm_metadata; else return NULL; }
|
||||
@@ -159,7 +159,7 @@ struct compressor_metadata: public plugin_metadata<compressor_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, MONO_VU_METER_PARAMS,
|
||||
param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_compression,
|
||||
param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_compression,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("compressor", "compressor", "Compressor")
|
||||
};
|
||||
@@ -169,9 +169,9 @@ struct sidechaincompressor_metadata: public plugin_metadata<sidechaincompressor_
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, MONO_VU_METER_PARAMS,
|
||||
param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_compression,
|
||||
param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_compression,
|
||||
param_sc_mode, param_f1_freq, param_f2_freq, param_f1_level, param_f2_level,
|
||||
param_sc_listen, param_f1_active, param_f2_active, param_count };
|
||||
param_sc_listen, param_f1_active, param_f2_active, param_sc_route, param_sc_level, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("sidechaincompressor", "sidechaincompressor", "Sidechain Compressor")
|
||||
};
|
||||
|
||||
@@ -179,19 +179,20 @@ struct sidechaincompressor_metadata: public plugin_metadata<sidechaincompressor_
|
||||
struct multibandcompressor_metadata: public plugin_metadata<multibandcompressor_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_freq0, param_freq1, param_freq2,
|
||||
param_sep0, param_sep1, param_sep2,
|
||||
param_q0, param_q1, param_q2,
|
||||
param_mode,
|
||||
param_threshold0, param_ratio0, param_attack0, param_release0, param_makeup0, param_knee0,
|
||||
param_detection0, param_compression0, param_output0, param_bypass0, param_mute0,
|
||||
param_detection0, param_compression0, param_output0, param_bypass0, param_solo0,
|
||||
param_threshold1, param_ratio1, param_attack1, param_release1, param_makeup1, param_knee1,
|
||||
param_detection1, param_compression1, param_output1, param_bypass1, param_mute1,
|
||||
param_detection1, param_compression1, param_output1, param_bypass1, param_solo1,
|
||||
param_threshold2, param_ratio2, param_attack2, param_release2, param_makeup2, param_knee2,
|
||||
param_detection2, param_compression2, param_output2, param_bypass2, param_mute2,
|
||||
param_detection2, param_compression2, param_output2, param_bypass2, param_solo2,
|
||||
param_threshold3, param_ratio3, param_attack3, param_release3, param_makeup3, param_knee3,
|
||||
param_detection3, param_compression3, param_output3, param_bypass3, param_mute3,
|
||||
param_detection3, param_compression3, param_output3, param_bypass3, param_solo3,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("multiband_compressor", "multibandcompressor", "Multiband Compressor")
|
||||
};
|
||||
@@ -214,7 +215,7 @@ struct gate_metadata: public plugin_metadata<gate_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, MONO_VU_METER_PARAMS,
|
||||
param_range, param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_gating,
|
||||
param_range, param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_gating,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("gate", "gate", "Gate")
|
||||
};
|
||||
@@ -224,12 +225,68 @@ struct sidechaingate_metadata: public plugin_metadata<sidechaingate_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, MONO_VU_METER_PARAMS,
|
||||
param_range, param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_gating,
|
||||
param_range, param_threshold, param_ratio, param_attack, param_release, param_makeup, param_knee, param_detection, param_stereo_link, param_gating,
|
||||
param_sc_mode, param_f1_freq, param_f2_freq, param_f1_level, param_f2_level,
|
||||
param_sc_listen, param_f1_active, param_f2_active, param_count };
|
||||
param_sc_listen, param_f1_active, param_f2_active, param_sc_route, param_sc_level, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("sidechaingate", "sidechaingate", "Sidechain Gate")
|
||||
};
|
||||
|
||||
/// Markus's multiband gate - metadata
|
||||
struct multibandgate_metadata: public plugin_metadata<multibandgate_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_freq0, param_freq1, param_freq2,
|
||||
param_sep0, param_sep1, param_sep2,
|
||||
param_q0, param_q1, param_q2,
|
||||
param_mode,
|
||||
param_range0, param_threshold0, param_ratio0, param_attack0, param_release0, param_makeup0, param_knee0,
|
||||
param_detection0, param_gating0, param_output0, param_bypass0, param_solo0,
|
||||
param_range1, param_threshold1, param_ratio1, param_attack1, param_release1, param_makeup1, param_knee1,
|
||||
param_detection1, param_gating1, param_output1, param_bypass1, param_solo1,
|
||||
param_range2, param_threshold2, param_ratio2, param_attack2, param_release2, param_makeup2, param_knee2,
|
||||
param_detection2, param_gating2, param_output2, param_bypass2, param_solo2,
|
||||
param_range3, param_threshold3, param_ratio3, param_attack3, param_release3, param_makeup3, param_knee3,
|
||||
param_detection3, param_gating3, param_output3, param_bypass3, param_solo3,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("multiband_gate", "multibandgate", "Multiband Gate")
|
||||
};
|
||||
|
||||
/// Markus's limiter - metadata
|
||||
struct limiter_metadata: public plugin_metadata<limiter_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_limit, param_attack, param_release,
|
||||
param_att,
|
||||
param_asc, param_asc_led, param_asc_coeff,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("limiter", "limiter", "Limiter")
|
||||
};
|
||||
|
||||
/// Markus's multibandlimiter - metadata
|
||||
struct multibandlimiter_metadata: public plugin_metadata<multibandlimiter_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_freq0, param_freq1, param_freq2,
|
||||
param_sep0, param_sep1, param_sep2,
|
||||
param_q0, param_q1, param_q2,
|
||||
param_mode,
|
||||
param_limit, param_attack, param_release, param_minrel,
|
||||
param_att0, param_att1, param_att2, param_att3,
|
||||
param_weight0, param_weight1, param_weight2, param_weight3,
|
||||
param_release0, param_release1, param_release2, param_release3,
|
||||
param_solo0, param_solo1, param_solo2, param_solo3,
|
||||
param_effrelease0, param_effrelease1, param_effrelease2, param_effrelease3,
|
||||
param_asc, param_asc_led, param_asc_coeff,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("multiband_limiter", "multibandlimiter", "Multiband Limiter")
|
||||
};
|
||||
|
||||
/// Markus's 5-band EQ - metadata
|
||||
struct equalizer5band_metadata: public plugin_metadata<equalizer5band_metadata>
|
||||
{
|
||||
@@ -251,7 +308,7 @@ struct equalizer5band_metadata: public plugin_metadata<equalizer5band_metadata>
|
||||
struct equalizer8band_metadata: public plugin_metadata<equalizer8band_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_hp_active, param_hp_freq, param_hp_mode,
|
||||
param_lp_active, param_lp_freq, param_lp_mode,
|
||||
@@ -269,7 +326,7 @@ struct equalizer8band_metadata: public plugin_metadata<equalizer8band_metadata>
|
||||
struct equalizer12band_metadata: public plugin_metadata<equalizer12band_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS,
|
||||
param_hp_active, param_hp_freq, param_hp_mode,
|
||||
param_lp_active, param_lp_freq, param_lp_mode,
|
||||
@@ -311,7 +368,7 @@ struct exciter_metadata: public plugin_metadata<exciter_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 1, outs_optional = 1, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out, param_amount, MONO_VU_METER_PARAMS, param_drive, param_blend, param_meter_drive,
|
||||
param_freq, param_listen, param_count };
|
||||
param_freq, param_listen, param_ceil_active, param_ceil, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("exciter", "exciter", "Exciter")
|
||||
};
|
||||
/// Markus's Bass Enhancer - metadata
|
||||
@@ -319,34 +376,59 @@ struct bassenhancer_metadata: public plugin_metadata<bassenhancer_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 1, outs_optional = 1, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out, param_amount, MONO_VU_METER_PARAMS, param_drive, param_blend, param_meter_drive,
|
||||
param_freq, param_listen, param_count };
|
||||
param_freq, param_listen, param_floor_active, param_floor, param_count };
|
||||
PLUGIN_NAME_ID_LABEL("bassenhancer", "bassenhancer", "Bass Enhancer")
|
||||
};
|
||||
/// Markus's Mono Module - metadata
|
||||
struct stereo_metadata: public plugin_metadata<stereo_metadata>
|
||||
{
|
||||
enum { in_count = 2, out_count = 2, ins_optional = 1, outs_optional = 1, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
STEREO_VU_METER_PARAMS, param_balance_in, param_balance_out, param_softclip,
|
||||
param_mute_l, param_mute_r, param_phase_l, param_phase_r,
|
||||
param_mode, param_slev, param_sbal, param_mlev, param_mpan,
|
||||
param_widener, param_delay,
|
||||
param_meter_phase,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("stereo", "stereo", "Stereo Tools")
|
||||
};
|
||||
/// Markus's Mono Module - metadata
|
||||
struct mono_metadata: public plugin_metadata<mono_metadata>
|
||||
{
|
||||
enum { in_count = 1, out_count = 2, ins_optional = 1, outs_optional = 1, support_midi = false, require_midi = false, rt_capable = true };
|
||||
enum { param_bypass, param_level_in, param_level_out,
|
||||
param_meter_in, param_meter_outL, param_meter_outR, param_clip_in,param_clip_outL, param_clip_outR,
|
||||
param_balance_out, param_softclip,
|
||||
param_mute_l, param_mute_r, param_phase_l, param_phase_r,
|
||||
param_delay,
|
||||
param_count };
|
||||
PLUGIN_NAME_ID_LABEL("mono", "mono", "Mono Input")
|
||||
};
|
||||
|
||||
/// Organ - enums for parameter IDs etc. (this mess is caused by organ split between plugin and generic class - which was
|
||||
/// a bad design decision and should be sorted out some day) XXXKF @todo
|
||||
struct organ_enums
|
||||
{
|
||||
enum {
|
||||
par_drawbar1, par_drawbar2, par_drawbar3, par_drawbar4, par_drawbar5, par_drawbar6, par_drawbar7, par_drawbar8, par_drawbar9,
|
||||
par_frequency1, par_frequency2, par_frequency3, par_frequency4, par_frequency5, par_frequency6, par_frequency7, par_frequency8, par_frequency9,
|
||||
par_waveform1, par_waveform2, par_waveform3, par_waveform4, par_waveform5, par_waveform6, par_waveform7, par_waveform8, par_waveform9,
|
||||
par_detune1, par_detune2, par_detune3, par_detune4, par_detune5, par_detune6, par_detune7, par_detune8, par_detune9,
|
||||
par_phase1, par_phase2, par_phase3, par_phase4, par_phase5, par_phase6, par_phase7, par_phase8, par_phase9,
|
||||
par_pan1, par_pan2, par_pan3, par_pan4, par_pan5, par_pan6, par_pan7, par_pan8, par_pan9,
|
||||
par_routing1, par_routing2, par_routing3, par_routing4, par_routing5, par_routing6, par_routing7, par_routing8, par_routing9,
|
||||
enum {
|
||||
par_drawbar1, par_drawbar2, par_drawbar3, par_drawbar4, par_drawbar5, par_drawbar6, par_drawbar7, par_drawbar8, par_drawbar9,
|
||||
par_frequency1, par_frequency2, par_frequency3, par_frequency4, par_frequency5, par_frequency6, par_frequency7, par_frequency8, par_frequency9,
|
||||
par_waveform1, par_waveform2, par_waveform3, par_waveform4, par_waveform5, par_waveform6, par_waveform7, par_waveform8, par_waveform9,
|
||||
par_detune1, par_detune2, par_detune3, par_detune4, par_detune5, par_detune6, par_detune7, par_detune8, par_detune9,
|
||||
par_phase1, par_phase2, par_phase3, par_phase4, par_phase5, par_phase6, par_phase7, par_phase8, par_phase9,
|
||||
par_pan1, par_pan2, par_pan3, par_pan4, par_pan5, par_pan6, par_pan7, par_pan8, par_pan9,
|
||||
par_routing1, par_routing2, par_routing3, par_routing4, par_routing5, par_routing6, par_routing7, par_routing8, par_routing9,
|
||||
par_foldover,
|
||||
par_percdecay, par_perclevel, par_percwave, par_percharm, par_percvel2amp,
|
||||
par_percfmdecay, par_percfmdepth, par_percfmwave, par_percfmharm, par_percvel2fm,
|
||||
par_perctrigger, par_percstereo,
|
||||
par_filterchain,
|
||||
par_filter1type,
|
||||
par_master,
|
||||
par_master,
|
||||
par_f1cutoff, par_f1res, par_f1env1, par_f1env2, par_f1env3, par_f1keyf,
|
||||
par_f2cutoff, par_f2res, par_f2env1, par_f2env2, par_f2env3, par_f2keyf,
|
||||
par_eg1attack, par_eg1decay, par_eg1sustain, par_eg1release, par_eg1velscl, par_eg1ampctl,
|
||||
par_eg2attack, par_eg2decay, par_eg2sustain, par_eg2release, par_eg2velscl, par_eg2ampctl,
|
||||
par_eg3attack, par_eg3decay, par_eg3sustain, par_eg3release, par_eg3velscl, par_eg3ampctl,
|
||||
par_eg1attack, par_eg1decay, par_eg1sustain, par_eg1release, par_eg1velscl, par_eg1ampctl,
|
||||
par_eg2attack, par_eg2decay, par_eg2sustain, par_eg2release, par_eg2velscl, par_eg2ampctl,
|
||||
par_eg3attack, par_eg3decay, par_eg3sustain, par_eg3release, par_eg3velscl, par_eg3ampctl,
|
||||
par_lforate, par_lfoamt, par_lfowet, par_lfophase, par_lfomode, par_lfotype,
|
||||
par_transpose, par_detune,
|
||||
par_polyphony,
|
||||
@@ -358,8 +440,8 @@ struct organ_enums
|
||||
par_treblegain,
|
||||
param_count
|
||||
};
|
||||
enum organ_waveform {
|
||||
wave_sine,
|
||||
enum organ_waveform {
|
||||
wave_sine,
|
||||
wave_sinepl1, wave_sinepl2, wave_sinepl3,
|
||||
wave_ssaw, wave_ssqr, wave_spls, wave_saw, wave_sqr, wave_pulse, wave_sinepl05, wave_sqr05, wave_halfsin, wave_clvg, wave_bell, wave_bell2,
|
||||
wave_w1, wave_w2, wave_w3, wave_w4, wave_w5, wave_w6, wave_w7, wave_w8, wave_w9,
|
||||
@@ -384,7 +466,7 @@ struct organ_enums
|
||||
ampctl_all,
|
||||
ampctl_count
|
||||
};
|
||||
enum {
|
||||
enum {
|
||||
lfotype_allpass = 0,
|
||||
lfotype_cv1,
|
||||
lfotype_cv2,
|
||||
@@ -392,7 +474,7 @@ struct organ_enums
|
||||
lfotype_cvfull,
|
||||
lfotype_count
|
||||
};
|
||||
enum {
|
||||
enum {
|
||||
lfomode_off = 0,
|
||||
lfomode_direct,
|
||||
lfomode_filter1,
|
||||
@@ -415,7 +497,7 @@ struct organ_metadata: public organ_enums, public plugin_metadata<organ_metadata
|
||||
{
|
||||
enum { in_count = 0, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = true, require_midi = true, rt_capable = true };
|
||||
PLUGIN_NAME_ID_LABEL("organ", "organ", "Organ")
|
||||
|
||||
|
||||
public:
|
||||
plugin_command_info *get_commands();
|
||||
const char *const *get_configure_vars() const;
|
||||
@@ -431,7 +513,7 @@ struct fluidsynth_metadata: public plugin_metadata<fluidsynth_metadata>
|
||||
public:
|
||||
const char *const *get_configure_vars() const;
|
||||
};
|
||||
|
||||
|
||||
/// Wavetable - metadata
|
||||
struct wavetable_metadata: public plugin_metadata<wavetable_metadata>
|
||||
{
|
||||
@@ -489,25 +571,25 @@ struct wavetable_metadata: public plugin_metadata<wavetable_metadata>
|
||||
moddest_o2detune,
|
||||
moddest_count,
|
||||
};
|
||||
enum {
|
||||
enum {
|
||||
par_o1wave, par_o1offset, par_o1transpose, par_o1detune, par_o1level,
|
||||
par_o2wave, par_o2offset, par_o2transpose, par_o2detune, par_o2level,
|
||||
par_eg1attack, par_eg1decay, par_eg1sustain, par_eg1fade, par_eg1release, par_eg1velscl,
|
||||
par_eg2attack, par_eg2decay, par_eg2sustain, par_eg2fade, par_eg2release, par_eg2velscl,
|
||||
par_eg3attack, par_eg3decay, par_eg3sustain, par_eg3fade, par_eg3release, par_eg3velscl,
|
||||
par_pwhlrange,
|
||||
par_pwhlrange,
|
||||
param_count };
|
||||
enum { in_count = 0, out_count = 2, ins_optional = 0, outs_optional = 0, support_midi = true, require_midi = true, rt_capable = true };
|
||||
enum { mod_matrix_slots = 10 };
|
||||
enum { step_size = 64 };
|
||||
PLUGIN_NAME_ID_LABEL("wavetable", "wavetable", "Wavetable")
|
||||
mod_matrix_metadata mm_metadata;
|
||||
|
||||
|
||||
wavetable_metadata();
|
||||
/// Lookup of table edit interface
|
||||
virtual const table_metadata_iface *get_table_metadata_iface(const char *key) const { if (!strcmp(key, "mod_matrix")) return &mm_metadata; else return NULL; }
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,6 +15,9 @@
|
||||
PER_MODULE_ITEM(deesser, false, "deesser")
|
||||
PER_MODULE_ITEM(gate, false, "gate")
|
||||
PER_MODULE_ITEM(sidechaingate, false, "sidechaingate")
|
||||
PER_MODULE_ITEM(multibandgate, false, "multibandgate")
|
||||
PER_MODULE_ITEM(limiter, false, "limiter")
|
||||
PER_MODULE_ITEM(multibandlimiter, false, "multibandlimiter")
|
||||
PER_MODULE_ITEM(pulsator, false, "pulsator")
|
||||
PER_MODULE_ITEM(equalizer5band, false, "eq5")
|
||||
PER_MODULE_ITEM(equalizer8band, false, "eq8")
|
||||
@@ -22,6 +25,8 @@
|
||||
PER_MODULE_ITEM(saturator, false, "saturator")
|
||||
PER_MODULE_ITEM(exciter, false, "exciter")
|
||||
PER_MODULE_ITEM(bassenhancer, false, "bassenhancer")
|
||||
PER_MODULE_ITEM(mono, false, "mono")
|
||||
PER_MODULE_ITEM(stereo, false, "stereo")
|
||||
#ifdef ENABLE_EXPERIMENTAL
|
||||
PER_MODULE_ITEM(fluidsynth, true, "fluidsynth")
|
||||
PER_MODULE_ITEM(wavetable, true, "wavetable")
|
||||
|
||||
@@ -100,9 +100,10 @@ public:
|
||||
, inertia_resonance(dsp::exponential_ramp(128), 20)
|
||||
, inertia_gain(dsp::exponential_ramp(128), 1.0)
|
||||
, timer(128)
|
||||
{
|
||||
is_active = false;
|
||||
}
|
||||
, is_active(false)
|
||||
, last_generation(-1)
|
||||
, last_calculated_generation(-2)
|
||||
{}
|
||||
|
||||
void calculate_filter()
|
||||
{
|
||||
@@ -195,6 +196,7 @@ public:
|
||||
: filter_module_with_inertia<dsp::biquad_filter_module, filter_metadata>(ins, outs, params)
|
||||
{
|
||||
last_generation = 0;
|
||||
old_mode = old_resonance = old_cutoff = -1;
|
||||
}
|
||||
void params_changed()
|
||||
{
|
||||
@@ -239,6 +241,63 @@ private:
|
||||
void adjust_gain_according_to_filter_mode(int velocity);
|
||||
};
|
||||
|
||||
|
||||
#define MATH_E 2.718281828
|
||||
class mono_audio_module:
|
||||
public audio_module<mono_metadata>
|
||||
{
|
||||
typedef mono_audio_module AM;
|
||||
uint32_t srate;
|
||||
bool active;
|
||||
|
||||
uint32_t clip_in, clip_outL, clip_outR;
|
||||
float meter_in, meter_outL, meter_outR;
|
||||
|
||||
float * buffer;
|
||||
unsigned int pos;
|
||||
unsigned int buffer_size;
|
||||
|
||||
void softclip(float &s) {
|
||||
int ph = s / fabs(s);
|
||||
s = s > 0.63 ? ((0.63 + 0.36) * ph * (1 - pow(MATH_E, (1.f / 3) * (0.63 + s * ph)))) : s;
|
||||
}
|
||||
public:
|
||||
mono_audio_module();
|
||||
void params_changed();
|
||||
void activate();
|
||||
void set_sample_rate(uint32_t sr);
|
||||
void deactivate();
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
};
|
||||
|
||||
class stereo_audio_module:
|
||||
public audio_module<stereo_metadata>
|
||||
{
|
||||
typedef stereo_audio_module AM;
|
||||
float LL, LR, RL, RR;
|
||||
uint32_t srate;
|
||||
bool active;
|
||||
|
||||
uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
|
||||
float meter_inL, meter_inR, meter_outL, meter_outR, meter_phase;
|
||||
|
||||
float * buffer;
|
||||
unsigned int pos;
|
||||
unsigned int buffer_size;
|
||||
|
||||
void softclip(float &s) {
|
||||
int ph = s / fabs(s);
|
||||
s = s > 0.63 ? ((0.63 + 0.36) * ph * (1 - pow(MATH_E, (1.f / 3) * (0.63 + s * ph)))) : s;
|
||||
}
|
||||
public:
|
||||
stereo_audio_module();
|
||||
void params_changed();
|
||||
void activate();
|
||||
void set_sample_rate(uint32_t sr);
|
||||
void deactivate();
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
};
|
||||
|
||||
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef CALF_MODULES_COMP_H
|
||||
@@ -85,6 +85,7 @@ public:
|
||||
void process(float &left, float &right, const float *det_left = NULL, const float *det_right = NULL);
|
||||
void activate();
|
||||
void deactivate();
|
||||
int id;
|
||||
void set_sample_rate(uint32_t sr);
|
||||
float get_output_level();
|
||||
float get_expander_level();
|
||||
@@ -133,6 +134,11 @@ private:
|
||||
BANDPASS_1,
|
||||
BANDPASS_2
|
||||
};
|
||||
enum CalfScRoute {
|
||||
STEREO,
|
||||
RIGHT_LEFT,
|
||||
LEFT_RIGHT
|
||||
};
|
||||
mutable float f1_freq_old, f2_freq_old, f1_level_old, f2_level_old;
|
||||
mutable float f1_freq_old1, f2_freq_old1, f1_level_old1, f2_level_old1;
|
||||
CalfScModes sc_mode;
|
||||
@@ -165,12 +171,14 @@ class multibandcompressor_audio_module: public audio_module<multibandcompressor_
|
||||
private:
|
||||
typedef multibandcompressor_audio_module AM;
|
||||
static const int strips = 4;
|
||||
bool mute[strips];
|
||||
bool solo[strips];
|
||||
bool no_solo;
|
||||
uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
|
||||
float meter_inL, meter_inR, meter_outL, meter_outR;
|
||||
gain_reduction_audio_module strip[strips];
|
||||
dsp::biquad_d2<float> lpL0, lpR0, lpL1, lpR1, lpL2, lpR2, hpL0, hpR0, hpL1, hpR1, hpL2, hpR2;
|
||||
dsp::biquad_d2<float> lpL[strips - 1][3], lpR[strips - 1][3], hpL[strips - 1][3], hpR[strips - 1][3];
|
||||
float freq_old[strips - 1], sep_old[strips - 1], q_old[strips - 1];
|
||||
int mode, mode_old;
|
||||
public:
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
@@ -187,7 +195,7 @@ public:
|
||||
virtual int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline) const;
|
||||
};
|
||||
|
||||
/// Deesser by Markus Schmidt (based on Thor's compressor and Krzysztof's filters)
|
||||
/// Deesser by Markus Schmidt (based on Thor's compressor and Krzyexpander_audio_modulesztof's filters)
|
||||
class deesser_audio_module: public audio_module<deesser_metadata>, public frequency_response_line_graph {
|
||||
private:
|
||||
enum CalfDeessModes {
|
||||
@@ -259,6 +267,11 @@ private:
|
||||
BANDPASS_1,
|
||||
BANDPASS_2
|
||||
};
|
||||
enum CalfScRoute {
|
||||
STEREO,
|
||||
RIGHT_LEFT,
|
||||
LEFT_RIGHT
|
||||
};
|
||||
mutable float f1_freq_old, f2_freq_old, f1_level_old, f2_level_old;
|
||||
mutable float f1_freq_old1, f2_freq_old1, f1_level_old1, f2_level_old1;
|
||||
CalfScModes sc_mode;
|
||||
@@ -286,6 +299,36 @@ public:
|
||||
int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline) const;
|
||||
};
|
||||
|
||||
|
||||
/// Multibandgate by Markus Schmidt (based on Damiens's gate and Krzysztof's filters)
|
||||
class multibandgate_audio_module: public audio_module<multibandgate_metadata>, public line_graph_iface {
|
||||
private:
|
||||
typedef multibandgate_audio_module AM;
|
||||
static const int strips = 4;
|
||||
bool solo[strips];
|
||||
bool no_solo;
|
||||
uint32_t clip_inL, clip_inR, clip_outL, clip_outR;
|
||||
float meter_inL, meter_inR, meter_outL, meter_outR;
|
||||
expander_audio_module gate[strips];
|
||||
dsp::biquad_d2<float> lpL[strips - 1][3], lpR[strips - 1][3], hpL[strips - 1][3], hpR[strips - 1][3];
|
||||
float freq_old[strips - 1], sep_old[strips - 1], q_old[strips - 1];
|
||||
int mode, mode_old;
|
||||
public:
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
multibandgate_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
void set_sample_rate(uint32_t sr);
|
||||
const expander_audio_module *get_strip_by_param_index(int index) const;
|
||||
virtual bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context) const;
|
||||
virtual bool get_dot(int index, int subindex, float &x, float &y, int &size, cairo_iface *context) const;
|
||||
virtual bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context) const;
|
||||
virtual int get_changed_offsets(int index, int generation, int &subindex_graph, int &subindex_dot, int &subindex_gridline) const;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -57,10 +57,12 @@ public:
|
||||
/// Exciter by Markus Schmidt (based on Krzysztof's filters and Tom's distortion algorythm)
|
||||
class exciter_audio_module: public audio_module<exciter_metadata> {
|
||||
private:
|
||||
float freq_old;
|
||||
float freq_old, ceil_old;
|
||||
bool ceil_active_old;
|
||||
stereo_in_out_metering<exciter_metadata> meters;
|
||||
float meter_drive;
|
||||
dsp::biquad_d2<float> hp[2][4];
|
||||
dsp::biquad_d2<float> lp[2][2];
|
||||
dsp::tap_distortion dist[2];
|
||||
public:
|
||||
uint32_t srate;
|
||||
@@ -76,10 +78,12 @@ public:
|
||||
/// Bass Enhancer by Markus Schmidt (based on Krzysztof's filters and Tom's distortion algorythm)
|
||||
class bassenhancer_audio_module: public audio_module<bassenhancer_metadata> {
|
||||
private:
|
||||
float freq_old;
|
||||
float freq_old, floor_old;
|
||||
bool floor_active_old;
|
||||
stereo_in_out_metering<exciter_metadata> meters;
|
||||
float meter_drive;
|
||||
dsp::biquad_d2<float> lp[2][4];
|
||||
dsp::biquad_d2<float> hp[2][2];
|
||||
dsp::tap_distortion dist[2];
|
||||
public:
|
||||
uint32_t srate;
|
||||
|
||||
98
plugins/ladspa_effect/calf/src/calf/modules_limit.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/* Calf DSP plugin pack
|
||||
* Limiter related plugins
|
||||
*
|
||||
* Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
#ifndef CALF_MODULES_LIMIT_H
|
||||
#define CALF_MODULES_LIMIT_H
|
||||
|
||||
#include <assert.h>
|
||||
#include <limits.h>
|
||||
#include "biquad.h"
|
||||
#include "inertia.h"
|
||||
#include "audio_fx.h"
|
||||
#include "giface.h"
|
||||
#include "metadata.h"
|
||||
#include "plugin_tools.h"
|
||||
|
||||
namespace calf_plugins {
|
||||
|
||||
/// Limiter by Markus Schmidt and Christian Holschuh
|
||||
class limiter_audio_module: public audio_module<limiter_metadata>, public line_graph_iface {
|
||||
private:
|
||||
typedef limiter_audio_module AM;
|
||||
uint32_t clip_inL, clip_inR, clip_outL, clip_outR, asc_led;
|
||||
int mode, mode_old;
|
||||
float meter_inL, meter_inR, meter_outL, meter_outR;
|
||||
dsp::lookahead_limiter limiter;
|
||||
public:
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
float limit_old;
|
||||
bool asc_old;
|
||||
float attack_old;
|
||||
limiter_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
void set_sample_rate(uint32_t sr);
|
||||
};
|
||||
|
||||
/// Multiband Limiter by Markus Schmidt and Christian Holschuh
|
||||
class multibandlimiter_audio_module: public audio_module<multibandlimiter_metadata>, public line_graph_iface {
|
||||
private:
|
||||
typedef multibandlimiter_audio_module AM;
|
||||
static const int strips = 4;
|
||||
uint32_t clip_inL, clip_inR, clip_outL, clip_outR, asc_led;
|
||||
int mode, mode_old;
|
||||
bool solo[strips];
|
||||
bool no_solo;
|
||||
float meter_inL, meter_inR, meter_outL, meter_outR;
|
||||
dsp::lookahead_limiter strip[strips];
|
||||
dsp::lookahead_limiter broadband;
|
||||
dsp::biquad_d2<float> lpL[strips - 1][3], lpR[strips - 1][3], hpL[strips - 1][3], hpR[strips - 1][3];
|
||||
float freq_old[strips - 1], sep_old[strips - 1], q_old[strips - 1];
|
||||
unsigned int pos;
|
||||
unsigned int buffer_size;
|
||||
unsigned int overall_buffer_size;
|
||||
float *buffer;
|
||||
int channels;
|
||||
float striprel[strips];
|
||||
float weight[strips];
|
||||
float weight_old[strips];
|
||||
float limit_old;
|
||||
bool asc_old;
|
||||
float attack_old;
|
||||
bool _sanitize;
|
||||
public:
|
||||
uint32_t srate;
|
||||
bool is_active;
|
||||
multibandlimiter_audio_module();
|
||||
void activate();
|
||||
void deactivate();
|
||||
void params_changed();
|
||||
uint32_t process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask);
|
||||
void set_sample_rate(uint32_t sr);
|
||||
bool get_graph(int index, int subindex, float *data, int points, cairo_iface *context) const;
|
||||
bool get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context) const;
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,2 +0,0 @@
|
||||
#include <calf/osctl.h>
|
||||
|
||||
@@ -407,6 +407,16 @@ inline void sanitize(float &value)
|
||||
value = 0.f;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force already-denormal float value to zero
|
||||
*/
|
||||
inline void sanitize_denormal(float& value)
|
||||
{
|
||||
if (((*(unsigned int *) &value) & 0x7f800000) == 0) {
|
||||
value = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Force "small enough" double value to zero
|
||||
*/
|
||||
@@ -512,6 +522,12 @@ inline float hermite_interpolation(float x, float x0, float x1, float p0, float
|
||||
//return (2*t3 - 3*t2 + 1) * p0 + (t3 - 2*t2 + t) * m0 + (-2*t3 + 3*t2) * p1 + (t3-t2) * m1;
|
||||
}
|
||||
|
||||
/// convert amplitude value to dB
|
||||
inline float amp2dB(float amp)
|
||||
{
|
||||
return 6.0 * log(amp) / log(2);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include <config.h>
|
||||
#include <limits.h>
|
||||
#include <calf/giface.h>
|
||||
#include <calf/osctlnet.h>
|
||||
#include <calf/utils.h>
|
||||
|
||||
using namespace std;
|
||||
@@ -385,106 +384,6 @@ uint32_t mod_matrix_metadata::get_table_rows() const
|
||||
///////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#if USE_EXEC_GUI
|
||||
struct osc_cairo_control: public cairo_iface
|
||||
{
|
||||
osctl::osc_inline_typed_strstream &os;
|
||||
|
||||
osc_cairo_control(osctl::osc_inline_typed_strstream &_os) : os(_os) {}
|
||||
virtual void set_source_rgba(float r, float g, float b, float a = 1.f)
|
||||
{
|
||||
os << (uint32_t)LGI_SET_RGBA << r << g << b << a;
|
||||
}
|
||||
virtual void set_line_width(float width)
|
||||
{
|
||||
os << (uint32_t)LGI_SET_WIDTH << width;
|
||||
}
|
||||
};
|
||||
|
||||
static void serialize_graphs(osctl::osc_inline_typed_strstream &os, const line_graph_iface *graph, std::vector<int> ¶ms)
|
||||
{
|
||||
osc_cairo_control cairoctl(os);
|
||||
for (size_t i = 0; i < params.size(); i++)
|
||||
{
|
||||
int index = params[i];
|
||||
os << (uint32_t)LGI_GRAPH;
|
||||
os << (uint32_t)index;
|
||||
for (int j = 0; ; j++)
|
||||
{
|
||||
float data[128];
|
||||
if (graph->get_graph(index, j, data, 128, &cairoctl))
|
||||
{
|
||||
os << (uint32_t)LGI_SUBGRAPH;
|
||||
os << (uint32_t)128;
|
||||
for (int p = 0; p < 128; p++)
|
||||
os << data[p];
|
||||
}
|
||||
else
|
||||
break;
|
||||
}
|
||||
for (int j = 0; ; j++)
|
||||
{
|
||||
float x, y;
|
||||
int size = 3;
|
||||
if (graph->get_dot(index, j, x, y, size, &cairoctl))
|
||||
os << (uint32_t)LGI_DOT << x << y << (uint32_t)size;
|
||||
else
|
||||
break;
|
||||
}
|
||||
for (int j = 0; ; j++)
|
||||
{
|
||||
float pos = 0;
|
||||
bool vertical = false;
|
||||
string legend;
|
||||
if (graph->get_gridline(index, j, pos, vertical, legend, &cairoctl))
|
||||
os << (uint32_t)LGI_LEGEND << pos << (uint32_t)(vertical ? 1 : 0) << legend;
|
||||
else
|
||||
break;
|
||||
}
|
||||
os << (uint32_t)LGI_END_ITEM;
|
||||
}
|
||||
os << (uint32_t)LGI_END;
|
||||
}
|
||||
|
||||
calf_plugins::dssi_feedback_sender::dssi_feedback_sender(const char *URI, const line_graph_iface *_graph)
|
||||
{
|
||||
graph = _graph;
|
||||
is_client_shared = false;
|
||||
client = new osctl::osc_client;
|
||||
client->bind("0.0.0.0", 0);
|
||||
client->set_url(URI);
|
||||
}
|
||||
|
||||
calf_plugins::dssi_feedback_sender::dssi_feedback_sender(osctl::osc_client *_client, const line_graph_iface *_graph)
|
||||
{
|
||||
graph = _graph;
|
||||
client = _client;
|
||||
is_client_shared = true;
|
||||
}
|
||||
|
||||
void calf_plugins::dssi_feedback_sender::add_graphs(const calf_plugins::parameter_properties *props, int num_params)
|
||||
{
|
||||
for (int i = 0; i < num_params; i++)
|
||||
{
|
||||
if (props[i].flags & PF_PROP_GRAPH)
|
||||
indices.push_back(i);
|
||||
}
|
||||
}
|
||||
|
||||
void calf_plugins::dssi_feedback_sender::update()
|
||||
{
|
||||
if (graph)
|
||||
{
|
||||
osctl::osc_inline_typed_strstream os;
|
||||
serialize_graphs(os, graph, indices);
|
||||
client->send("/lineGraph", os);
|
||||
}
|
||||
}
|
||||
|
||||
calf_plugins::dssi_feedback_sender::~dssi_feedback_sender()
|
||||
{
|
||||
if (!is_client_shared)
|
||||
delete client;
|
||||
}
|
||||
|
||||
table_via_configure::table_via_configure()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include <config.h>
|
||||
@@ -127,8 +127,8 @@ CALF_PORT_NAMES(filterclavier) = {"In L", "In R", "Out L", "Out R"};
|
||||
CALF_PORT_PROPS(filterclavier) = {
|
||||
{ 0, -48, 48, 48*2+1, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_SEMITONES, NULL, "transpose", "Transpose" },
|
||||
{ 0, -100, 100, 0, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "detune", "Detune" },
|
||||
{ 32, 0.707, 32, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "maxres", "Max. Resonance" },
|
||||
{ biquad_filter_module::mode_6db_bp,
|
||||
{ 32, 0.707, 32, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "maxres", "Max. Resonance" },
|
||||
{ biquad_filter_module::mode_6db_bp,
|
||||
biquad_filter_module::mode_12db_lp,
|
||||
biquad_filter_module::mode_count - 1,
|
||||
1, PF_ENUM | PF_CTL_COMBO | PF_PROP_GRAPH, filter_choices, "mode", "Mode" },
|
||||
@@ -260,6 +260,9 @@ const char *sidechaincompressor_mode_names[] = {"Wideband (F1:off / F2:off)",
|
||||
"Weighted #3 (F1:Bell / F2:Shelf)",
|
||||
"Bandpass #1 (F1:BP / F2:off)",
|
||||
"Bandpass #2 (F1:HP / F2:LP)"};
|
||||
const char *sidechaincompressor_route_names[] = {"Stereo Input (Default)",
|
||||
"R ▸ L (L: Signal / R: S/C)",
|
||||
"L ▸ R (L: S/C / R: Signal)"};
|
||||
const char *sidechaincompressor_filter_choices[] = { "12dB", "24dB", "36dB"};
|
||||
|
||||
|
||||
@@ -279,7 +282,7 @@ CALF_PORT_PROPS(sidechaincompressor) = {
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_detection_names, "detection", "Detection" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_stereo_link_names, "stereo_link", "Stereo Link" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Gain Reduction" },
|
||||
{ 0, 0, 9, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_mode_names, "sc_mode", "Sidechain Mode" },
|
||||
{ 0, 0, 9, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_mode_names, "sc_mode", "S/C Mode" },
|
||||
{ 250, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "f1_freq", "F1 Freq" },
|
||||
{ 4500, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "f2_freq", "F2 Freq" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f1_level", "F1 Level" },
|
||||
@@ -287,6 +290,8 @@ CALF_PORT_PROPS(sidechaincompressor) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "sc_listen", "S/C-Listen" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f1_active", "F1 Active" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f2_active", "F2 Active" },
|
||||
{ 0, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, sidechaincompressor_route_names, "sc_route", "S/C Route" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "sc_level", "S/C Level" },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -297,6 +302,7 @@ CALF_PLUGIN_INFO(sidechaincompressor) = { 0x8517, "Sidechaincompressor", "Calf S
|
||||
CALF_PORT_NAMES(multibandcompressor) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
const char *multibandcompressor_detection_names[] = { "RMS", "Peak" };
|
||||
const char *multibandcompressor_filter_choices[] = { "12dB", "36dB"};
|
||||
|
||||
CALF_PORT_PROPS(multibandcompressor) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
@@ -310,70 +316,71 @@ CALF_PORT_PROPS(multibandcompressor) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 100, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq0", "Split 1/2" },
|
||||
|
||||
{ 120, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq0", "Split 1/2" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq1", "Split 2/3" },
|
||||
{ 6000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq2", "Split 3/4" },
|
||||
|
||||
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep0", "S1" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep1", "S2" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep2", "S3" },
|
||||
|
||||
{ 0.895025, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
|
||||
{ 0.895025, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
|
||||
{ 0.895025, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
|
||||
|
||||
|
||||
{ 0.0625, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold0", "Threshold 1" },
|
||||
{ 3, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio0", "Ratio 1" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack0", "Attack 1" },
|
||||
{ 100, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release0", "Release 1" },
|
||||
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
|
||||
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_filter_choices, "mode", "Filter Mode" },
|
||||
|
||||
{ 0.25, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold0", "Threshold 1" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio0", "Ratio 1" },
|
||||
{ 150, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack0", "Attack 1" },
|
||||
{ 300, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release0", "Release 1" },
|
||||
{ 2, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup0", "Makeup 1" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee0", "Knee 1" },
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection0", "Detection 1" },
|
||||
{ 1, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression0", "Gain Reduction 1" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection0", "Detection 1" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression0", "Gain Reduction 1" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output0", "Output 1" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass0", "Bypass 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mute0", "Mute 1" },
|
||||
|
||||
|
||||
{ 0.03125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold1", "Threshold 2" },
|
||||
{ 3, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio1", "Ratio 2" },
|
||||
{ 25, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack1", "Attack 2" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release1", "Release 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo0", "Solo 1" },
|
||||
|
||||
|
||||
{ 0.125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold1", "Threshold 2" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio1", "Ratio 2" },
|
||||
{ 100, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack1", "Attack 2" },
|
||||
{ 200, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release1", "Release 2" },
|
||||
{ 2, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup1", "Makeup 2" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee1", "Knee 2" },
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection1", "Detection 2" },
|
||||
{ 1, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression1", "Gain Reduction 2" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection1", "Detection 2" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression1", "Gain Reduction 2" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output1", "Output 2" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass1", "Bypass 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mute1", "Mute 2" },
|
||||
|
||||
|
||||
{ 0.015625, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold2", "Threshold 3" },
|
||||
{ 3, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio2", "Ratio 3" },
|
||||
{ 12.5, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack2", "Attack 3" },
|
||||
{ 25, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release2", "Release 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo1", "Solo 2" },
|
||||
|
||||
|
||||
{ 0.0625, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold2", "Threshold 3" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio2", "Ratio 3" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack2", "Attack 3" },
|
||||
{ 100, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release2", "Release 3" },
|
||||
{ 2, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup2", "Makeup 3" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee2", "Knee 3" },
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection2", "Detection 3" },
|
||||
{ 1, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression2", "Gain Reduction 3" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection2", "Detection 3" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression2", "Gain Reduction 3" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output2", "Output 3" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass2", "Bypass 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mute2", "Mute 3" },
|
||||
|
||||
|
||||
{ 0.0078125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold3", "Threshold 4" },
|
||||
{ 3, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio3", "Ratio 4" },
|
||||
{ 6.25, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack3", "Attack 4" },
|
||||
{ 12.5, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release3", "Release 4" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo2", "Solo 3" },
|
||||
|
||||
|
||||
{ 0.03125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold3", "Threshold 4" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio3", "Ratio 4" },
|
||||
{ 25, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack3", "Attack 4" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release3", "Release 4" },
|
||||
{ 2, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup3", "Makeup 4" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee3", "Knee 4" },
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection3", "Detection 4" },
|
||||
{ 1, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression3", "Gain Reduction 4" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection3", "Detection 4" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression3", "Gain Reduction 4" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output3", "Output 4" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass3", "Bypass 4" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mute3", "Mute 4" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo3", "Solo 4" },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -390,7 +397,7 @@ const char *deesser_mode_names[] = { "Wide", "Split" };
|
||||
CALF_PORT_PROPS(deesser) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "detected", "Detected" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Gain Reduction" },
|
||||
{ 0, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "compression", "Gain Reduction" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "detected_led", "Active" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "Out" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, deesser_detection_names, "detection", "Detection" },
|
||||
@@ -456,6 +463,9 @@ const char *sidechaingate_mode_names[] = {"Wideband (F1:off / F2:off)",
|
||||
"Weighted #3 (F1:Bell / F2:Shelf)",
|
||||
"Bandpass #1 (F1:BP / F2:off)",
|
||||
"Bandpass #2 (F1:HP / F2:LP)"};
|
||||
const char *sidechaingate_route_names[] = {"Stereo Input (Default)",
|
||||
"R ▸ L (L: Signal / R: S/C)",
|
||||
"L ▸ R (L: S/C / R: Signal)"};
|
||||
const char *sidechaingate_filter_choices[] = { "12dB", "24dB", "36dB"};
|
||||
|
||||
|
||||
@@ -476,7 +486,7 @@ CALF_PORT_PROPS(sidechaingate) = {
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaingate_detection_names, "detection", "Detection" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, sidechaingate_stereo_link_names, "stereo_link", "Stereo Link" },
|
||||
{ 0, 0.03125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "gating", "Gating" },
|
||||
{ 0, 0, 9, 0, PF_ENUM | PF_CTL_COMBO, sidechaingate_mode_names, "sc_mode", "Sidechain Mode" },
|
||||
{ 0, 0, 9, 0, PF_ENUM | PF_CTL_COMBO, sidechaingate_mode_names, "sc_mode", "S/C Mode" },
|
||||
{ 250, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "f1_freq", "F1 Freq" },
|
||||
{ 4500, 10,18000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "f2_freq", "F2 Freq" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "f1_level", "F1 Level" },
|
||||
@@ -484,14 +494,212 @@ CALF_PORT_PROPS(sidechaingate) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "sc_listen", "S/C-Listen" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f1_active", "F1 Active" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "f2_active", "F2 Active" },
|
||||
{ 0, 0, 2, 0, PF_ENUM | PF_CTL_COMBO, sidechaingate_route_names, "sc_route", "S/C Route" },
|
||||
{ 1, 0.015625, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "sc_level", "S/C Level" },
|
||||
{}
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(sidechaingate) = { 0x8504, "Sidechaingate", "Calf Sidechain Gate", "Markus Schmidt / Damien Zammit / Thor Harald Johansen", calf_plugins::calf_copyright_info, "ExpanderPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(multibandgate) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
const char *multibandgate_detection_names[] = { "RMS", "Peak" };
|
||||
const char *multibandgate_filter_choices[] = { "12dB", "36dB"};
|
||||
|
||||
CALF_PORT_PROPS(multibandgate) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "Input L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "Input R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB-InL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 120, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq0", "Split 1/2" },
|
||||
{ 1000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq1", "Split 2/3" },
|
||||
{ 6000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq2", "Split 3/4" },
|
||||
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep0", "S1" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep1", "S2" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep2", "S3" },
|
||||
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
|
||||
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandgate_filter_choices, "mode", "Filter Mode" },
|
||||
|
||||
{ 0.06125, 0.000015849, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "range0", "Reduction 1" },
|
||||
{ 0.25, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold0", "Threshold 1" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio0", "Ratio 1" },
|
||||
{ 150, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack0", "Attack 1" },
|
||||
{ 300, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release0", "Release 1" },
|
||||
{ 1, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup0", "Makeup 1" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee0", "Knee 1" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection0", "Detection 1" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "gating0", "Gating 1" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output0", "Output 1" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass0", "Bypass 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo0", "Solo 1" },
|
||||
|
||||
{ 0.06125, 0.000015849, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "range1", "Reduction 2" },
|
||||
{ 0.125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold1", "Threshold 2" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio1", "Ratio 2" },
|
||||
{ 100, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack1", "Attack 2" },
|
||||
{ 200, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release1", "Release 2" },
|
||||
{ 1, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup1", "Makeup 2" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee1", "Knee 2" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection1", "Detection 2" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "gating1", "Gating 2" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output1", "Output 2" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass1", "Bypass 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo1", "Solo 2" },
|
||||
|
||||
{ 0.06125, 0.000015849, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "range2", "Reduction 3" },
|
||||
{ 0.0625, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold2", "Threshold 3" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio2", "Ratio 3" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack2", "Attack 3" },
|
||||
{ 100, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release2", "Release 3" },
|
||||
{ 1, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup2", "Makeup 3" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee2", "Knee 3" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection2", "Detection 3" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "gating2", "Gating 3" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output2", "Output 3" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass2", "Bypass 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo2", "Solo 3" },
|
||||
|
||||
{ 0.06125, 0.000015849, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "range3", "Reduction 4" },
|
||||
{ 0.03125, 0.000976563, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "threshold3", "Threshold 4" },
|
||||
{ 2, 1, 20, 21, PF_FLOAT | PF_SCALE_LOG_INF | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "ratio3", "Ratio 4" },
|
||||
{ 25, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack3", "Attack 4" },
|
||||
{ 50, 0.01, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release3", "Release 4" },
|
||||
{ 1, 1, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "makeup3", "Makeup 4" },
|
||||
{ 2.828427125, 1, 8, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "knee3", "Knee 4" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandcompressor_detection_names, "detection3", "Detection 4" },
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "gating3", "Gating 4" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "output3", "Output 4" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass3", "Bypass 4" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo3", "Solo 4" },
|
||||
{}
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(multibandgate) = { 0x8505, "Multibandgate", "Calf Multiband Gate", "Markus Schmidt / Damien Zammit / Thor Harald Johansen", calf_plugins::calf_copyright_info, "ExpanderPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// A few macros to make
|
||||
|
||||
CALF_PORT_NAMES(limiter) = {"In L", "In R", "Out L", "Out R"};
|
||||
|
||||
CALF_PORT_PROPS(limiter) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "Input L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "Input R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB-InL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "limit", "Limit" },
|
||||
{ 5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Lookahead" },
|
||||
{ 50, 1, 1000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release", "Release" },
|
||||
|
||||
{ 1, 0.125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "att", "Attenuation" },
|
||||
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "asc", "ASC" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "asc_led", "asc active" },
|
||||
|
||||
{ 0.5f, 0.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "asc_coeff", "ASC Level" },
|
||||
|
||||
{}
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(limiter) = { 0x8521, "Limiter", "Calf Limiter", "Christian Holschuh / Markus Schmidt", calf_plugins::calf_copyright_info, "LimiterPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(multibandlimiter) = {"In L", "In R", "Out L", "Out R"};
|
||||
const char *multibandlimiter_filter_choices[] = { "12dB", "36dB"};
|
||||
|
||||
CALF_PORT_PROPS(multibandlimiter) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "Input L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "Input R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB-InL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 100, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq0", "Split 1/2" },
|
||||
{ 750, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq1", "Split 2/3" },
|
||||
{ 5000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ | PF_PROP_GRAPH, NULL, "freq2", "Split 3/4" },
|
||||
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep0", "S1" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep1", "S2" },
|
||||
{ -0.17, -0.5, 0.5, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sep2", "S3" },
|
||||
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q0", "Q1" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q1", "Q2" },
|
||||
{ 0.7762471166286917, 0.25, 4, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB | PF_PROP_GRAPH, NULL, "q2", "Q3" },
|
||||
|
||||
{ 1, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, multibandlimiter_filter_choices, "mode", "Filter Mode" },
|
||||
|
||||
{ 1, 0.0625, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "limit", "Limit" },
|
||||
{ 4, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "attack", "Lookahead" },
|
||||
{ 30, 1, 1000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "release", "Release" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "minrel", "Min Release" },
|
||||
|
||||
{ 1, 0.125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "att0", "Low" },
|
||||
{ 1, 0.125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "att1", "LMid" },
|
||||
{ 1, 0.125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "att2", "HMid" },
|
||||
{ 1, 0.125, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_CTLO_REVERSE | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL| PF_PROP_GRAPH, NULL, "att3", "Hi" },
|
||||
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "weight0", "Weight 1" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "weight1", "Weight 2" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "weight2", "Weight 3" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "weight3", "Weight 4" },
|
||||
|
||||
{ 0.5f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "release0", "Release 1" },
|
||||
{ 0.2f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "release1", "Release 2" },
|
||||
{ -0.2f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "release2", "Release 3" },
|
||||
{ -0.5f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "release3", "Release 4" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo0", "Solo 1" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo1", "Solo 2" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo2", "Solo 3" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "solo3", "Solo 4" },
|
||||
|
||||
{ 1, 0.f, 1000, 0, PF_FLOAT | PF_UNIT_MSEC | PF_PROP_OUTPUT, NULL, "effrelease0", "Effectively Release 1" },
|
||||
{ 1, 0.f, 1000, 0, PF_FLOAT | PF_UNIT_MSEC | PF_PROP_OUTPUT, NULL, "effrelease1", "Effectively Release 2" },
|
||||
{ 1, 0.f, 1000, 0, PF_FLOAT | PF_UNIT_MSEC | PF_PROP_OUTPUT, NULL, "effrelease2", "Effectively Release 3" },
|
||||
{ 1, 0.f, 1000, 0, PF_FLOAT | PF_UNIT_MSEC | PF_PROP_OUTPUT, NULL, "effrelease3", "Effectively Release 4" },
|
||||
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "asc", "ASC" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "asc_led", "asc active" },
|
||||
|
||||
{ 0.5f, 0.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "asc_coeff", "ASC Level" },
|
||||
|
||||
{}
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(multibandlimiter) = { 0x8520, "Multibandlimiter", "Calf Multiband Limiter", "Markus Schmidt / Christian Holschuh", calf_plugins::calf_copyright_info, "LimiterPlugin" };
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// A few macros to make
|
||||
|
||||
#define BYPASS_AND_LEVEL_PARAMS \
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" }, \
|
||||
@@ -621,17 +829,17 @@ CALF_PORT_PROPS(saturator) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "0dB" },
|
||||
|
||||
|
||||
{ 5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "drive", "Saturation" },
|
||||
{ 10, -10, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER | PF_UNIT_COEF, NULL, "blend", "Blend" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_drive", "Drive" },
|
||||
|
||||
|
||||
{ 20000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "lp_pre_freq", "Lowpass" },
|
||||
{ 10, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hp_pre_freq", "Highpass" },
|
||||
|
||||
{ 20000, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "lp_post_freq", "Lowpass" },
|
||||
{ 10, 10, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "hp_post_freq", "Highpass" },
|
||||
|
||||
|
||||
{ 2000, 80, 8000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "p_freq", "Tone" },
|
||||
{ 1, 0.0625, 16, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_DB, NULL, "p_level", "Amount" },
|
||||
{ 1, 0.1, 10, 1, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "p_q", "Gradient" },
|
||||
@@ -653,13 +861,15 @@ CALF_PORT_PROPS(exciter) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "0dB" },
|
||||
|
||||
|
||||
{ 8.5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "drive", "Harmonics" },
|
||||
{ 0, -10, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER | PF_UNIT_COEF, NULL, "blend", "Blend harmonics" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_drive", "Harmonics level" },
|
||||
|
||||
|
||||
{ 6000, 2000, 12000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "freq", "Scope" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "listen", "Listen" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "ceil_active", "Ceiling active" },
|
||||
{ 16000, 10000, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "ceil", "Ceiling" },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -678,13 +888,15 @@ CALF_PORT_PROPS(bassenhancer) = {
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_out", "0dB" },
|
||||
|
||||
|
||||
{ 8.5, 0.1, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "drive", "Harmonics" },
|
||||
{ 0, -10, 10, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER | PF_UNIT_COEF, NULL, "blend", "Blend harmonics" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_drive", "Harmonics level" },
|
||||
|
||||
|
||||
{ 120, 10, 250, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "freq", "Scope" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "listen", "Listen" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "floor_active", "Floor active" },
|
||||
{ 30, 10, 120, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "floor", "Floor" },
|
||||
{}
|
||||
};
|
||||
|
||||
@@ -692,11 +904,84 @@ CALF_PLUGIN_INFO(bassenhancer) = { 0x8532, "BassEnhancer", "Calf Bass Enhancer",
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(monosynth) = {
|
||||
"Out L", "Out R",
|
||||
CALF_PORT_NAMES(mono) = {"In", "Out L", "Out R"};
|
||||
CALF_PORT_PROPS(mono) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_in", "Input" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_in", "0dB-In" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "balance_out", "Balance" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "softclip", "Softclip" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mutel", "Mute L" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "muter", "Mute R" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "phasel", "Phase L" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "phaser", "Phase R" },
|
||||
|
||||
{ 0.f, -20.f, 20.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "delay", "Delay" },
|
||||
{}
|
||||
};
|
||||
|
||||
const char *monosynth_waveform_names[] = { "Sawtooth", "Square", "Pulse", "Sine", "Triangle", "Varistep", "Skewed Saw", "Skewed Square",
|
||||
CALF_PLUGIN_INFO(mono) = { 0x8589, "MonoInput", "Calf Mono Input", "Markus Schmidt", calf_plugins::calf_copyright_info, "Utility" };
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(stereo) = {"In L", "In R", "Out L", "Out R"};
|
||||
const char *stereo_mode_names[] = { "LR ▸ LR (Stereo Default)", "LR ▸ MS (Stereo to Mid-Side)", "MS ▸ LR (Mid-Side to Stereo)", "LR ▸ LL (Mono Left Channel)", "LR ▸ RR (Mono Right Channel)", "LR ▸ L+R (Mono Sum L+R)", "LR ▸ RL (Stereo Flip Channels)" };
|
||||
CALF_PORT_PROPS(stereo) = {
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "bypass", "Bypass" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_in", "Input" },
|
||||
{ 1, 0, 64, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "level_out", "Output" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inL", "Input L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_inR", "Input R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outL", "Output L" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_DB | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_outR", "Output R" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inL", "0dB-InL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_inR", "0dB-InR" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outL", "0dB-OutL" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_CTL_LED | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "clip_outR", "0dB-OutR" },
|
||||
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "balance_in", "Balance In" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "balance_out", "Balance Out" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "softclip", "Softclip" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "mutel", "Mute L" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "muter", "Mute R" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "phasel", "Phase L" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "phaser", "Phase R" },
|
||||
|
||||
{ 0, 0, 6, 0, PF_ENUM | PF_CTL_COMBO, stereo_mode_names, "mode", "Mode" },
|
||||
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "slev", "S Level" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "sbal", "S Balance" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "mlev", "M Level" },
|
||||
{ 0.f, -1.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_GRAPH, NULL, "mpan", "M Panorama" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "widener", "Widener" },
|
||||
{ 0.f, -20.f, 20.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_COEF, NULL, "delay", "Delay" },
|
||||
|
||||
{ 0.f, 0.f, 1.f, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_METER | PF_CTLO_LABEL | PF_UNIT_COEF | PF_PROP_OUTPUT | PF_PROP_OPTIONAL, NULL, "meter_phase", "Phase Correlation" },
|
||||
|
||||
{}
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(stereo) = { 0x8588, "StereoTools", "Calf Stereo Tools", "Markus Schmidt", calf_plugins::calf_copyright_info, "Utility" };
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
CALF_PORT_NAMES(monosynth) = {
|
||||
"Out L", "Out R",
|
||||
};
|
||||
|
||||
const char *monosynth_waveform_names[] = { "Sawtooth", "Square", "Pulse", "Sine", "Triangle", "Varistep", "Skewed Saw", "Skewed Square",
|
||||
"Smooth Brass", "Bass", "Dark FM", "Multiwave", "Bell FM", "Dark Pad", "DCO Saw", "DCO Maze" };
|
||||
const char *monosynth_mode_names[] = { "0\xC2\xB0 : 0\xC2\xB0", "0\xC2\xB0 : 180\xC2\xB0", "0\xC2\xB0 : 90\xC2\xB0", "90\xC2\xB0 : 90\xC2\xB0", "90\xC2\xB0 : 270\xC2\xB0", "Random" };
|
||||
const char *monosynth_legato_names[] = { "Retrig", "Legato", "Fng Retrig", "Fng Legato" };
|
||||
@@ -718,10 +1003,10 @@ CALF_PLUGIN_INFO(monosynth) = { 0x8480, "Monosynth", "Calf Monosynth", "Krzyszto
|
||||
CALF_PORT_PROPS(monosynth) = {
|
||||
{ monosynth_metadata::wave_saw, 0, monosynth_metadata::wave_count - 1, 1, PF_ENUM | PF_CTL_COMBO | PF_PROP_GRAPH, monosynth_waveform_names, "o1_wave", "Osc1 Wave" },
|
||||
{ monosynth_metadata::wave_sqr, 0, monosynth_metadata::wave_count - 1, 1, PF_ENUM | PF_CTL_COMBO | PF_PROP_GRAPH, monosynth_waveform_names, "o2_wave", "Osc2 Wave" },
|
||||
|
||||
|
||||
{ 0, -1, 1, 0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "o1_pw", "Osc1 PW" },
|
||||
{ 0, -1, 1, 0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "o2_pw", "Osc2 PW" },
|
||||
|
||||
|
||||
{ 10, 0, 100, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "o12_detune", "O1<>2 Detune" },
|
||||
{ 12, -24, 24, 0, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_SEMITONES, NULL, "o2_xpose", "Osc 2 transpose" },
|
||||
{ 0, 0, 5, 0, PF_ENUM | PF_CTL_COMBO, monosynth_mode_names, "phase_mode", "Phase mode" },
|
||||
@@ -733,17 +1018,17 @@ CALF_PORT_PROPS(monosynth) = {
|
||||
{ 8000, -10800,10800, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "env2cutoff", "Env->Cutoff" },
|
||||
{ 1, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "env2res", "Env->Res" },
|
||||
{ 0, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "env2amp", "Env->Amp" },
|
||||
|
||||
|
||||
{ 1, 1,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_a", "EG1 Attack" },
|
||||
{ 350, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_d", "EG1 Decay" },
|
||||
{ 0.5, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr_s", "EG1 Sustain" },
|
||||
{ 0, -10000,10000, 21, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_f", "EG1 Fade" },
|
||||
{ 100, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr_r", "EG1 Release" },
|
||||
|
||||
|
||||
{ 0, 0, 2, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "key_follow", "Key Follow" },
|
||||
{ 0, 0, 3, 0, PF_ENUM | PF_CTL_COMBO, monosynth_legato_names, "legato", "Legato Mode" },
|
||||
{ 1, 1, 2000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "portamento", "Portamento" },
|
||||
|
||||
|
||||
{ 0.5, 0, 1, 0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "vel2filter", "Vel->Filter" },
|
||||
{ 0, 0, 1, 0.1, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "vel2amp", "Vel->Amp" },
|
||||
|
||||
@@ -763,7 +1048,7 @@ CALF_PORT_PROPS(monosynth) = {
|
||||
{ 0, -10800,10800, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "adsr2_cutoff", "EG2->Cutoff" },
|
||||
{ 0.3, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC | PF_CTL_KNOB, NULL, "adsr2_res", "EG2->Res" },
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "adsr2_amp", "EG2->Amp" },
|
||||
|
||||
|
||||
{ 1, 1,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr2_a", "EG2 Attack" },
|
||||
{ 100, 10,20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_FADER | PF_UNIT_MSEC, NULL, "adsr2_d", "EG2 Decay" },
|
||||
{ 0.5, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "adsr2_s", "EG2 Sustain" },
|
||||
@@ -781,7 +1066,7 @@ CALF_PORT_PROPS(monosynth) = {
|
||||
};
|
||||
|
||||
static const char *monosynth_mod_src_names[] = {
|
||||
"None",
|
||||
"None",
|
||||
"Velocity",
|
||||
"Pressure",
|
||||
"ModWheel",
|
||||
@@ -833,13 +1118,13 @@ CALF_PORT_NAMES(organ) = {"Out L", "Out R"};
|
||||
|
||||
const char *organ_percussion_trigger_names[] = { "First note", "Each note", "Each, no retrig", "Polyphonic" };
|
||||
|
||||
const char *organ_wave_names[] = {
|
||||
"Sin",
|
||||
"S0", "S00", "S000",
|
||||
"SSaw", "SSqr", "SPls",
|
||||
"Saw", "Sqr", "Pls",
|
||||
"S(", "Sq(", "S+", "Clvg",
|
||||
"Bell", "Bell2",
|
||||
const char *organ_wave_names[] = {
|
||||
"Sin",
|
||||
"S0", "S00", "S000",
|
||||
"SSaw", "SSqr", "SPls",
|
||||
"Saw", "Sqr", "Pls",
|
||||
"S(", "Sq(", "S+", "Clvg",
|
||||
"Bell", "Bell2",
|
||||
"W1", "W2", "W3", "W4", "W5", "W6", "W7", "W8", "W9",
|
||||
"DSaw", "DSqr", "DPls",
|
||||
"P:SynStr","P:WideStr","P:Sine","P:Bell","P:Space","P:Voice","P:Hiss","P:Chant",
|
||||
@@ -931,26 +1216,26 @@ CALF_PORT_PROPS(organ) = {
|
||||
{ 0, 0, 2, 0, PF_ENUM | PF_SCALE_LINEAR | PF_CTL_COMBO, organ_routing_names, "routing9", "Routing 9" },
|
||||
|
||||
{ 96 + 12, 0, 127, 128, PF_INT | PF_CTL_KNOB | PF_UNIT_NOTE, NULL, "foldnote", "Foldover" },
|
||||
|
||||
|
||||
{ 200, 10, 3000, 100, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "perc_decay", "P: Carrier Decay" },
|
||||
{ 0.25, 0, 1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB, NULL, "perc_level", "P: Level" },
|
||||
{ 0, 0, organ_enums::wave_count_small - 1, 1, PF_ENUM | PF_CTL_COMBO, organ_wave_names, "perc_waveform", "P: Carrier Wave" },
|
||||
{ 6, 1, 32, 32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "perc_harmonic", "P: Carrier Frq" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "perc_vel2amp", "P: Vel->Amp" },
|
||||
|
||||
|
||||
{ 200, 10, 3000, 100, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_MSEC, NULL, "perc_fm_decay", "P: Modulator Decay" },
|
||||
{ 0, 0, 4, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "perc_fm_depth", "P: FM Depth" },
|
||||
{ 0, 0, organ_enums::wave_count_small - 1, 1, PF_ENUM | PF_CTL_COMBO, organ_wave_names, "perc_fm_waveform", "P: Modulator Wave" },
|
||||
{ 6, 1, 32, 32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "perc_fm_harmonic", "P: Modulator Frq" },
|
||||
{ 0, 0, 1, 0, PF_FLOAT | PF_SCALE_PERC, NULL, "perc_vel2fm", "P: Vel->FM" },
|
||||
|
||||
|
||||
{ 0, 0, organ_enums::perctrig_count - 1, 0, PF_ENUM | PF_CTL_COMBO, organ_percussion_trigger_names, "perc_trigger", "P: Trigger" },
|
||||
{ 90, 0,360, 361, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_DEG, NULL, "perc_stereo", "P: Stereo Phase" },
|
||||
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, organ_filter_send_names, "filter_chain", "Filter 1 To" },
|
||||
{ 0, 0, 1, 0, PF_ENUM | PF_CTL_COMBO, organ_filter_type_names, "filter1_type", "Filter 1 Type" },
|
||||
{ 0.1, 0, 1, 100, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_PROP_OUTPUT_GAIN | PF_PROP_GRAPH, NULL, "master", "Volume" },
|
||||
|
||||
|
||||
{ 2000, 20, 20000, 100, PF_FLOAT | PF_SCALE_LOG | PF_UNIT_HZ | PF_CTL_KNOB, NULL, "f1_cutoff", "F1 Cutoff" },
|
||||
{ 2, 0.7, 8, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB, NULL, "f1_res", "F1 Res" },
|
||||
{ 8000, -10800,10800, 0, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "f1_env1", "F1 Env1" },
|
||||
@@ -1002,11 +1287,11 @@ CALF_PORT_PROPS(organ) = {
|
||||
{ 0, -100, 100, 201, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "detune", "Detune" },
|
||||
|
||||
{ 16, 1, 32, 32, PF_INT | PF_SCALE_LINEAR | PF_CTL_KNOB, NULL, "polyphony", "Polyphony" },
|
||||
|
||||
|
||||
{ 1, 0, 1, 0, PF_BOOL | PF_CTL_TOGGLE, NULL, "quad_env", "Quadratic AmpEnv" },
|
||||
|
||||
{ 200, 0, 2400, 25, PF_FLOAT | PF_SCALE_LINEAR | PF_CTL_KNOB | PF_UNIT_CENTS, NULL, "pbend_range", "PBend Range" },
|
||||
|
||||
|
||||
{ 80, 20, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "bass_freq", "Bass Freq" },
|
||||
{ 1, 0.1, 10, 0, PF_FLOAT | PF_SCALE_GAIN | PF_CTL_KNOB | PF_UNIT_COEF | PF_PROP_NOBOUNDS, NULL, "bass_gain", "Bass Gain" },
|
||||
{ 12000, 20, 20000, 0, PF_FLOAT | PF_SCALE_LOG | PF_CTL_KNOB | PF_UNIT_HZ, NULL, "treble_freq", "Treble Freq" },
|
||||
@@ -1027,7 +1312,7 @@ const char *fluidsynth_init_presetkeyset = "";
|
||||
const char *fluidsynth_interpolation_names[] = { "None (zero-hold)", "Linear", "Cubic", "7-point" };
|
||||
|
||||
CALF_PORT_NAMES(fluidsynth) = {
|
||||
"Out L", "Out R",
|
||||
"Out L", "Out R",
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(fluidsynth) = { 0x8700, "Fluidsynth", "Calf Fluidsynth", "FluidSynth Team / Krzysztof Foltman", calf_plugins::calf_copyright_info, "SynthesizerPlugin" };
|
||||
@@ -1047,7 +1332,7 @@ const char *const *fluidsynth_metadata::get_configure_vars() const
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
const char *wavetable_names[] = {
|
||||
const char *wavetable_names[] = {
|
||||
"Shiny1",
|
||||
"Shiny2",
|
||||
"Rezo",
|
||||
@@ -1080,7 +1365,7 @@ const char *wavetable_names[] = {
|
||||
};
|
||||
|
||||
static const char *wavetable_mod_src_names[] = {
|
||||
"None",
|
||||
"None",
|
||||
"Velocity",
|
||||
"Pressure",
|
||||
"ModWheel",
|
||||
@@ -1104,7 +1389,7 @@ static const char *wavetable_mod_dest_names[] = {
|
||||
};
|
||||
|
||||
CALF_PORT_NAMES(wavetable) = {
|
||||
"Out L", "Out R",
|
||||
"Out L", "Out R",
|
||||
};
|
||||
|
||||
CALF_PLUGIN_INFO(wavetable) = { 0x8701, "Wavetable", "Calf Wavetable", "Krzysztof Foltman", calf_plugins::calf_copyright_info, "SynthesizerPlugin" };
|
||||
@@ -1159,4 +1444,3 @@ calf_plugins::plugin_registry::plugin_registry()
|
||||
#define PER_MODULE_ITEM(name, isSynth, jackname) plugins.push_back((new name##_metadata));
|
||||
#include <calf/modulelist.h>
|
||||
}
|
||||
|
||||
|
||||
@@ -445,3 +445,353 @@ bool filterclavier_audio_module::get_graph(int index, int subindex, float *data,
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
stereo_audio_module::stereo_audio_module() {
|
||||
active = false;
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
}
|
||||
|
||||
void stereo_audio_module::activate() {
|
||||
active = true;
|
||||
}
|
||||
|
||||
void stereo_audio_module::deactivate() {
|
||||
active = false;
|
||||
}
|
||||
|
||||
void stereo_audio_module::params_changed() {
|
||||
float slev = 2 * *params[param_slev]; // stereo level ( -2 -> 2 )
|
||||
float sbal = 1 + *params[param_sbal]; // stereo balance ( 0 -> 2 )
|
||||
float mlev = 2 * *params[param_mlev]; // mono level ( -2 -> 2 )
|
||||
float mpan = 1 + *params[param_mpan]; // mono pan ( 0 -> 2 )
|
||||
|
||||
switch((int)*params[param_mode])
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
//LR->LR
|
||||
LL = (mlev * (2.f - mpan) + slev * (2.f - sbal));
|
||||
LR = (mlev * mpan - slev * sbal);
|
||||
RL = (mlev * (2.f - mpan) - slev * (2.f - sbal));
|
||||
RR = (mlev * mpan + slev * sbal);
|
||||
break;
|
||||
case 1:
|
||||
//LR->MS
|
||||
LL = (2.f - mpan) * (2.f - sbal);
|
||||
LR = mpan * (2.f - sbal) * -1;
|
||||
RL = (2.f - mpan) * sbal;
|
||||
RR = mpan * sbal;
|
||||
break;
|
||||
case 2:
|
||||
//MS->LR
|
||||
LL = mlev * (2.f - sbal);
|
||||
LR = mlev * mpan;
|
||||
RL = slev * (2.f - sbal);
|
||||
RR = slev * sbal * -1;
|
||||
break;
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
//LR->LL
|
||||
LL = 0.f;
|
||||
LR = 0.f;
|
||||
RL = 0.f;
|
||||
RR = 0.f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
uint32_t stereo_audio_module::process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
|
||||
for(uint32_t i = offset; i < offset + numsamples; i++) {
|
||||
if(*params[param_bypass] > 0.5) {
|
||||
outs[0][i] = ins[0][i];
|
||||
outs[1][i] = ins[1][i];
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
} else {
|
||||
// let meters fall a bit
|
||||
clip_inL -= std::min(clip_inL, numsamples);
|
||||
clip_inR -= std::min(clip_inR, numsamples);
|
||||
clip_outL -= std::min(clip_outL, numsamples);
|
||||
clip_outR -= std::min(clip_outR, numsamples);
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
|
||||
float L = ins[0][i];
|
||||
float R = ins[1][i];
|
||||
|
||||
// levels in
|
||||
L *= *params[param_level_in];
|
||||
R *= *params[param_level_in];
|
||||
|
||||
// balance in
|
||||
L *= (1.f - std::max(0.f, *params[param_balance_in]));
|
||||
R *= (1.f + std::min(0.f, *params[param_balance_in]));
|
||||
|
||||
// copy / flip / mono ...
|
||||
switch((int)*params[param_mode])
|
||||
{
|
||||
case 0:
|
||||
default:
|
||||
// LR > LR
|
||||
break;
|
||||
case 1:
|
||||
// LR > MS
|
||||
break;
|
||||
case 2:
|
||||
// MS > LR
|
||||
break;
|
||||
case 3:
|
||||
// LR > LL
|
||||
R = L;
|
||||
break;
|
||||
case 4:
|
||||
// LR > RR
|
||||
L = R;
|
||||
break;
|
||||
case 5:
|
||||
// LR > L+R
|
||||
L = (L + R) / 2;
|
||||
R = L;
|
||||
break;
|
||||
case 6:
|
||||
// LR > RL
|
||||
float tmp = L;
|
||||
L = R;
|
||||
R = tmp;
|
||||
break;
|
||||
}
|
||||
|
||||
// softclip
|
||||
if(*params[param_softclip]) {
|
||||
int ph;
|
||||
ph = L / fabs(L);
|
||||
L = L > 0.63 ? ph * (0.63 + 0.36 * (1 - pow(MATH_E, (1.f / 3) * (0.63 + L * ph)))) : L;
|
||||
ph = R / fabs(R);
|
||||
R = R > 0.63 ? ph * (0.63 + 0.36 * (1 - pow(MATH_E, (1.f / 3) * (0.63 + R * ph)))) : R;
|
||||
}
|
||||
|
||||
// GUI stuff
|
||||
if(L > meter_inL) meter_inL = L;
|
||||
if(R > meter_inR) meter_inR = R;
|
||||
if(L > 1.f) clip_inL = srate >> 3;
|
||||
if(R > 1.f) clip_inR = srate >> 3;
|
||||
|
||||
// mute
|
||||
L *= (1 - floor(*params[param_mute_l] + 0.5));
|
||||
R *= (1 - floor(*params[param_mute_r] + 0.5));
|
||||
|
||||
// phase
|
||||
L *= (2 * (1 - floor(*params[param_phase_l] + 0.5))) - 1;
|
||||
R *= (2 * (1 - floor(*params[param_phase_r] + 0.5))) - 1;
|
||||
|
||||
// LR/MS
|
||||
L += LL*L + RL*R;
|
||||
R += RR*R + LR*L;
|
||||
|
||||
// widener
|
||||
L += *params[param_widener] * R * -1;
|
||||
R += *params[param_widener] * L * -1;
|
||||
|
||||
// delay
|
||||
buffer[pos] = L;
|
||||
buffer[pos + 1] = R;
|
||||
|
||||
int nbuf = srate * (fabs(*params[param_delay]) / 1000.f);
|
||||
nbuf -= nbuf % 2;
|
||||
if(*params[param_delay] > 0.f) {
|
||||
R = buffer[(pos - (int)nbuf + 1 + buffer_size) % buffer_size];
|
||||
} else if (*params[param_delay] < 0.f) {
|
||||
L = buffer[(pos - (int)nbuf + buffer_size) % buffer_size];
|
||||
}
|
||||
|
||||
pos = (pos + 2) % buffer_size;
|
||||
|
||||
// balance out
|
||||
L *= (1.f - std::max(0.f, *params[param_balance_out]));
|
||||
R *= (1.f + std::min(0.f, *params[param_balance_out]));
|
||||
|
||||
// level
|
||||
L *= *params[param_level_out];
|
||||
R *= *params[param_level_out];
|
||||
|
||||
//output
|
||||
outs[0][i] = L;
|
||||
outs[1][i] = R;
|
||||
|
||||
// clip LED's
|
||||
if(L > 1.f) clip_outL = srate >> 3;
|
||||
if(R > 1.f) clip_outR = srate >> 3;
|
||||
if(L > meter_outL) meter_outL = L;
|
||||
if(R > meter_outR) meter_outR = R;
|
||||
|
||||
// phase meter
|
||||
if(fabs(L) > 0.001 and fabs(R) > 0.001) {
|
||||
meter_phase = fabs(fabs(L+R) > 0.000000001 ? sin(fabs((L-R)/(L+R))) : 0.f);
|
||||
} else {
|
||||
meter_phase = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
// draw meters
|
||||
SET_IF_CONNECTED(clip_inL);
|
||||
SET_IF_CONNECTED(clip_inR);
|
||||
SET_IF_CONNECTED(clip_outL);
|
||||
SET_IF_CONNECTED(clip_outR);
|
||||
SET_IF_CONNECTED(meter_inL);
|
||||
SET_IF_CONNECTED(meter_inR);
|
||||
SET_IF_CONNECTED(meter_outL);
|
||||
SET_IF_CONNECTED(meter_outR);
|
||||
SET_IF_CONNECTED(meter_phase);
|
||||
return outputs_mask;
|
||||
}
|
||||
|
||||
void stereo_audio_module::set_sample_rate(uint32_t sr)
|
||||
{
|
||||
srate = sr;
|
||||
// rebuild buffer
|
||||
buffer_size = (int)(srate * 0.05 * 2.f); // buffer size attack rate multiplied by 2 channels
|
||||
buffer = (float*) calloc(buffer_size, sizeof(float));
|
||||
memset(buffer, 0, buffer_size * sizeof(float)); // reset buffer to zero
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
mono_audio_module::mono_audio_module() {
|
||||
active = false;
|
||||
clip_in = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_in = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
}
|
||||
|
||||
void mono_audio_module::activate() {
|
||||
active = true;
|
||||
}
|
||||
|
||||
void mono_audio_module::deactivate() {
|
||||
active = false;
|
||||
}
|
||||
|
||||
void mono_audio_module::params_changed() {
|
||||
|
||||
}
|
||||
|
||||
uint32_t mono_audio_module::process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask) {
|
||||
for(uint32_t i = offset; i < offset + numsamples; i++) {
|
||||
if(*params[param_bypass] > 0.5) {
|
||||
outs[0][i] = ins[0][i];
|
||||
outs[1][i] = ins[0][i];
|
||||
clip_in = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_in = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
} else {
|
||||
// let meters fall a bit
|
||||
clip_in -= std::min(clip_in, numsamples);
|
||||
clip_outL -= std::min(clip_outL, numsamples);
|
||||
clip_outR -= std::min(clip_outR, numsamples);
|
||||
meter_in = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
|
||||
float L = ins[0][i];
|
||||
|
||||
// levels in
|
||||
L *= *params[param_level_in];
|
||||
|
||||
// softclip
|
||||
if(*params[param_softclip]) {
|
||||
int ph = L / fabs(L);
|
||||
L = L > 0.63 ? ph * (0.63 + 0.36 * (1 - pow(MATH_E, (1.f / 3) * (0.63 + L * ph)))) : L;
|
||||
}
|
||||
|
||||
// GUI stuff
|
||||
if(L > meter_in) meter_in = L;
|
||||
if(L > 1.f) clip_in = srate >> 3;
|
||||
|
||||
float R = L;
|
||||
|
||||
// mute
|
||||
L *= (1 - floor(*params[param_mute_l] + 0.5));
|
||||
R *= (1 - floor(*params[param_mute_r] + 0.5));
|
||||
|
||||
// phase
|
||||
L *= (2 * (1 - floor(*params[param_phase_l] + 0.5))) - 1;
|
||||
R *= (2 * (1 - floor(*params[param_phase_r] + 0.5))) - 1;
|
||||
|
||||
// delay
|
||||
buffer[pos] = L;
|
||||
buffer[pos + 1] = R;
|
||||
|
||||
int nbuf = srate * (fabs(*params[param_delay]) / 1000.f);
|
||||
nbuf -= nbuf % 2;
|
||||
if(*params[param_delay] > 0.f) {
|
||||
R = buffer[(pos - (int)nbuf + 1 + buffer_size) % buffer_size];
|
||||
} else if (*params[param_delay] < 0.f) {
|
||||
L = buffer[(pos - (int)nbuf + buffer_size) % buffer_size];
|
||||
}
|
||||
|
||||
pos = (pos + 2) % buffer_size;
|
||||
|
||||
// balance out
|
||||
L *= (1.f - std::max(0.f, *params[param_balance_out]));
|
||||
R *= (1.f + std::min(0.f, *params[param_balance_out]));
|
||||
|
||||
// level
|
||||
L *= *params[param_level_out];
|
||||
R *= *params[param_level_out];
|
||||
|
||||
//output
|
||||
outs[0][i] = L;
|
||||
outs[1][i] = R;
|
||||
|
||||
// clip LED's
|
||||
if(L > 1.f) clip_outL = srate >> 3;
|
||||
if(R > 1.f) clip_outR = srate >> 3;
|
||||
if(L > meter_outL) meter_outL = L;
|
||||
if(R > meter_outR) meter_outR = R;
|
||||
}
|
||||
}
|
||||
// draw meters
|
||||
SET_IF_CONNECTED(clip_in);
|
||||
SET_IF_CONNECTED(clip_outL);
|
||||
SET_IF_CONNECTED(clip_outR);
|
||||
SET_IF_CONNECTED(meter_in);
|
||||
SET_IF_CONNECTED(meter_outL);
|
||||
SET_IF_CONNECTED(meter_outR);
|
||||
return outputs_mask;
|
||||
}
|
||||
|
||||
void mono_audio_module::set_sample_rate(uint32_t sr)
|
||||
{
|
||||
srate = sr;
|
||||
// rebuild buffer
|
||||
buffer_size = (int)srate * 0.05 * 2; // delay buffer size multiplied by 2 channels
|
||||
buffer = (float*) calloc(buffer_size, sizeof(float));
|
||||
memset(buffer, 0, buffer_size * sizeof(float)); // reset buffer to zero
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
@@ -37,6 +37,12 @@ saturator_audio_module::saturator_audio_module()
|
||||
is_active = false;
|
||||
srate = 0;
|
||||
meter_drive = 0.f;
|
||||
lp_pre_freq_old = -1;
|
||||
hp_pre_freq_old = -1;
|
||||
lp_post_freq_old = -1;
|
||||
hp_post_freq_old = -1;
|
||||
p_freq_old = -1;
|
||||
p_level_old = -1;
|
||||
}
|
||||
|
||||
void saturator_audio_module::activate()
|
||||
@@ -289,6 +295,15 @@ void exciter_audio_module::params_changed()
|
||||
}
|
||||
freq_old = *params[param_freq];
|
||||
}
|
||||
// set the params of all filters
|
||||
if(*params[param_ceil] != ceil_old or *params[param_ceil_active] != ceil_active_old) {
|
||||
lp[0][0].set_lp_rbj(*params[param_ceil], 0.707, (float)srate);
|
||||
lp[0][1].copy_coeffs(lp[0][0]);
|
||||
lp[1][0].copy_coeffs(lp[0][0]);
|
||||
lp[1][1].copy_coeffs(lp[0][0]);
|
||||
ceil_old = *params[param_ceil];
|
||||
ceil_active_old = *params[param_ceil_active];
|
||||
}
|
||||
// set distortion
|
||||
dist[0].set_params(*params[param_blend], *params[param_drive]);
|
||||
if(in_count > 1 && out_count > 1)
|
||||
@@ -372,6 +387,12 @@ uint32_t exciter_audio_module::process(uint32_t offset, uint32_t numsamples, uin
|
||||
|
||||
// all post filters in chain
|
||||
proc[i] = hp[i][2].process(hp[i][3].process(proc[i]));
|
||||
|
||||
if(*params[param_ceil_active] > 0.5f) {
|
||||
// all H/P post filters in chain
|
||||
proc[i] = lp[i][0].process(lp[i][1].process(proc[i]));
|
||||
|
||||
}
|
||||
}
|
||||
maxDrive = dist[0].get_distortion_level() * *params[param_amount];
|
||||
|
||||
@@ -463,6 +484,15 @@ void bassenhancer_audio_module::params_changed()
|
||||
}
|
||||
freq_old = *params[param_freq];
|
||||
}
|
||||
// set the params of all filters
|
||||
if(*params[param_floor] != floor_old or *params[param_floor_active] != floor_active_old) {
|
||||
hp[0][0].set_hp_rbj(*params[param_floor], 0.707, (float)srate);
|
||||
hp[0][1].copy_coeffs(hp[0][0]);
|
||||
hp[1][0].copy_coeffs(hp[0][0]);
|
||||
hp[1][1].copy_coeffs(hp[0][0]);
|
||||
floor_old = *params[param_floor];
|
||||
floor_active_old = *params[param_floor_active];
|
||||
}
|
||||
// set distortion
|
||||
dist[0].set_params(*params[param_blend], *params[param_drive]);
|
||||
if(in_count > 1 && out_count > 1)
|
||||
@@ -543,6 +573,12 @@ uint32_t bassenhancer_audio_module::process(uint32_t offset, uint32_t numsamples
|
||||
|
||||
// all post filters in chain
|
||||
proc[i] = lp[i][2].process(lp[i][3].process(proc[i]));
|
||||
|
||||
if(*params[param_floor_active] > 0.5f) {
|
||||
// all H/P post filters in chain
|
||||
proc[i] = hp[i][0].process(hp[i][1].process(proc[i]));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(in_count > 1 && out_count > 1) {
|
||||
|
||||
695
plugins/ladspa_effect/calf/src/modules_limit.cpp
Normal file
@@ -0,0 +1,695 @@
|
||||
/* Calf DSP plugin pack
|
||||
* Limiter related plugins
|
||||
*
|
||||
* Copyright (C) 2001-2010 Krzysztof Foltman, Markus Schmidt, Thor Harald Johansen and others
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General
|
||||
* Public License along with this program; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include <limits.h>
|
||||
#include <memory.h>
|
||||
#include <calf/giface.h>
|
||||
#include <calf/modules_limit.h>
|
||||
|
||||
using namespace dsp;
|
||||
using namespace calf_plugins;
|
||||
|
||||
#define SET_IF_CONNECTED(name) if (params[AM::param_##name] != NULL) *params[AM::param_##name] = name;
|
||||
|
||||
/// Limiter by Markus Schmidt and Christian Holschuh
|
||||
///
|
||||
/// This module provides the lookahead limiter as a simple audio module
|
||||
/// with choosable lookahead and release time.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
limiter_audio_module::limiter_audio_module()
|
||||
{
|
||||
is_active = false;
|
||||
srate = 0;
|
||||
// zero all displays
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
asc_led = 0.f;
|
||||
attack_old = -1.f;
|
||||
limit_old = -1.f;
|
||||
asc_old = true;
|
||||
}
|
||||
|
||||
void limiter_audio_module::activate()
|
||||
{
|
||||
is_active = true;
|
||||
// set all filters and strips
|
||||
params_changed();
|
||||
limiter.activate();
|
||||
}
|
||||
|
||||
void limiter_audio_module::deactivate()
|
||||
{
|
||||
is_active = false;
|
||||
limiter.deactivate();
|
||||
}
|
||||
|
||||
void limiter_audio_module::params_changed()
|
||||
{
|
||||
limiter.set_params(*params[param_limit], *params[param_attack], *params[param_release], 1.f, *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1), true);
|
||||
if( *params[param_attack] != attack_old) {
|
||||
attack_old = *params[param_attack];
|
||||
limiter.reset();
|
||||
}
|
||||
if(*params[param_limit] != limit_old or *params[param_asc] != asc_old) {
|
||||
asc_old = *params[param_asc];
|
||||
limit_old = *params[param_limit];
|
||||
limiter.reset_asc();
|
||||
}
|
||||
}
|
||||
|
||||
void limiter_audio_module::set_sample_rate(uint32_t sr)
|
||||
{
|
||||
srate = sr;
|
||||
limiter.set_sample_rate(srate);
|
||||
}
|
||||
|
||||
uint32_t limiter_audio_module::process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask)
|
||||
{
|
||||
bool bypass = *params[param_bypass] > 0.5f;
|
||||
numsamples += offset;
|
||||
if(bypass) {
|
||||
// everything bypassed
|
||||
while(offset < numsamples) {
|
||||
outs[0][offset] = ins[0][offset];
|
||||
outs[1][offset] = ins[1][offset];
|
||||
++offset;
|
||||
}
|
||||
// displays, too
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
asc_led = 0.f;
|
||||
} else {
|
||||
// let meters fall a bit
|
||||
clip_inL -= std::min(clip_inL, numsamples);
|
||||
clip_inR -= std::min(clip_inR, numsamples);
|
||||
clip_outL -= std::min(clip_outL, numsamples);
|
||||
clip_outR -= std::min(clip_outR, numsamples);
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
asc_led -= std::min(asc_led, numsamples);
|
||||
|
||||
while(offset < numsamples) {
|
||||
// cycle through samples
|
||||
float inL = ins[0][offset];
|
||||
float inR = ins[1][offset];
|
||||
// in level
|
||||
inR *= *params[param_level_in];
|
||||
inL *= *params[param_level_in];
|
||||
// out vars
|
||||
float outL = inL;
|
||||
float outR = inR;
|
||||
|
||||
// process gain reduction
|
||||
float fickdich[0];
|
||||
limiter.process(outL, outR, fickdich);
|
||||
if(limiter.get_asc())
|
||||
asc_led = srate >> 3;
|
||||
|
||||
// should never be used. but hackers are paranoid by default.
|
||||
// so we make shure NOTHING is above limit
|
||||
outL = std::max(outL, -*params[param_limit]);
|
||||
outL = std::min(outL, *params[param_limit]);
|
||||
outR = std::max(outR, -*params[param_limit]);
|
||||
outR = std::min(outR, *params[param_limit]);
|
||||
|
||||
// autolevel
|
||||
outL /= *params[param_limit];
|
||||
outR /= *params[param_limit];
|
||||
|
||||
// out level
|
||||
outL *= *params[param_level_out];
|
||||
outR *= *params[param_level_out];
|
||||
|
||||
// send to output
|
||||
outs[0][offset] = outL;
|
||||
outs[1][offset] = outR;
|
||||
|
||||
// clip LED's
|
||||
if(inL > 1.f) {
|
||||
clip_inL = srate >> 3;
|
||||
}
|
||||
if(inR > 1.f) {
|
||||
clip_inR = srate >> 3;
|
||||
}
|
||||
if(outL > 1.f) {
|
||||
clip_outL = srate >> 3;
|
||||
}
|
||||
if(outR > 1.f) {
|
||||
clip_outR = srate >> 3;
|
||||
}
|
||||
// set up in / out meters
|
||||
if(inL > meter_inL) {
|
||||
meter_inL = inL;
|
||||
}
|
||||
if(inR > meter_inR) {
|
||||
meter_inR = inR;
|
||||
}
|
||||
if(outL > meter_outL) {
|
||||
meter_outL = outL;
|
||||
}
|
||||
if(outR > meter_outR) {
|
||||
meter_outR = outR;
|
||||
}
|
||||
// next sample
|
||||
++offset;
|
||||
} // cycle trough samples
|
||||
|
||||
} // process (no bypass)
|
||||
|
||||
// draw meters
|
||||
SET_IF_CONNECTED(clip_inL);
|
||||
SET_IF_CONNECTED(clip_inR);
|
||||
SET_IF_CONNECTED(clip_outL);
|
||||
SET_IF_CONNECTED(clip_outR);
|
||||
SET_IF_CONNECTED(meter_inL);
|
||||
SET_IF_CONNECTED(meter_inR);
|
||||
SET_IF_CONNECTED(meter_outL);
|
||||
SET_IF_CONNECTED(meter_outR);
|
||||
|
||||
if (params[param_asc_led] != NULL) *params[param_asc_led] = asc_led;
|
||||
|
||||
if (*params[param_att]) {
|
||||
if(bypass)
|
||||
*params[param_att] = 1.f;
|
||||
else
|
||||
*params[param_att] = limiter.get_attenuation();
|
||||
}
|
||||
|
||||
// whatever has to be returned x)
|
||||
return outputs_mask;
|
||||
}
|
||||
|
||||
/// Multiband Limiter by Markus Schmidt and Christian Holschuh
|
||||
///
|
||||
/// This module splits the signal in four different bands
|
||||
/// and sends them through multiple filters (implemented by
|
||||
/// Krzysztof). They are processed by a lookahead limiter module afterwards
|
||||
/// and summed up to the final output again.
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
multibandlimiter_audio_module::multibandlimiter_audio_module()
|
||||
{
|
||||
is_active = false;
|
||||
srate = 0;
|
||||
// zero all displays
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
asc_led = 0.f;
|
||||
attack_old = -1.f;
|
||||
channels = 2;
|
||||
buffer_size = 0;
|
||||
overall_buffer_size = 0;
|
||||
_sanitize = false;
|
||||
for(int i = 0; i < strips - 1; i ++) {
|
||||
freq_old[i] = -1;
|
||||
sep_old[i] = -1;
|
||||
q_old[i] = -1;
|
||||
}
|
||||
mode_old = 0;
|
||||
for(int i = 0; i < strips; i ++) {
|
||||
weight_old[i] = -1.f;
|
||||
}
|
||||
attack_old = -1.f;
|
||||
limit_old = -1.f;
|
||||
asc_old = true;
|
||||
}
|
||||
|
||||
void multibandlimiter_audio_module::activate()
|
||||
{
|
||||
is_active = true;
|
||||
// set all filters and strips
|
||||
params_changed();
|
||||
// activate all strips
|
||||
for (int j = 0; j < strips; j ++) {
|
||||
strip[j].activate();
|
||||
strip[j].set_multi(true);
|
||||
strip[j].id = j;
|
||||
}
|
||||
broadband.activate();
|
||||
pos = 0;
|
||||
}
|
||||
|
||||
void multibandlimiter_audio_module::deactivate()
|
||||
{
|
||||
is_active = false;
|
||||
// deactivate all strips
|
||||
for (int j = 0; j < strips; j ++) {
|
||||
strip[j].deactivate();
|
||||
}
|
||||
broadband.deactivate();
|
||||
}
|
||||
|
||||
void multibandlimiter_audio_module::params_changed()
|
||||
{
|
||||
// determine mute/solo states
|
||||
solo[0] = *params[param_solo0] > 0.f ? true : false;
|
||||
solo[1] = *params[param_solo1] > 0.f ? true : false;
|
||||
solo[2] = *params[param_solo2] > 0.f ? true : false;
|
||||
solo[3] = *params[param_solo3] > 0.f ? true : false;
|
||||
no_solo = (*params[param_solo0] > 0.f ||
|
||||
*params[param_solo1] > 0.f ||
|
||||
*params[param_solo2] > 0.f ||
|
||||
*params[param_solo3] > 0.f) ? false : true;
|
||||
|
||||
mode_old = mode;
|
||||
mode = *params[param_mode];
|
||||
int i;
|
||||
int j1;
|
||||
switch(mode) {
|
||||
case 0:
|
||||
default:
|
||||
j1 = 0;
|
||||
break;
|
||||
case 1:
|
||||
j1 = 2;
|
||||
break;
|
||||
}
|
||||
// set the params of all filters
|
||||
if(*params[param_freq0] != freq_old[0] or *params[param_sep0] != sep_old[0] or *params[param_q0] != q_old[0] or *params[param_mode] != mode_old) {
|
||||
lpL[0][0].set_lp_rbj((float)(*params[param_freq0] * (1 - *params[param_sep0])), *params[param_q0], (float)srate);
|
||||
hpL[0][0].set_hp_rbj((float)(*params[param_freq0] * (1 + *params[param_sep0])), *params[param_q0], (float)srate);
|
||||
lpR[0][0].copy_coeffs(lpL[0][0]);
|
||||
hpR[0][0].copy_coeffs(hpL[0][0]);
|
||||
for(i = 1; i <= j1; i++) {
|
||||
lpL[0][i].copy_coeffs(lpL[0][0]);
|
||||
hpL[0][i].copy_coeffs(hpL[0][0]);
|
||||
lpR[0][i].copy_coeffs(lpL[0][0]);
|
||||
hpR[0][i].copy_coeffs(hpL[0][0]);
|
||||
}
|
||||
freq_old[0] = *params[param_freq0];
|
||||
sep_old[0] = *params[param_sep0];
|
||||
q_old[0] = *params[param_q0];
|
||||
}
|
||||
if(*params[param_freq1] != freq_old[1] or *params[param_sep1] != sep_old[1] or *params[param_q1] != q_old[1] or *params[param_mode] != mode_old) {
|
||||
lpL[1][0].set_lp_rbj((float)(*params[param_freq1] * (1 - *params[param_sep1])), *params[param_q1], (float)srate);
|
||||
hpL[1][0].set_hp_rbj((float)(*params[param_freq1] * (1 + *params[param_sep1])), *params[param_q1], (float)srate);
|
||||
lpR[1][0].copy_coeffs(lpL[1][0]);
|
||||
hpR[1][0].copy_coeffs(hpL[1][0]);
|
||||
for(i = 1; i <= j1; i++) {
|
||||
lpL[1][i].copy_coeffs(lpL[1][0]);
|
||||
hpL[1][i].copy_coeffs(hpL[1][0]);
|
||||
lpR[1][i].copy_coeffs(lpL[1][0]);
|
||||
hpR[1][i].copy_coeffs(hpL[1][0]);
|
||||
}
|
||||
freq_old[1] = *params[param_freq1];
|
||||
sep_old[1] = *params[param_sep1];
|
||||
q_old[1] = *params[param_q1];
|
||||
}
|
||||
if(*params[param_freq2] != freq_old[2] or *params[param_sep2] != sep_old[2] or *params[param_q2] != q_old[2] or *params[param_mode] != mode_old) {
|
||||
lpL[2][0].set_lp_rbj((float)(*params[param_freq2] * (1 - *params[param_sep2])), *params[param_q2], (float)srate);
|
||||
hpL[2][0].set_hp_rbj((float)(*params[param_freq2] * (1 + *params[param_sep2])), *params[param_q2], (float)srate);
|
||||
lpR[2][0].copy_coeffs(lpL[2][0]);
|
||||
hpR[2][0].copy_coeffs(hpL[2][0]);
|
||||
for(i = 1; i <= j1; i++) {
|
||||
lpL[2][i].copy_coeffs(lpL[2][0]);
|
||||
hpL[2][i].copy_coeffs(hpL[2][0]);
|
||||
lpR[2][i].copy_coeffs(lpL[2][0]);
|
||||
hpR[2][i].copy_coeffs(hpL[2][0]);
|
||||
}
|
||||
freq_old[2] = *params[param_freq2];
|
||||
sep_old[2] = *params[param_sep2];
|
||||
q_old[2] = *params[param_q2];
|
||||
}
|
||||
// set the params of all strips
|
||||
float rel;
|
||||
|
||||
rel = *params[param_release] * pow(0.25, *params[param_release0] * -1);
|
||||
rel = (*params[param_minrel] > 0.5) ? std::max(2500 * (1.f / 30), rel) : rel;
|
||||
weight[0] = pow(0.25, *params[param_weight0] * -1);
|
||||
strip[0].set_params(*params[param_limit], *params[param_attack], rel, weight[0], *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1), true);
|
||||
*params[param_effrelease0] = rel;
|
||||
rel = *params[param_release] * pow(0.25, *params[param_release1] * -1);
|
||||
rel = (*params[param_minrel] > 0.5) ? std::max(2500 * (1.f / *params[param_freq0]), rel) : rel;
|
||||
weight[1] = pow(0.25, *params[param_weight1] * -1);
|
||||
strip[1].set_params(*params[param_limit], *params[param_attack], rel, weight[1], *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1));
|
||||
*params[param_effrelease1] = rel;
|
||||
rel = *params[param_release] * pow(0.25, *params[param_release2] * -1);
|
||||
rel = (*params[param_minrel] > 0.5) ? std::max(2500 * (1.f / *params[param_freq1]), rel) : rel;
|
||||
weight[2] = pow(0.25, *params[param_weight2] * -1);
|
||||
strip[2].set_params(*params[param_limit], *params[param_attack], rel, weight[2], *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1));
|
||||
*params[param_effrelease2] = rel;
|
||||
rel = *params[param_release] * pow(0.25, *params[param_release3] * -1);
|
||||
rel = (*params[param_minrel] > 0.5) ? std::max(2500 * (1.f / *params[param_freq2]), rel) : rel;
|
||||
weight[3] = pow(0.25, *params[param_weight3] * -1);
|
||||
strip[3].set_params(*params[param_limit], *params[param_attack], rel, weight[3], *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1));
|
||||
*params[param_effrelease3] = rel;
|
||||
broadband.set_params(*params[param_limit], *params[param_attack], rel, 1.f, *params[param_asc], pow(0.5, (*params[param_asc_coeff] - 0.5) * 2 * -1));
|
||||
// rebuild multiband buffer
|
||||
if( *params[param_attack] != attack_old) {
|
||||
int bs = (int)(srate * (*params[param_attack] / 1000.f) * channels);
|
||||
buffer_size = bs - bs % channels; // buffer size attack rate
|
||||
attack_old = *params[param_attack];
|
||||
_sanitize = true;
|
||||
pos = 0;
|
||||
for (int j = 0; j < strips; j ++) {
|
||||
strip[j].reset();
|
||||
}
|
||||
broadband.reset();
|
||||
}
|
||||
if(*params[param_limit] != limit_old or *params[param_asc] != asc_old or *params[param_weight0] != weight_old[0] or *params[param_weight1] != weight_old[1] or *params[param_weight2] != weight_old[2] or *params[param_weight3] != weight_old[3] ) {
|
||||
asc_old = *params[param_asc];
|
||||
limit_old = *params[param_limit];
|
||||
weight_old[0] = *params[param_weight0];
|
||||
weight_old[1] = *params[param_weight1];
|
||||
weight_old[2] = *params[param_weight2];
|
||||
weight_old[3] = *params[param_weight3];
|
||||
for (int j = 0; j < strips; j ++) {
|
||||
strip[j].reset_asc();
|
||||
}
|
||||
broadband.reset_asc();
|
||||
}
|
||||
}
|
||||
|
||||
void multibandlimiter_audio_module::set_sample_rate(uint32_t sr)
|
||||
{
|
||||
srate = sr;
|
||||
// rebuild buffer
|
||||
overall_buffer_size = (int)(srate * (100.f / 1000.f) * channels) + channels; // buffer size max attack rate
|
||||
buffer = (float*) calloc(overall_buffer_size, sizeof(float));
|
||||
memset(buffer, 0, overall_buffer_size * sizeof(float)); // reset buffer to zero
|
||||
pos = 0;
|
||||
// set srate of all strips
|
||||
for (int j = 0; j < strips; j ++) {
|
||||
strip[j].set_sample_rate(srate);
|
||||
}
|
||||
broadband.set_sample_rate(srate);
|
||||
}
|
||||
|
||||
#define BYPASSED_COMPRESSION(index) \
|
||||
if(params[param_att##index] != NULL) \
|
||||
*params[param_att##index] = 1.0; \
|
||||
|
||||
#define ACTIVE_COMPRESSION(index) \
|
||||
if(params[param_att##index] != NULL) \
|
||||
*params[param_att##index] = strip[index].get_attenuation(); \
|
||||
|
||||
uint32_t multibandlimiter_audio_module::process(uint32_t offset, uint32_t numsamples, uint32_t inputs_mask, uint32_t outputs_mask)
|
||||
{
|
||||
bool bypass = *params[param_bypass] > 0.5f;
|
||||
numsamples += offset;
|
||||
float batt = 0.f;
|
||||
if(bypass) {
|
||||
// everything bypassed
|
||||
while(offset < numsamples) {
|
||||
outs[0][offset] = ins[0][offset];
|
||||
outs[1][offset] = ins[1][offset];
|
||||
++offset;
|
||||
}
|
||||
// displays, too
|
||||
clip_inL = 0.f;
|
||||
clip_inR = 0.f;
|
||||
clip_outL = 0.f;
|
||||
clip_outR = 0.f;
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
asc_led = 0.f;
|
||||
} else {
|
||||
// process all strips
|
||||
|
||||
// let meters fall a bit
|
||||
clip_inL -= std::min(clip_inL, numsamples);
|
||||
clip_inR -= std::min(clip_inR, numsamples);
|
||||
clip_outL -= std::min(clip_outL, numsamples);
|
||||
clip_outR -= std::min(clip_outR, numsamples);
|
||||
asc_led -= std::min(asc_led, numsamples);
|
||||
meter_inL = 0.f;
|
||||
meter_inR = 0.f;
|
||||
meter_outL = 0.f;
|
||||
meter_outR = 0.f;
|
||||
float _tmpL[channels];
|
||||
float _tmpR[channels];
|
||||
while(offset < numsamples) {
|
||||
float inL = 0.f;
|
||||
float inR = 0.f;
|
||||
// cycle through samples
|
||||
if(!_sanitize) {
|
||||
inL = ins[0][offset];
|
||||
inR = ins[1][offset];
|
||||
}
|
||||
// in level
|
||||
inR *= *params[param_level_in];
|
||||
inL *= *params[param_level_in];
|
||||
// even out filters gain reduction
|
||||
// 3dB - levelled manually (based on default sep and q settings)
|
||||
switch(mode) {
|
||||
case 0:
|
||||
inL *= 1.414213562;
|
||||
inR *= 1.414213562;
|
||||
break;
|
||||
case 1:
|
||||
inL *= 0.88;
|
||||
inR *= 0.88;
|
||||
break;
|
||||
}
|
||||
// out vars
|
||||
float outL = 0.f;
|
||||
float outR = 0.f;
|
||||
int j1;
|
||||
float left;
|
||||
float right;
|
||||
float sum_left = 0.f;
|
||||
float sum_right = 0.f;
|
||||
bool asc_active = false;
|
||||
for (int i = 0; i < strips; i++) {
|
||||
left = inL;
|
||||
right = inR;
|
||||
// send trough filters
|
||||
switch(mode) {
|
||||
// how many filter passes? (12/36dB)
|
||||
case 0:
|
||||
default:
|
||||
j1 = 0;
|
||||
break;
|
||||
case 1:
|
||||
j1 = 2;
|
||||
break;
|
||||
}
|
||||
for (int j = 0; j <= j1; j++){
|
||||
if(i + 1 < strips) {
|
||||
// do lowpass on all bands except most high
|
||||
left = lpL[i][j].process(left);
|
||||
right = lpR[i][j].process(right);
|
||||
lpL[i][j].sanitize();
|
||||
lpR[i][j].sanitize();
|
||||
}
|
||||
if(i - 1 >= 0) {
|
||||
// do highpass on all bands except most low
|
||||
left = hpL[i - 1][j].process(left);
|
||||
right = hpR[i - 1][j].process(right);
|
||||
hpL[i - 1][j].sanitize();
|
||||
hpR[i - 1][j].sanitize();
|
||||
}
|
||||
}
|
||||
|
||||
// remember filtered values for limiting
|
||||
// (we need multiband_coeff before we can call the limiter bands)
|
||||
_tmpL[i] = left;
|
||||
_tmpR[i] = right;
|
||||
|
||||
// sum up for multiband coefficient
|
||||
sum_left += ((fabs(left) > *params[param_limit]) ? *params[param_limit] * (fabs(left) / left) : left) * weight[i];
|
||||
sum_right += ((fabs(right) > *params[param_limit]) ? *params[param_limit] * (fabs(right) / right) : right) * weight[i];
|
||||
} // process single strip with filter
|
||||
|
||||
// write multiband coefficient to buffer
|
||||
buffer[pos] = std::min(*params[param_limit] / std::max(fabs(sum_left), fabs(sum_right)), 1.0);
|
||||
|
||||
for (int i = 0; i < strips; i++) {
|
||||
// process gain reduction
|
||||
strip[i].process(_tmpL[i], _tmpR[i], buffer);
|
||||
// sum up output of limiters
|
||||
if (solo[i] || no_solo) {
|
||||
outL += _tmpL[i];
|
||||
outR += _tmpR[i];
|
||||
}
|
||||
asc_active = asc_active || strip[i].get_asc();
|
||||
} // process single strip again for limiter
|
||||
float fickdich[0];
|
||||
broadband.process(outL, outR, fickdich);
|
||||
asc_active = asc_active || broadband.get_asc();
|
||||
|
||||
// should never be used. but hackers are paranoid by default.
|
||||
// so we make shure NOTHING is above limit
|
||||
outL = std::max(outL, -*params[param_limit]);
|
||||
outL = std::min(outL, *params[param_limit]);
|
||||
outR = std::max(outR, -*params[param_limit]);
|
||||
outR = std::min(outR, *params[param_limit]);
|
||||
|
||||
batt = broadband.get_attenuation();
|
||||
|
||||
// autolevel
|
||||
outL /= *params[param_limit];
|
||||
outR /= *params[param_limit];
|
||||
|
||||
// out level
|
||||
outL *= *params[param_level_out];
|
||||
outR *= *params[param_level_out];
|
||||
|
||||
// send to output
|
||||
outs[0][offset] = outL;
|
||||
outs[1][offset] = outR;
|
||||
|
||||
// clip LED's
|
||||
if(ins[0][offset] * *params[param_level_in] > 1.f) {
|
||||
clip_inL = srate >> 3;
|
||||
}
|
||||
if(ins[1][offset] * *params[param_level_in] > 1.f) {
|
||||
clip_inR = srate >> 3;
|
||||
}
|
||||
if(outL > 1.f) {
|
||||
clip_outL = srate >> 3;
|
||||
}
|
||||
if(outR > 1.f) {
|
||||
clip_outR = srate >> 3;
|
||||
}
|
||||
// set up in / out meters
|
||||
if(ins[0][offset] * *params[param_level_in] > meter_inL) {
|
||||
meter_inL = ins[0][offset] * *params[param_level_in];
|
||||
}
|
||||
if(ins[1][offset] * *params[param_level_in] > meter_inR) {
|
||||
meter_inR = ins[1][offset] * *params[param_level_in];
|
||||
}
|
||||
if(outL > meter_outL) {
|
||||
meter_outL = outL;
|
||||
}
|
||||
if(outR > meter_outR) {
|
||||
meter_outR = outR;
|
||||
}
|
||||
if(asc_active) {
|
||||
asc_led = srate >> 3;
|
||||
}
|
||||
// next sample
|
||||
++offset;
|
||||
pos = (pos + channels) % buffer_size;
|
||||
if(pos == 0) _sanitize = false;
|
||||
} // cycle trough samples
|
||||
|
||||
} // process all strips (no bypass)
|
||||
|
||||
// draw meters
|
||||
SET_IF_CONNECTED(clip_inL);
|
||||
SET_IF_CONNECTED(clip_inR);
|
||||
SET_IF_CONNECTED(clip_outL);
|
||||
SET_IF_CONNECTED(clip_outR);
|
||||
SET_IF_CONNECTED(meter_inL);
|
||||
SET_IF_CONNECTED(meter_inR);
|
||||
SET_IF_CONNECTED(meter_outL);
|
||||
SET_IF_CONNECTED(meter_outR);
|
||||
|
||||
if (params[param_asc_led] != NULL) *params[param_asc_led] = asc_led;
|
||||
|
||||
// draw strip meters
|
||||
if(bypass > 0.5f) {
|
||||
if(params[param_att0] != NULL) *params[param_att0] = 1.0;
|
||||
if(params[param_att1] != NULL) *params[param_att1] = 1.0;
|
||||
if(params[param_att2] != NULL) *params[param_att2] = 1.0;
|
||||
if(params[param_att3] != NULL) *params[param_att3] = 1.0;
|
||||
|
||||
} else {
|
||||
if(params[param_att0] != NULL) *params[param_att0] = strip[0].get_attenuation() * batt;
|
||||
if(params[param_att1] != NULL) *params[param_att1] = strip[1].get_attenuation() * batt;
|
||||
if(params[param_att2] != NULL) *params[param_att2] = strip[2].get_attenuation() * batt;
|
||||
if(params[param_att3] != NULL) *params[param_att3] = strip[3].get_attenuation() * batt;
|
||||
}
|
||||
// whatever has to be returned x)
|
||||
return outputs_mask;
|
||||
}
|
||||
|
||||
bool multibandlimiter_audio_module::get_graph(int index, int subindex, float *data, int points, cairo_iface *context) const
|
||||
{
|
||||
if (!is_active or subindex > 3)
|
||||
return false;
|
||||
float ret;
|
||||
double freq;
|
||||
int j1;
|
||||
for (int i = 0; i < points; i++)
|
||||
{
|
||||
ret = 1.f;
|
||||
freq = 20.0 * pow (20000.0 / 20.0, i * 1.0 / points);
|
||||
switch(mode) {
|
||||
case 0:
|
||||
default:
|
||||
j1 = 0;
|
||||
break;
|
||||
case 1:
|
||||
j1 = 2;
|
||||
break;
|
||||
}
|
||||
for(int j = 0; j <= j1; j ++) {
|
||||
switch(subindex) {
|
||||
case 0:
|
||||
ret *= lpL[0][j].freq_gain(freq, (float)srate);
|
||||
break;
|
||||
case 1:
|
||||
ret *= hpL[0][j].freq_gain(freq, (float)srate);
|
||||
ret *= lpL[1][j].freq_gain(freq, (float)srate);
|
||||
break;
|
||||
case 2:
|
||||
ret *= hpL[1][j].freq_gain(freq, (float)srate);
|
||||
ret *= lpL[2][j].freq_gain(freq, (float)srate);
|
||||
break;
|
||||
case 3:
|
||||
ret *= hpL[2][j].freq_gain(freq, (float)srate);
|
||||
break;
|
||||
}
|
||||
}
|
||||
data[i] = dB_grid(ret);
|
||||
}
|
||||
if (*params[param_bypass] > 0.5f)
|
||||
context->set_source_rgba(0.35, 0.4, 0.2, 0.3);
|
||||
else {
|
||||
context->set_source_rgba(0.35, 0.4, 0.2, 1);
|
||||
context->set_line_width(1.5);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool multibandlimiter_audio_module::get_gridline(int index, int subindex, float &pos, bool &vertical, std::string &legend, cairo_iface *context) const
|
||||
{
|
||||
if (!is_active) {
|
||||
return false;
|
||||
} else {
|
||||
vertical = (subindex & 1) != 0;
|
||||
return get_freq_gridline(subindex, pos, vertical, legend, context);
|
||||
}
|
||||
}
|
||||
@@ -51,6 +51,12 @@ void monosynth_audio_module::activate() {
|
||||
last_pwshift1 = last_pwshift2 = 0;
|
||||
last_stretch1 = 65536;
|
||||
queue_note_on_and_off = false;
|
||||
prev_wave1 = -1;
|
||||
prev_wave2 = -1;
|
||||
wave1 = -1;
|
||||
wave2 = -1;
|
||||
queue_note_on = -1;
|
||||
last_filter_type = -1;
|
||||
}
|
||||
|
||||
waveform_family<MONOSYNTH_WAVE_BITS> *monosynth_audio_module::waves;
|
||||
@@ -352,8 +358,6 @@ void monosynth_audio_module::delayed_note_on()
|
||||
velocity = queue_vel;
|
||||
ampctl = 1.0 + (queue_vel - 1.0) * *params[par_vel2amp];
|
||||
fltctl = 1.0 + (queue_vel - 1.0) * *params[par_vel2filter];
|
||||
set_frequency();
|
||||
lookup_waveforms();
|
||||
bool starting = false;
|
||||
|
||||
if (!running)
|
||||
@@ -408,6 +412,8 @@ void monosynth_audio_module::delayed_note_on()
|
||||
queue_note_on = -1;
|
||||
float modsrc[modsrc_count] = { 1, velocity, inertia_pressure.get_last(), modwheel_value, envelope1.value, envelope2.value, 0.5+0.5*lfo1.last, 0.5+0.5*lfo2.last};
|
||||
calculate_modmatrix(moddest, moddest_count, modsrc);
|
||||
set_frequency();
|
||||
lookup_waveforms();
|
||||
|
||||
if (queue_note_on_and_off)
|
||||
{
|
||||
@@ -467,7 +473,6 @@ void monosynth_audio_module::calculate_step()
|
||||
if (fabs(*params[par_lfopitch]) > small_value<float>())
|
||||
lfo_bend = pow(2.0f, *params[par_lfopitch] * lfov1 * (1.f / 1200.0f));
|
||||
inertia_pitchbend.step();
|
||||
set_frequency();
|
||||
envelope1.advance();
|
||||
envelope2.advance();
|
||||
float env1 = envelope1.value, env2 = envelope2.value;
|
||||
@@ -478,6 +483,7 @@ void monosynth_audio_module::calculate_step()
|
||||
float modsrc[modsrc_count] = { 1, velocity, inertia_pressure.get(), modwheel_value, env1, env2, 0.5+0.5*lfov1, 0.5+0.5*lfov2};
|
||||
calculate_modmatrix(moddest, moddest_count, modsrc);
|
||||
|
||||
set_frequency();
|
||||
inertia_cutoff.set_inertia(*params[par_cutoff]);
|
||||
cutoff = inertia_cutoff.get() * pow(2.0f, (lfov1 * *params[par_lfofilter] + env1 * fltctl * *params[par_env1tocutoff] + env2 * fltctl * *params[par_env2tocutoff] + moddest[moddest_cutoff]) * (1.f / 1200.f));
|
||||
if (*params[par_keyfollow] > 0.01f)
|
||||
|
||||
@@ -23,16 +23,15 @@
|
||||
#include <calf/lv2wrap.h>
|
||||
#include <calf/modules.h>
|
||||
#include <calf/modules_comp.h>
|
||||
#include <calf/modules_limit.h>
|
||||
#include <calf/modules_dev.h>
|
||||
#include <calf/modules_dist.h>
|
||||
#include <calf/modules_eq.h>
|
||||
#include <calf/modules_mod.h>
|
||||
#include <calf/modules_synths.h>
|
||||
#include <calf/organ.h>
|
||||
#include <calf/osctlnet.h>
|
||||
|
||||
using namespace calf_plugins;
|
||||
using namespace osctl;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -481,7 +480,7 @@ ladspa_plugin_metadata_set::~ladspa_plugin_metadata_set()
|
||||
// instantiate descriptor templates
|
||||
template<class Module> LV2_Descriptor calf_plugins::lv2_wrapper<Module>::descriptor;
|
||||
template<class Module> LV2_Calf_Descriptor calf_plugins::lv2_wrapper<Module>::calf_descriptor;
|
||||
template<class Module> LV2_Persist calf_plugins::lv2_wrapper<Module>::persist;
|
||||
template<class Module> LV2_State_Interface calf_plugins::lv2_wrapper<Module>::state_iface;
|
||||
|
||||
extern "C" {
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ ADD_LIBRARY(gverb STATIC gverb/gverb.c gverb/gverbdsp.c)
|
||||
SET_TARGET_PROPERTIES(gverb PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
TARGET_LINK_LIBRARIES(gverb_1216 gverb)
|
||||
|
||||
ADD_LIBRARY(blo STATIC util/blo.c)
|
||||
SET_TARGET_PROPERTIES(blo PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
TARGET_LINK_LIBRARIES(hermes_filter_1200 blo)
|
||||
|
||||
ADD_LIBRARY(rms STATIC util/rms.c)
|
||||
ADD_LIBRARY(db STATIC util/db.c)
|
||||
SET_TARGET_PROPERTIES(rms PROPERTIES COMPILE_FLAGS "-fPIC")
|
||||
|
||||
16
plugins/ladspa_effect/swh/gsm/COPYRIGHT
Normal file
@@ -0,0 +1,16 @@
|
||||
Copyright 1992, 1993, 1994 by Jutta Degener and Carsten Bormann,
|
||||
Technische Universitaet Berlin
|
||||
|
||||
Any use of this software is permitted provided that this notice is not
|
||||
removed and that neither the authors nor the Technische Universitaet Berlin
|
||||
are deemed to have made any representations as to the suitability of this
|
||||
software for any purpose nor are held responsible for any defects of
|
||||
this software. THERE IS ABSOLUTELY NO WARRANTY FOR THIS SOFTWARE.
|
||||
|
||||
As a matter of courtesy, the authors request to be informed about uses
|
||||
this software has found, about bugs in this software, and about any
|
||||
improvements that may be of general interest.
|
||||
|
||||
Berlin, 28.11.1994
|
||||
Jutta Degener
|
||||
Carsten Bormann
|
||||
2009
plugins/ladspa_effect/swh/hermes_filter_1200.c
Normal file
@@ -457,7 +457,8 @@ static void runMbeq(LADSPA_Handle instance, unsigned long sample_count) {
|
||||
#endif
|
||||
|
||||
// Multiply the bins magnitudes by the coeficients
|
||||
for (i = 0; i < FFT_LENGTH/2; i++) {
|
||||
comp[0] *= coefs[0];
|
||||
for (i = 1; i < FFT_LENGTH/2; i++) {
|
||||
comp[i] *= coefs[i];
|
||||
comp[FFT_LENGTH-i] *= coefs[i];
|
||||
}
|
||||
@@ -621,7 +622,8 @@ static void runAddingMbeq(LADSPA_Handle instance, unsigned long sample_count) {
|
||||
#endif
|
||||
|
||||
// Multiply the bins magnitudes by the coeficients
|
||||
for (i = 0; i < FFT_LENGTH/2; i++) {
|
||||
comp[0] *= coefs[0];
|
||||
for (i = 1; i < FFT_LENGTH/2; i++) {
|
||||
comp[i] *= coefs[i];
|
||||
comp[FFT_LENGTH-i] *= coefs[i];
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ blo_h_tables *blo_h_tables_new(int table_size)
|
||||
|
||||
snprintf(shm_path, 128, "/blo-1-%dx%dx%d.tbl", BLO_N_WAVES,
|
||||
BLO_N_HARMONICS, table_size + BLO_TABLE_WR);
|
||||
#ifndef WIN32
|
||||
if ((shm_fd = shm_open(shm_path, O_RDONLY, 0)) > 0) {
|
||||
/* There is an existing SHM segment that matches what we want */
|
||||
|
||||
@@ -127,6 +128,7 @@ blo_h_tables *blo_h_tables_new(int table_size)
|
||||
MAP_SHARED, shm_fd, 0);
|
||||
close(shm_fd);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Fallback case, can't map a SHM segment, just malloc it and suffer */
|
||||
if (!all_tables) {
|
||||
@@ -226,7 +228,9 @@ blo_h_tables *blo_h_tables_new(int table_size)
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef WIN32
|
||||
msync(all_tables, all_tables_size, MS_ASYNC);
|
||||
#endif
|
||||
|
||||
return this;
|
||||
}
|
||||
@@ -234,7 +238,9 @@ blo_h_tables *blo_h_tables_new(int table_size)
|
||||
void blo_h_tables_free(blo_h_tables *tables)
|
||||
{
|
||||
if (tables->store_type == BLO_MMAP) {
|
||||
#ifndef WIN32
|
||||
munmap(tables->alloc_space, tables->alloc_size);
|
||||
#endif
|
||||
} else {
|
||||
free(tables->alloc_space);
|
||||
}
|
||||
|
||||
@@ -86,9 +86,9 @@ void combine_iir_stages(int mode, iir_stage_t* gt, iir_stage_t *first, iir_stage
|
||||
void free_iir_stage(iir_stage_t *gt){
|
||||
int i;
|
||||
for(i=0;i<gt->availst;i++)
|
||||
free(gt->coeff[i]);
|
||||
free(gt->coeff);
|
||||
free(gt);
|
||||
if (gt->coeff[i]) free(gt->coeff[i]);
|
||||
if (gt->coeff) free(gt->coeff);
|
||||
if (gt) free(gt);
|
||||
}
|
||||
|
||||
/* center: frequency already normalized between 0 and 0.5 of sampling
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#ifndef IIR_H
|
||||
#define IIR_H
|
||||
|
||||
#include "../ladspa-util.h"
|
||||
#include <ladspa-util.h>
|
||||
|
||||
/* header file for IIR framework */
|
||||
|
||||
@@ -64,10 +64,10 @@ static inline iirf_t* init_iirf_t(iir_stage_t* gt) {
|
||||
static inline void free_iirf_t(iirf_t* iirf, iir_stage_t* gt) {
|
||||
int i;
|
||||
for(i=0;i<gt->availst;i++){
|
||||
free(iirf[i].iring);
|
||||
free(iirf[i].oring);
|
||||
if (iirf[i].iring) free(iirf[i].iring);
|
||||
if (iirf[i].oring) free(iirf[i].oring);
|
||||
}
|
||||
free(iirf);
|
||||
if (iirf) free(iirf);
|
||||
};
|
||||
|
||||
static inline void reset_iirf_t(iirf_t* iirf, iir_stage_t* gt, int n) {
|
||||
|
||||
@@ -158,6 +158,8 @@ void sidInstrument::saveSettings( QDomDocument & _doc,
|
||||
_doc, _this, "sustain" + is );
|
||||
m_voice[i]->m_releaseModel.saveSettings(
|
||||
_doc, _this, "release" + is );
|
||||
m_voice[i]->m_coarseModel.saveSettings(
|
||||
_doc, _this, "coarse" + is );
|
||||
m_voice[i]->m_waveFormModel.saveSettings(
|
||||
_doc, _this,"waveform" + is );
|
||||
m_voice[i]->m_syncModel.saveSettings(
|
||||
@@ -196,6 +198,7 @@ void sidInstrument::loadSettings( const QDomElement & _this )
|
||||
m_voice[i]->m_decayModel.loadSettings( _this, "decay" + is );
|
||||
m_voice[i]->m_sustainModel.loadSettings( _this, "sustain" + is );
|
||||
m_voice[i]->m_releaseModel.loadSettings( _this, "release" + is );
|
||||
m_voice[i]->m_coarseModel.loadSettings( _this, "coarse" + is );
|
||||
m_voice[i]->m_waveFormModel.loadSettings( _this, "waveform" + is );
|
||||
m_voice[i]->m_syncModel.loadSettings( _this, "sync" + is );
|
||||
m_voice[i]->m_ringModModel.loadSettings( _this, "ringmod" + is );
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.cpp - instrument-plugin for hosting VST-instruments
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -29,6 +29,8 @@
|
||||
#include <QtGui/QMessageBox>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QPushButton>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtXml/QDomElement>
|
||||
|
||||
#include "engine.h"
|
||||
@@ -36,6 +38,7 @@
|
||||
#include "InstrumentPlayHandle.h"
|
||||
#include "InstrumentTrack.h"
|
||||
#include "VstPlugin.h"
|
||||
#include "MainWindow.h"
|
||||
#include "pixmap_button.h"
|
||||
#include "string_pair_drag.h"
|
||||
#include "text_float.h"
|
||||
@@ -44,6 +47,7 @@
|
||||
#include "embed.cpp"
|
||||
|
||||
|
||||
|
||||
extern "C"
|
||||
{
|
||||
|
||||
@@ -65,12 +69,17 @@ Plugin::Descriptor PLUGIN_EXPORT vestige_plugin_descriptor =
|
||||
|
||||
|
||||
QPixmap * VestigeInstrumentView::s_artwork = NULL;
|
||||
QPixmap * manageVestigeInstrumentView::s_artwork = NULL;
|
||||
|
||||
|
||||
vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
|
||||
Instrument( _instrument_track, &vestige_plugin_descriptor ),
|
||||
m_plugin( NULL ),
|
||||
m_pluginMutex()
|
||||
m_pluginMutex(),
|
||||
m_subWindow( NULL ),
|
||||
vstKnobs( NULL ),
|
||||
knobFModel( NULL ),
|
||||
p_subWindow( NULL )
|
||||
{
|
||||
// now we need a play-handle which cares for calling play()
|
||||
InstrumentPlayHandle * iph = new InstrumentPlayHandle( this );
|
||||
@@ -82,6 +91,16 @@ vestigeInstrument::vestigeInstrument( InstrumentTrack * _instrument_track ) :
|
||||
|
||||
vestigeInstrument::~vestigeInstrument()
|
||||
{
|
||||
if (p_subWindow != NULL) {
|
||||
delete p_subWindow;
|
||||
p_subWindow = NULL;
|
||||
}
|
||||
|
||||
if (knobFModel != NULL) {
|
||||
delete []knobFModel;
|
||||
knobFModel = NULL;
|
||||
}
|
||||
|
||||
engine::getMixer()->removePlayHandles( instrumentTrack() );
|
||||
closePlugin();
|
||||
}
|
||||
@@ -96,6 +115,28 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->loadSettings( _this );
|
||||
|
||||
const QMap<QString, QString> & dump = m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
char paramStr[35];
|
||||
vstKnobs = new knob *[paramCount];
|
||||
knobFModel = new FloatModel *[paramCount];
|
||||
QStringList list1;
|
||||
QWidget * widget = new QWidget();
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
|
||||
vstKnobs[i] = new knob( knobBright_26, widget );
|
||||
vstKnobs[i]->setHintText( list1.at(1) + ":", "");
|
||||
vstKnobs[i]->setLabel( list1.at(1).left(15) );
|
||||
|
||||
knobFModel[i] = new FloatModel( (list1.at(2)).toFloat(), 0.0f, 1.0f, 0.01f, this, QString::number(i) );
|
||||
knobFModel[i]->loadSettings( _this, paramStr );
|
||||
connect( knobFModel[i], SIGNAL( dataChanged() ), this, SLOT( setParameter() ) );
|
||||
|
||||
vstKnobs[i]->setModel( knobFModel[i] );
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -103,6 +144,20 @@ void vestigeInstrument::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::setParameter( void )
|
||||
{
|
||||
|
||||
Model *action = qobject_cast<Model *>(sender());
|
||||
int knobUNID = action->displayName().toInt();
|
||||
|
||||
if ( m_plugin != NULL ) {
|
||||
m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "plugin", m_pluginDLL );
|
||||
@@ -110,6 +165,40 @@ void vestigeInstrument::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
if( m_plugin != NULL )
|
||||
{
|
||||
m_plugin->saveSettings( _doc, _this );
|
||||
if (knobFModel != NULL) {
|
||||
const QMap<QString, QString> & dump = m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
char paramStr[35];
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
knobFModel[i]->saveSettings( _doc, _this, paramStr );
|
||||
}
|
||||
|
||||
/* QDomElement me = _doc.createElement( paramStr );
|
||||
me.setAttribute( "id", knobFModel[i]->id() );
|
||||
me.setAttribute( "value", knobFModel[i]->value() );
|
||||
_this.appendChild( me );
|
||||
|
||||
ControllerConnection * m_controllerConnection = knobFModel[i]->getControllerConnection();
|
||||
if (m_controllerConnection) {
|
||||
QDomElement controller_element;
|
||||
QDomNode node = _this.namedItem( "connection" );
|
||||
if( node.isElement() )
|
||||
{
|
||||
controller_element = node.toElement();
|
||||
}
|
||||
else
|
||||
{
|
||||
controller_element = _doc.createElement( "connection" );
|
||||
_this.appendChild( controller_element );
|
||||
}
|
||||
QDomElement element = _doc.createElement( paramStr );
|
||||
m_controllerConnection->saveSettings( _doc, element );
|
||||
controller_element.appendChild( element );
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -240,13 +329,10 @@ PluginView * vestigeInstrument::instantiateView( QWidget * _parent )
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
|
||||
QWidget * _parent ) :
|
||||
InstrumentView( _instrument, _parent )
|
||||
InstrumentView( _instrument, _parent ),
|
||||
lastPosInMenu (0)
|
||||
{
|
||||
if( s_artwork == NULL )
|
||||
{
|
||||
@@ -271,8 +357,108 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
|
||||
"clicking on this button, a file-open-dialog appears "
|
||||
"and you can select your file." ) );
|
||||
|
||||
m_managePluginButton = new pixmapButton( this, "" );
|
||||
m_managePluginButton->setCheckable( false );
|
||||
m_managePluginButton->setCursor( Qt::PointingHandCursor );
|
||||
m_managePluginButton->move( 220, 102 );
|
||||
m_managePluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"track_op_menu", 20, 20 ) );
|
||||
m_managePluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"track_op_menu", 20, 20 ) );
|
||||
connect( m_managePluginButton, SIGNAL( clicked() ), this,
|
||||
SLOT( managePlugin() ) );
|
||||
toolTip::add( m_managePluginButton, tr( "Control VST-plugin from LMMS host" ) );
|
||||
|
||||
m_managePluginButton->setWhatsThis(
|
||||
tr( "Click here, if you want to control VST-plugin from host." ) );
|
||||
|
||||
|
||||
m_openPresetButton = new pixmapButton( this, "" );
|
||||
m_openPresetButton->setCheckable( false );
|
||||
m_openPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_openPresetButton->move( 224, 192 );
|
||||
m_openPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-up-press" ) );
|
||||
m_openPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-up" ) );
|
||||
connect( m_openPresetButton, SIGNAL( clicked() ), this,
|
||||
SLOT( openPreset() ) );
|
||||
toolTip::add( m_openPresetButton, tr( "Open VST-plugin preset" ) );
|
||||
|
||||
m_openPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to open another *.fxp, *.fxb VST-plugin preset." ) );
|
||||
|
||||
|
||||
m_rolLPresetButton = new pixmapButton( this, "" );
|
||||
m_rolLPresetButton->setCheckable( false );
|
||||
m_rolLPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_rolLPresetButton->move( 167, 192 );
|
||||
m_rolLPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-left-press" ) );
|
||||
m_rolLPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-left" ) );
|
||||
connect( m_rolLPresetButton, SIGNAL( clicked() ), this,
|
||||
SLOT( rolrPreset() ) );
|
||||
toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) );
|
||||
|
||||
m_rolLPresetButton->setShortcut( Qt::Key_Minus );
|
||||
|
||||
m_rolLPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to switch to another VST-plugin preset program." ) );
|
||||
|
||||
|
||||
m_savePresetButton = new pixmapButton( this, "" );
|
||||
m_savePresetButton->setCheckable( false );
|
||||
m_savePresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_savePresetButton->move( 224, 213 );
|
||||
m_savePresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"project_save", 16, 16 ) );
|
||||
m_savePresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"project_save", 16, 16 ) );
|
||||
connect( m_savePresetButton, SIGNAL( clicked() ), this,
|
||||
SLOT( savePreset() ) );
|
||||
toolTip::add( m_savePresetButton, tr( "Save preset" ) );
|
||||
|
||||
m_savePresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to save current VST-plugin preset program." ) );
|
||||
|
||||
|
||||
m_rolRPresetButton = new pixmapButton( this, "" );
|
||||
m_rolRPresetButton->setCheckable( false );
|
||||
m_rolRPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_rolRPresetButton->move( 186, 192 );
|
||||
m_rolRPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-right-press" ) );
|
||||
m_rolRPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-right" ) );
|
||||
connect( m_rolRPresetButton, SIGNAL( clicked() ), this,
|
||||
SLOT( rollPreset() ) );
|
||||
toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) );
|
||||
|
||||
m_rolRPresetButton->setShortcut( Qt::Key_Plus );
|
||||
|
||||
m_rolRPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to switch to another VST-plugin preset program." ) );
|
||||
|
||||
|
||||
|
||||
m_selPresetButton = new QPushButton( tr( "" ), this );
|
||||
m_selPresetButton->setGeometry( 205, 192, 16, 16 );
|
||||
|
||||
QMenu *menu = new QMenu;
|
||||
|
||||
connect( menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
|
||||
|
||||
|
||||
m_selPresetButton->setIcon( PLUGIN_NAME::getIconPixmap( "stepper-down" ) );
|
||||
m_selPresetButton->setWhatsThis(
|
||||
tr( "Click here to select presets that are currently loaded in VST." ) );
|
||||
|
||||
m_selPresetButton->setMenu(menu);
|
||||
|
||||
|
||||
m_toggleGUIButton = new QPushButton( tr( "Show/hide GUI" ), this );
|
||||
m_toggleGUIButton->setGeometry( 20, 150, 200, 24 );
|
||||
m_toggleGUIButton->setGeometry( 20, 130, 200, 24 );
|
||||
m_toggleGUIButton->setIcon( embed::getIconPixmap( "zoom" ) );
|
||||
m_toggleGUIButton->setFont( pointSize<8>( m_toggleGUIButton->font() ) );
|
||||
connect( m_toggleGUIButton, SIGNAL( clicked() ), this,
|
||||
@@ -283,16 +469,65 @@ VestigeInstrumentView::VestigeInstrumentView( Instrument * _instrument,
|
||||
|
||||
QPushButton * note_off_all_btn = new QPushButton( tr( "Turn off all "
|
||||
"notes" ), this );
|
||||
note_off_all_btn->setGeometry( 20, 180, 200, 24 );
|
||||
note_off_all_btn->setGeometry( 20, 160, 200, 24 );
|
||||
note_off_all_btn->setIcon( embed::getIconPixmap( "state_stop" ) );
|
||||
note_off_all_btn->setFont( pointSize<8>( note_off_all_btn->font() ) );
|
||||
connect( note_off_all_btn, SIGNAL( clicked() ), this,
|
||||
SLOT( noteOffAll() ) );
|
||||
|
||||
setAcceptDrops( true );
|
||||
_instrument2 = _instrument;
|
||||
_parent2 = _parent;
|
||||
}
|
||||
|
||||
|
||||
void VestigeInstrumentView::managePlugin( void )
|
||||
{
|
||||
if ( m_vi->m_plugin != NULL && m_vi->m_subWindow == NULL ) {
|
||||
m_vi->p_subWindow = new manageVestigeInstrumentView( _instrument2, _parent2, m_vi);
|
||||
} else if (m_vi->m_subWindow != NULL) {
|
||||
if (m_vi->m_subWindow->widget()->isVisible() == FALSE) {
|
||||
m_vi->m_scrollArea->show();
|
||||
m_vi->m_subWindow->show();
|
||||
} else {
|
||||
m_vi->m_scrollArea->hide();
|
||||
m_vi->m_subWindow->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void VestigeInstrumentView::updateMenu( void )
|
||||
{
|
||||
|
||||
// get all presets -
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->loadPrograms( 1 );
|
||||
QWidget::update();
|
||||
|
||||
QString str = m_vi->m_plugin->presetsString();
|
||||
|
||||
QStringList list1 = str.split("|");
|
||||
|
||||
QMenu * to_menu = m_selPresetButton->menu();
|
||||
to_menu->clear();
|
||||
|
||||
QAction *presetActions[list1.size()];
|
||||
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
presetActions[i] = new QAction(this);
|
||||
connect(presetActions[i], SIGNAL(triggered()), this, SLOT(selPreset()));
|
||||
|
||||
presetActions[i]->setText(QString("%1. %2").arg(QString::number(i+1), list1.at(i)));
|
||||
presetActions[i]->setData(i);
|
||||
if (i == lastPosInMenu) {
|
||||
presetActions[i]->setIcon(embed::getIconPixmap( "sample_file", 16, 16 ));
|
||||
} else presetActions[i]->setIcon(embed::getIconPixmap( "edit_copy", 16, 16 ));
|
||||
to_menu->addAction( presetActions[i] );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
VestigeInstrumentView::~VestigeInstrumentView()
|
||||
@@ -302,7 +537,7 @@ VestigeInstrumentView::~VestigeInstrumentView()
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::modelChanged( void )
|
||||
void VestigeInstrumentView::modelChanged()
|
||||
{
|
||||
m_vi = castModel<vestigeInstrument>();
|
||||
}
|
||||
@@ -310,7 +545,7 @@ void VestigeInstrumentView::modelChanged( void )
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::openPlugin( void )
|
||||
void VestigeInstrumentView::openPlugin()
|
||||
{
|
||||
QFileDialog ofd( NULL, tr( "Open VST-plugin" ) );
|
||||
|
||||
@@ -346,6 +581,12 @@ void VestigeInstrumentView::openPlugin( void )
|
||||
return;
|
||||
}
|
||||
engine::getMixer()->lock();
|
||||
|
||||
if (m_vi->p_subWindow != NULL) {
|
||||
delete m_vi->p_subWindow;
|
||||
m_vi->p_subWindow = NULL;
|
||||
}
|
||||
|
||||
m_vi->loadFile( ofd.selectedFiles()[0] );
|
||||
engine::getMixer()->unlock();
|
||||
if( m_vi->m_plugin && m_vi->m_plugin->pluginWidget() )
|
||||
@@ -359,6 +600,87 @@ void VestigeInstrumentView::openPlugin( void )
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::openPreset( void )
|
||||
{
|
||||
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->openPreset( );
|
||||
bool converted;
|
||||
QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
QWidget::update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::savePreset( void )
|
||||
{
|
||||
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->savePreset( );
|
||||
/* bool converted;
|
||||
QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
QWidget::update();*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::rollPreset( void )
|
||||
{
|
||||
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->rollPreset( 1 );
|
||||
bool converted;
|
||||
QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::rolrPreset( void )
|
||||
{
|
||||
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->rollPreset( -1 );
|
||||
bool converted;
|
||||
QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::selPreset( void )
|
||||
{
|
||||
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
if (action)
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
lastPosInMenu = action->data().toInt();
|
||||
m_vi->m_plugin->rollPreset( action->data().toInt() + 2 );
|
||||
QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VestigeInstrumentView::toggleGUI( void )
|
||||
{
|
||||
QMutexLocker ml( &m_vi->m_pluginMutex );
|
||||
@@ -458,6 +780,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
|
||||
p.setPen( QColor( 32, 160, 54 ) );
|
||||
|
||||
p.drawText( 10, 100, plugin_name );
|
||||
p.drawText( 10, 211, tr( "Preset" ) );
|
||||
|
||||
// m_pluginMutex.lock();
|
||||
if( m_vi->m_plugin != NULL )
|
||||
@@ -467,6 +790,7 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
|
||||
p.setFont( pointSize<8>( f ) );
|
||||
p.drawText( 10, 114, tr( "by" ) + " " +
|
||||
m_vi->m_plugin->vendorString() );
|
||||
p.drawText( 10, 225, m_vi->m_plugin->presetString() );
|
||||
}
|
||||
// m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -474,6 +798,196 @@ void VestigeInstrumentView::paintEvent( QPaintEvent * )
|
||||
|
||||
|
||||
|
||||
manageVestigeInstrumentView::manageVestigeInstrumentView( Instrument * _instrument,
|
||||
QWidget * _parent, vestigeInstrument * m_vi2 ) :
|
||||
InstrumentView( _instrument, _parent )
|
||||
{
|
||||
m_vi = m_vi2;
|
||||
m_vi->m_scrollArea = new QScrollArea( this );
|
||||
widget = new QWidget(this);
|
||||
l = new QGridLayout( this );
|
||||
|
||||
m_vi->m_subWindow = engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||
m_vi->m_subWindow->setFixedSize( 960, 300);
|
||||
m_vi->m_subWindow->setWidget(m_vi->m_scrollArea);
|
||||
m_vi->m_subWindow->setWindowTitle(m_vi->m_plugin->name());
|
||||
m_vi->m_subWindow->setWindowIcon( PLUGIN_NAME::getIconPixmap( "logo" ) );
|
||||
//m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
|
||||
l->setContentsMargins( 20, 10, 10, 10 );
|
||||
l->setVerticalSpacing( 10 );
|
||||
l->setHorizontalSpacing( 23 );
|
||||
|
||||
m_syncButton = new QPushButton( tr( "VST Sync" ), this );
|
||||
connect( m_syncButton, SIGNAL( clicked() ), this,
|
||||
SLOT( syncPlugin() ) );
|
||||
m_syncButton->setWhatsThis(
|
||||
tr( "Click here if you want to synchronize all parameters with VST plugin." ) );
|
||||
|
||||
l->addWidget( m_syncButton, 0, 0, 1, 2, Qt::AlignLeft );
|
||||
|
||||
const QMap<QString, QString> & dump = m_vi->m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
|
||||
bool isVstKnobs = true;
|
||||
|
||||
if (m_vi->vstKnobs == NULL) {
|
||||
m_vi->vstKnobs = new knob *[paramCount];
|
||||
isVstKnobs = false;
|
||||
}
|
||||
if (m_vi->knobFModel == NULL) {
|
||||
m_vi->knobFModel = new FloatModel *[paramCount];
|
||||
}
|
||||
|
||||
char paramStr[35];
|
||||
QStringList list1;
|
||||
|
||||
if (isVstKnobs == false) {
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
|
||||
m_vi->vstKnobs[i] = new knob( knobBright_26, this );
|
||||
m_vi->vstKnobs[i]->setHintText( list1.at(1) + ":", "");
|
||||
m_vi->vstKnobs[i]->setLabel( list1.at(1).left(15) );
|
||||
|
||||
sprintf( paramStr, "%d", i);
|
||||
m_vi->knobFModel[i] = new FloatModel( (list1.at(2)).toFloat(), 0.0f, 1.0f, 0.01f,
|
||||
castModel<vestigeInstrument>(), tr( paramStr ) );
|
||||
connect( m_vi->knobFModel[i], SIGNAL( dataChanged() ), this, SLOT( setParameter() ) );
|
||||
m_vi->vstKnobs[i] ->setModel( m_vi->knobFModel[i] );
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (int lrow = 0+1; lrow < (int(paramCount / 10) + 1)+1; lrow++) {
|
||||
for (int lcolumn = 0; lcolumn < 10; lcolumn++) {
|
||||
if (i < paramCount)
|
||||
l->addWidget( m_vi->vstKnobs[i], lrow, lcolumn, Qt::AlignCenter );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
l->setRowStretch( (int(paramCount / 10) + 1), 1 );
|
||||
l->setColumnStretch( 10, 1 );
|
||||
|
||||
widget->setLayout(l);
|
||||
widget->setAutoFillBackground(true);
|
||||
|
||||
m_vi->m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||
m_vi->m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_vi->m_scrollArea->setPalette( QApplication::palette( m_vi->m_scrollArea ) );
|
||||
m_vi->m_scrollArea->setMinimumHeight( 64 );
|
||||
|
||||
m_vi->m_scrollArea->setWidget( widget );
|
||||
|
||||
m_vi->m_subWindow->show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVestigeInstrumentView::syncPlugin( void )
|
||||
{
|
||||
char paramStr[35];
|
||||
QStringList list1;
|
||||
const QMap<QString, QString> & dump = m_vi->m_plugin->parameterDump();
|
||||
float f;
|
||||
|
||||
for (int i = 0; i<(dump).size(); i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
f = (list1.at(2)).toFloat();
|
||||
m_vi->knobFModel[i]->setValue(f);
|
||||
m_vi->knobFModel[i]->setInitValue(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
manageVestigeInstrumentView::~manageVestigeInstrumentView()
|
||||
{
|
||||
if (m_vi->vstKnobs != NULL) {
|
||||
delete []m_vi->vstKnobs;
|
||||
m_vi->vstKnobs = NULL;
|
||||
}
|
||||
|
||||
if (m_vi->m_scrollArea != NULL) {
|
||||
delete m_vi->m_scrollArea;
|
||||
m_vi->m_scrollArea = NULL;
|
||||
}
|
||||
|
||||
if ( m_vi->m_subWindow != NULL ) {
|
||||
m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
m_vi->m_subWindow->close();
|
||||
|
||||
if ( m_vi->m_subWindow != NULL )
|
||||
delete m_vi->m_subWindow;
|
||||
m_vi->m_subWindow = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVestigeInstrumentView::setParameter( void )
|
||||
{
|
||||
|
||||
Model *action = qobject_cast<Model *>(sender());
|
||||
int knobUNID = action->displayName().toInt();
|
||||
|
||||
if ( m_vi->m_plugin != NULL ) {
|
||||
m_vi->m_plugin->setParam( knobUNID, m_vi->knobFModel[knobUNID]->value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void manageVestigeInstrumentView::dragEnterEvent( QDragEnterEvent * _dee )
|
||||
{
|
||||
if( _dee->mimeData()->hasFormat( stringPairDrag::mimeType() ) )
|
||||
{
|
||||
QString txt = _dee->mimeData()->data(
|
||||
stringPairDrag::mimeType() );
|
||||
if( txt.section( ':', 0, 0 ) == "vstplugin" )
|
||||
{
|
||||
_dee->acceptProposedAction();
|
||||
}
|
||||
else
|
||||
{
|
||||
_dee->ignore();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
_dee->ignore();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVestigeInstrumentView::dropEvent( QDropEvent * _de )
|
||||
{
|
||||
QString type = stringPairDrag::decodeKey( _de );
|
||||
QString value = stringPairDrag::decodeValue( _de );
|
||||
if( type == "vstplugin" )
|
||||
{
|
||||
m_vi->loadFile( value );
|
||||
_de->accept();
|
||||
return;
|
||||
}
|
||||
_de->ignore();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVestigeInstrumentView::paintEvent( QPaintEvent * )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* vestige.h - instrument VeSTige for hosting VST-plugins
|
||||
*
|
||||
* Copyright (c) 2005-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2005-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,11 +28,17 @@
|
||||
|
||||
|
||||
#include <QtCore/QMutex>
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMdiSubWindow>
|
||||
#include <QtGui/QScrollArea>
|
||||
|
||||
#include "Instrument.h"
|
||||
#include "InstrumentView.h"
|
||||
#include "midi.h"
|
||||
#include "note.h"
|
||||
#include "knob.h"
|
||||
|
||||
#include "AutomatableModel.h"
|
||||
|
||||
|
||||
class QPixmap;
|
||||
@@ -68,6 +74,8 @@ public:
|
||||
|
||||
virtual PluginView * instantiateView( QWidget * _parent );
|
||||
|
||||
protected slots:
|
||||
void setParameter( void );
|
||||
|
||||
private:
|
||||
void closePlugin( void );
|
||||
@@ -79,13 +87,49 @@ private:
|
||||
QMutex m_pluginMutex;
|
||||
|
||||
QString m_pluginDLL;
|
||||
QMdiSubWindow * m_subWindow;
|
||||
QScrollArea * m_scrollArea;
|
||||
knob ** vstKnobs;
|
||||
FloatModel ** knobFModel;
|
||||
QObject * p_subWindow;
|
||||
|
||||
|
||||
friend class VestigeInstrumentView;
|
||||
friend class manageVestigeInstrumentView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
class manageVestigeInstrumentView : public InstrumentView
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
manageVestigeInstrumentView( Instrument * _instrument, QWidget * _parent, vestigeInstrument * m_vi2 );
|
||||
virtual ~manageVestigeInstrumentView();
|
||||
|
||||
|
||||
protected slots:
|
||||
void syncPlugin( void );
|
||||
void setParameter( void );
|
||||
|
||||
|
||||
protected:
|
||||
virtual void dragEnterEvent( QDragEnterEvent * _dee );
|
||||
virtual void dropEvent( QDropEvent * _de );
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
|
||||
private:
|
||||
static QPixmap * s_artwork;
|
||||
|
||||
vestigeInstrument * m_vi;
|
||||
|
||||
QWidget *widget;
|
||||
QGridLayout * l;
|
||||
QPushButton * m_syncButton;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
class VestigeInstrumentView : public InstrumentView
|
||||
{
|
||||
@@ -96,7 +140,14 @@ public:
|
||||
|
||||
|
||||
protected slots:
|
||||
void updateMenu( void );
|
||||
void openPlugin( void );
|
||||
void managePlugin( void );
|
||||
void openPreset( void );
|
||||
void savePreset( void );
|
||||
void rollPreset( void );
|
||||
void rolrPreset( void );
|
||||
void selPreset( void );
|
||||
void toggleGUI( void );
|
||||
void noteOffAll( void );
|
||||
|
||||
@@ -114,8 +165,19 @@ private:
|
||||
|
||||
vestigeInstrument * m_vi;
|
||||
|
||||
int lastPosInMenu;
|
||||
|
||||
pixmapButton * m_openPluginButton;
|
||||
pixmapButton * m_openPresetButton;
|
||||
pixmapButton * m_rolLPresetButton;
|
||||
pixmapButton * m_rolRPresetButton;
|
||||
QPushButton * m_selPresetButton;
|
||||
QPushButton * m_toggleGUIButton;
|
||||
pixmapButton * m_managePluginButton;
|
||||
pixmapButton * m_savePresetButton;
|
||||
|
||||
Instrument * _instrument2;
|
||||
QWidget * _parent2;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ INCLUDE(BuildPlugin)
|
||||
|
||||
IF(LMMS_BUILD_WIN32)
|
||||
ADD_DEFINITIONS(-DPTW32_STATIC_LIB)
|
||||
LINK_LIBRARIES(-lQtCore4 -lpthread -lgdi32 -lws2_32)
|
||||
ADD_EXECUTABLE(RemoteVstPlugin ${CMAKE_CURRENT_SOURCE_DIR}/RemoteVstPlugin.cpp)
|
||||
TARGET_LINK_LIBRARIES(RemoteVstPlugin -lQtCore4 -lpthread -lgdi32 -lws2_32)
|
||||
ADD_CUSTOM_COMMAND(TARGET RemoteVstPlugin POST_BUILD COMMAND ${STRIP} ${CMAKE_CURRENT_BINARY_DIR}/RemoteVstPlugin.exe)
|
||||
INSTALL(TARGETS RemoteVstPlugin RUNTIME DESTINATION ${PLUGIN_DIR})
|
||||
|
||||
|
||||
@@ -163,6 +163,9 @@ public:
|
||||
// determine product-string of plugin
|
||||
const char * pluginProductString();
|
||||
|
||||
// determine name of plugipn preset
|
||||
const char * presetName();
|
||||
|
||||
// do a complete parameter-dump and post it
|
||||
void getParameterDump();
|
||||
|
||||
@@ -178,6 +181,18 @@ public:
|
||||
// restore settings chunk of plugin from file
|
||||
void loadChunkFromFile( const std::string & _file, int _len );
|
||||
|
||||
// restore settings chunk of plugin from file
|
||||
void loadChunkFromPresetFile( const std::string & _file );
|
||||
|
||||
// restore settings chunk of plugin from file
|
||||
void rotateProgram( int _len );
|
||||
|
||||
// Load names VST of presets/programs
|
||||
void loadPrograms( int _len );
|
||||
|
||||
// Save presets/programs
|
||||
void savePreset( const std::string & _file );
|
||||
|
||||
// number of inputs
|
||||
virtual int inputCount() const
|
||||
{
|
||||
@@ -386,6 +401,33 @@ bool RemoteVstPlugin::processMessage( const message & _m )
|
||||
sendMessage( IdLoadSettingsFromFile );
|
||||
break;
|
||||
|
||||
case IdLoadChunkFromPresetFile:
|
||||
loadChunkFromPresetFile( _m.getString( 0 ) );
|
||||
sendMessage( IdLoadChunkFromPresetFile );
|
||||
break;
|
||||
|
||||
case IdRotateProgram:
|
||||
rotateProgram( _m.getInt( 0 ) );
|
||||
sendMessage( IdRotateProgram );
|
||||
break;
|
||||
|
||||
case IdLoadPrograms:
|
||||
loadPrograms( _m.getInt( 0 ) );
|
||||
sendMessage( IdLoadPrograms );
|
||||
break;
|
||||
|
||||
case IdSavePreset:
|
||||
savePreset( _m.getString( 0 ) );
|
||||
sendMessage( IdSavePreset );
|
||||
break;
|
||||
|
||||
case IdSetParameter:
|
||||
m_plugin->setParameter( m_plugin, _m.getInt( 0 ), _m.getFloat( 1 ) );
|
||||
sendMessage( IdSetParameter );
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
return RemotePluginClient::processMessage( _m );
|
||||
}
|
||||
@@ -726,19 +768,34 @@ const char * RemoteVstPlugin::pluginProductString()
|
||||
|
||||
|
||||
|
||||
const char * RemoteVstPlugin::presetName()
|
||||
{
|
||||
static char buf[32];
|
||||
buf[0] = 0;
|
||||
|
||||
m_plugin->dispatcher(m_plugin, effGetProgramName, 0, 0, buf, 0);
|
||||
|
||||
buf[31] = 0;
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void RemoteVstPlugin::getParameterDump()
|
||||
{
|
||||
VstParameterProperties vst_props;
|
||||
message m( IdVstParameterDump );
|
||||
m.addInt( m_plugin->numParams );
|
||||
for( int i = 0; i < m_plugin->numParams; ++i )
|
||||
{
|
||||
pluginDispatch( effGetParameterProperties, i, 0, &vst_props );
|
||||
m.addInt( i );
|
||||
m.addString( vst_props.shortLabel );
|
||||
m.addFloat( m_plugin->getParameter( m_plugin, i ) );
|
||||
}
|
||||
sendMessage( m );
|
||||
char curPresName[30];
|
||||
//VstParameterProperties vst_props;
|
||||
message m( IdVstParameterDump );
|
||||
m.addInt( m_plugin->numParams );
|
||||
for( int i = 0; i < m_plugin->numParams; ++i )
|
||||
{
|
||||
//pluginDispatch( effGetParameterProperties, i, 0, &vst_props );
|
||||
m_plugin->dispatcher(m_plugin, effGetParamName, i, 0, curPresName, 0);
|
||||
m.addInt( i );
|
||||
m.addString( /*vst_props.shortLabel*/curPresName );
|
||||
m.addFloat( m_plugin->getParameter( m_plugin, i ) );
|
||||
}
|
||||
sendMessage( m );
|
||||
}
|
||||
|
||||
|
||||
@@ -812,6 +869,257 @@ void RemoteVstPlugin::saveChunkToFile( const std::string & _file )
|
||||
|
||||
|
||||
|
||||
void RemoteVstPlugin::rotateProgram( int _len )
|
||||
{
|
||||
int currProgram;
|
||||
if (isInitialized() == false) return;
|
||||
if (_len <= 1) {
|
||||
currProgram = m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, 0, 0) + _len;
|
||||
if (currProgram >= m_plugin->numPrograms) currProgram = m_plugin->numPrograms - 1;
|
||||
if (currProgram < 0) currProgram = 0;
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, currProgram++, 0, 0);
|
||||
} else {
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, _len - 2, 0, 0);
|
||||
currProgram = _len - 1;
|
||||
}
|
||||
|
||||
char presName[30];
|
||||
sprintf( presName, " %d/%d: %s", currProgram, m_plugin->numPrograms, presetName() );
|
||||
|
||||
sendMessage( message( IdVstPluginPresetString ).addString( presName ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void RemoteVstPlugin::loadPrograms( int _len )
|
||||
{
|
||||
char presName[1024+256*30];
|
||||
char curProgName[30];
|
||||
if (isInitialized() == false) return;
|
||||
bool progNameIndexed = (m_plugin->dispatcher(m_plugin, 29, 0, -1, curProgName, 0) == 1);
|
||||
|
||||
if (m_plugin->numPrograms > 1) {
|
||||
if (progNameIndexed) {
|
||||
for (int i = 0; i< (m_plugin->numPrograms >= 256?256:m_plugin->numPrograms); i++) {
|
||||
m_plugin->dispatcher(m_plugin, 29, i, -1, curProgName, 0);
|
||||
if (i == 0) sprintf( presName, "%s", curProgName );
|
||||
else sprintf( presName + strlen(presName), "|%s", curProgName );
|
||||
}
|
||||
} else {
|
||||
int currProgram = m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, 0, 0);
|
||||
for (int i = 0; i< (m_plugin->numPrograms >= 256?256:m_plugin->numPrograms); i++) {
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, i, 0, 0);
|
||||
if (i == 0) sprintf( presName, "%s", presetName() );
|
||||
else sprintf( presName + strlen(presName), "|%s", presetName() );
|
||||
}
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, currProgram, 0, 0);
|
||||
}
|
||||
} else sprintf( presName, "%s", presetName() );
|
||||
|
||||
sendMessage( message( IdVstPluginPresetsString ).addString( presName ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inline unsigned int endian_swap(unsigned int& x)
|
||||
{
|
||||
return (x>>24) | ((x<<8) & 0x00FF0000) | ((x>>8) & 0x0000FF00) | (x<<24);
|
||||
}
|
||||
|
||||
struct sBank
|
||||
{
|
||||
unsigned int chunkMagic;
|
||||
unsigned int byteSize;
|
||||
unsigned int fxMagic;
|
||||
unsigned int version;
|
||||
unsigned int fxID;
|
||||
unsigned int fxVersion;
|
||||
unsigned int numPrograms;
|
||||
char prgName[28];
|
||||
};
|
||||
|
||||
void RemoteVstPlugin::savePreset( const std::string & _file )
|
||||
{
|
||||
unsigned int chunk_size = 0;
|
||||
sBank * pBank = ( sBank* ) new char[ sizeof( sBank ) ];
|
||||
char progName[ 128 ] = { 0 };
|
||||
char* data = NULL;
|
||||
const bool chunky = ( m_plugin->flags & ( 1 << 5 ) ) != 0;
|
||||
bool isPreset = _file.substr( _file.find_last_of( "." ) + 1 ) == "fxp";
|
||||
int presNameLen = _file.find_last_of( "/" ) + _file.find_last_of( "\\" ) + 2;
|
||||
|
||||
if (isPreset) {
|
||||
for (int i = 0; i < _file.length() - 4 - presNameLen; i++)
|
||||
progName[i] = i < 23 ? _file[presNameLen + i] : 0;
|
||||
m_plugin->dispatcher(m_plugin, 4, 0, 0, progName, 0);
|
||||
} // m_plugin->dispatcher( m_plugin, effGetProgramName, 0, 0, progName, 0.0f );
|
||||
if ( chunky )
|
||||
chunk_size = m_plugin->dispatcher( m_plugin, 23, isPreset, 0, &data, false );
|
||||
else {
|
||||
if (isPreset) {
|
||||
chunk_size = m_plugin->numParams * sizeof( float );
|
||||
data = new char[ chunk_size ];
|
||||
unsigned int* toUIntArray = reinterpret_cast<unsigned int*>( data );
|
||||
for ( int i = 0; i < m_plugin->numParams; i++ )
|
||||
{
|
||||
float value = m_plugin->getParameter( m_plugin, i );
|
||||
unsigned int * pValue = ( unsigned int * ) &value;
|
||||
toUIntArray[ i ] = endian_swap( *pValue );
|
||||
}
|
||||
} else chunk_size = (((m_plugin->numParams * sizeof( float )) + 56)*m_plugin->numPrograms);
|
||||
}
|
||||
|
||||
pBank->chunkMagic = 0x4B6E6343;
|
||||
pBank->byteSize = chunk_size + ( chunky ? sizeof( int ) : 0 ) + 48;
|
||||
if (!isPreset) pBank->byteSize += 100;
|
||||
pBank->byteSize = endian_swap( pBank->byteSize );
|
||||
pBank->fxMagic = chunky ? 0x68435046 : 0x6B437846;
|
||||
if (!isPreset && chunky) pBank->fxMagic = 0x68434246;
|
||||
if (!isPreset &&!chunky) pBank->fxMagic = 0x6B427846;
|
||||
|
||||
pBank->version = 0x01000000;
|
||||
unsigned int uIntToFile = (unsigned int) m_plugin->uniqueID;
|
||||
pBank->fxID = endian_swap( uIntToFile );
|
||||
uIntToFile = (unsigned int) pluginVersion();
|
||||
pBank->fxVersion = endian_swap( uIntToFile );
|
||||
uIntToFile = (unsigned int) chunky ? m_plugin->numPrograms : m_plugin->numParams;
|
||||
if (!isPreset &&!chunky) uIntToFile = (unsigned int) m_plugin->numPrograms;
|
||||
pBank->numPrograms = endian_swap( uIntToFile );
|
||||
|
||||
FILE * stream = fopen( _file.c_str(), "w" );
|
||||
fwrite ( pBank, 1, 28, stream );
|
||||
fwrite ( progName, 1, isPreset ? 28 : 128, stream );
|
||||
if ( chunky ) {
|
||||
uIntToFile = endian_swap( chunk_size );
|
||||
fwrite ( &uIntToFile, 1, 4, stream );
|
||||
}
|
||||
if (pBank->fxMagic != 0x6B427846 )
|
||||
fwrite ( data, 1, chunk_size, stream );
|
||||
else {
|
||||
int numPrograms = m_plugin->numPrograms;
|
||||
int currProgram = m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, 0, 0);
|
||||
chunk_size = (m_plugin->numParams * sizeof( float ));
|
||||
pBank->byteSize = chunk_size + 48;
|
||||
pBank->byteSize = endian_swap( pBank->byteSize );
|
||||
pBank->fxMagic = 0x6B437846;
|
||||
uIntToFile = (unsigned int) m_plugin->numParams;
|
||||
pBank->numPrograms = endian_swap( uIntToFile );
|
||||
data = new char[ chunk_size ];
|
||||
unsigned int* pValue,* toUIntArray = reinterpret_cast<unsigned int*>( data );
|
||||
float value;
|
||||
for (int j = 0; j < numPrograms; j++) {
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, j, 0, 0);
|
||||
m_plugin->dispatcher(m_plugin, effGetProgramName, 0, 0, pBank->prgName, 0);
|
||||
fwrite ( pBank, 1, 56, stream );
|
||||
for ( int i = 0; i < m_plugin->numParams; i++ )
|
||||
{
|
||||
value = m_plugin->getParameter( m_plugin, i );
|
||||
pValue = ( unsigned int * ) &value;
|
||||
toUIntArray[ i ] = endian_swap( *pValue );
|
||||
}
|
||||
fwrite ( data, 1, chunk_size, stream );
|
||||
}
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, currProgram, 0, 0);
|
||||
}
|
||||
fclose( stream );
|
||||
|
||||
if ( !chunky )
|
||||
delete[] data;
|
||||
delete[] (sBank*)pBank;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void RemoteVstPlugin::loadChunkFromPresetFile( const std::string & _file )
|
||||
{
|
||||
void * chunk = NULL;
|
||||
unsigned int * pLen = new unsigned int[ 1 ];
|
||||
unsigned int len = 0;
|
||||
sBank * pBank = (sBank*) new char[ sizeof( sBank ) ];
|
||||
FILE * stream = fopen( _file.c_str(), "r" );
|
||||
fread ( pBank, 1, 56, stream );
|
||||
pBank->fxID = endian_swap( pBank->fxID );
|
||||
pBank->numPrograms = endian_swap( pBank->numPrograms );
|
||||
unsigned int toUInt;
|
||||
float * pFloat;
|
||||
|
||||
if (m_plugin->uniqueID != pBank->fxID) {
|
||||
sendMessage( message( IdVstPluginPresetString ).
|
||||
addString( "Error: Plugin UniqID not match" ) );
|
||||
fclose( stream );
|
||||
delete[] (unsigned int*)pLen;
|
||||
delete[] (sBank*)pBank;
|
||||
return;
|
||||
}
|
||||
|
||||
if( _file.substr( _file.find_last_of( "." ) + 1 ) != "fxp" )
|
||||
fseek ( stream , 156 , SEEK_SET );
|
||||
|
||||
if(pBank->fxMagic != 0x6B427846) {
|
||||
if(pBank->fxMagic != 0x6B437846) {
|
||||
fread (pLen, 1, 4, stream);
|
||||
chunk = new char[len = endian_swap(*pLen)];
|
||||
} else chunk = new char[len = sizeof(float)*pBank->numPrograms];
|
||||
fread (chunk, len, 1, stream);
|
||||
fclose( stream );
|
||||
}
|
||||
|
||||
if(_file.substr(_file.find_last_of(".") + 1) == "fxp") {
|
||||
pBank->prgName[23] = 0;
|
||||
m_plugin->dispatcher(m_plugin, 4, 0, 0, pBank->prgName, 0);
|
||||
if(pBank->fxMagic != 0x6B437846)
|
||||
m_plugin->dispatcher(m_plugin, 24, 1, len, chunk, 0);
|
||||
else {
|
||||
unsigned int* toUIntArray = reinterpret_cast<unsigned int*>( chunk );
|
||||
for (int i = 0; i < pBank->numPrograms; i++ ) {
|
||||
toUInt = endian_swap( toUIntArray[ i ] );
|
||||
pFloat = ( float* ) &toUInt;
|
||||
m_plugin->setParameter( m_plugin, i, *pFloat );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(pBank->fxMagic != 0x6B427846) {
|
||||
m_plugin->dispatcher(m_plugin, 24, 0, len, chunk, 0);
|
||||
} else {
|
||||
int numPrograms = pBank->numPrograms;
|
||||
unsigned int * toUIntArray;
|
||||
int currProgram = m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, 0, 0);
|
||||
chunk = new char[ len = sizeof(float)*m_plugin->numParams ];
|
||||
toUIntArray = reinterpret_cast<unsigned int *>( chunk );
|
||||
for (int i =0; i < numPrograms; i++) {
|
||||
fread (pBank, 1, 56, stream);
|
||||
fread (chunk, len, 1, stream);
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, i, 0, 0);
|
||||
pBank->prgName[23] = 0;
|
||||
m_plugin->dispatcher(m_plugin, 4, 0, 0, pBank->prgName, 0);
|
||||
for (int j = 0; j < m_plugin->numParams; j++ ) {
|
||||
toUInt = endian_swap( toUIntArray[ j ] );
|
||||
pFloat = ( float* ) &toUInt;
|
||||
m_plugin->setParameter( m_plugin, j, *pFloat );
|
||||
}
|
||||
}
|
||||
m_plugin->dispatcher(m_plugin, effSetProgram, 0, currProgram, 0, 0);
|
||||
fclose( stream );
|
||||
}
|
||||
}
|
||||
char presName[30];
|
||||
int currProgram = m_plugin->dispatcher(m_plugin, effGetProgram, 0, 0, 0, 0) + 1;
|
||||
sprintf( presName, " %d/%d: %s", currProgram, m_plugin->numPrograms, presetName() );
|
||||
|
||||
sendMessage( message( IdVstPluginPresetString ).addString( presName ) );
|
||||
|
||||
delete[] (unsigned int*)pLen;
|
||||
delete[] (sBank*)pBank;
|
||||
delete[] (char*)chunk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void RemoteVstPlugin::loadChunkFromFile( const std::string & _file, int _len )
|
||||
{
|
||||
char * buf = NULL;
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "VstPlugin.h"
|
||||
|
||||
#include <QtGui/QFileDialog>
|
||||
#include <QtCore/QDir>
|
||||
#include <QtCore/QFileInfo>
|
||||
#include <QtCore/QLocale>
|
||||
@@ -86,7 +87,10 @@ VstPlugin::VstPlugin( const QString & _plugin ) :
|
||||
m_name(),
|
||||
m_version( 0 ),
|
||||
m_vendorString(),
|
||||
m_productString()
|
||||
m_productString(),
|
||||
m_presetString(),
|
||||
m_presetsString(),
|
||||
p_name()
|
||||
{
|
||||
setSplittedChannels( true );
|
||||
|
||||
@@ -402,6 +406,14 @@ bool VstPlugin::processMessage( const message & _m )
|
||||
m_productString = _m.getQString();
|
||||
break;
|
||||
|
||||
case IdVstPluginPresetString:
|
||||
m_presetString = _m.getQString();
|
||||
break;
|
||||
|
||||
case IdVstPluginPresetsString:
|
||||
m_presetsString = _m.getQString();
|
||||
break;
|
||||
|
||||
case IdVstPluginUniqueID:
|
||||
// TODO: display graphically in case of failure
|
||||
printf("unique ID: %s\n", _m.getString().c_str() );
|
||||
@@ -420,7 +432,7 @@ bool VstPlugin::processMessage( const message & _m )
|
||||
item.value = _m.getFloat( ++p );
|
||||
m_parameterDump["param" + QString::number( item.index )] =
|
||||
QString::number( item.index ) + ":" +
|
||||
// QString( item.shortLabel ) + ":" +
|
||||
/*uncomented*/ /*QString( item.shortLabel )*/ QString::fromStdString(item.shortLabel) + ":" +
|
||||
QString::number( item.value );
|
||||
}
|
||||
break;
|
||||
@@ -435,6 +447,102 @@ bool VstPlugin::processMessage( const message & _m )
|
||||
|
||||
|
||||
|
||||
void VstPlugin::openPreset( )
|
||||
{
|
||||
|
||||
QFileDialog ofd( NULL, tr( "Open Preset" ), "",
|
||||
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
|
||||
ofd.setFileMode( QFileDialog::ExistingFiles );
|
||||
if( ofd.exec () == QDialog::Accepted &&
|
||||
!ofd.selectedFiles().isEmpty() )
|
||||
{
|
||||
lock();
|
||||
sendMessage( message( IdLoadChunkFromPresetFile ).
|
||||
addString(
|
||||
QSTR_TO_STDSTR(
|
||||
QDir::toNativeSeparators( ofd.selectedFiles()[0] ) ) )
|
||||
);
|
||||
waitForMessage( IdLoadChunkFromPresetFile );
|
||||
unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstPlugin::rollPreset( int step )
|
||||
{
|
||||
lock();
|
||||
sendMessage( message( IdRotateProgram ).
|
||||
addInt( step ) );
|
||||
waitForMessage( IdRotateProgram );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstPlugin::loadPrograms( int step )
|
||||
{
|
||||
lock();
|
||||
sendMessage( message( IdLoadPrograms ).
|
||||
addInt( step ) );
|
||||
waitForMessage( IdLoadPrograms );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstPlugin::savePreset( )
|
||||
{
|
||||
QString presName = this->presetString() == "" ? tr(": default"): this->presetString();
|
||||
presName.replace(tr("\""), tr("'")); // QFileDialog unable to handle double quotes properly
|
||||
|
||||
QFileDialog sfd( NULL, tr( "Save Preset" ), presName.section(": ", 1, 1) + tr(".fxp"),
|
||||
tr( "Vst Plugin Preset (*.fxp *.fxb)" ) );
|
||||
|
||||
if( p_name != "" ) // remember last directory
|
||||
{
|
||||
sfd.setDirectory( QFileInfo( p_name ).absolutePath() );
|
||||
}
|
||||
|
||||
sfd.setAcceptMode( QFileDialog::AcceptSave );
|
||||
sfd.setFileMode( QFileDialog::AnyFile );
|
||||
if( sfd.exec () == QDialog::Accepted &&
|
||||
!sfd.selectedFiles().isEmpty() && sfd.selectedFiles()[0] != "" )
|
||||
{
|
||||
QString fns = sfd.selectedFiles()[0];
|
||||
p_name = fns;
|
||||
|
||||
if ((fns.toUpper().indexOf(tr(".FXP")) == -1) && (fns.toUpper().indexOf(tr(".FXB")) == -1))
|
||||
fns = fns + tr(".fxb");
|
||||
else fns = fns.left(fns.length() - 4) + (fns.right( 4 )).toLower();
|
||||
lock();
|
||||
sendMessage( message( IdSavePreset ).
|
||||
addString(
|
||||
QSTR_TO_STDSTR(
|
||||
QDir::toNativeSeparators( fns ) ) )
|
||||
);
|
||||
waitForMessage( IdSavePreset );
|
||||
unlock();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstPlugin::setParam( int i, float f )
|
||||
{
|
||||
lock();
|
||||
sendMessage( message( IdSetParameter ).addInt( i ).addFloat( f ) );
|
||||
waitForMessage( IdSetParameter );
|
||||
unlock();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstPlugin::loadChunk( const QByteArray & _chunk )
|
||||
{
|
||||
QTemporaryFile tf;
|
||||
|
||||
@@ -75,6 +75,16 @@ public:
|
||||
return m_productString;
|
||||
}
|
||||
|
||||
inline const QString & presetString() const
|
||||
{
|
||||
return m_presetString;
|
||||
}
|
||||
|
||||
inline const QString & presetsString() const
|
||||
{
|
||||
return m_presetsString;
|
||||
}
|
||||
|
||||
const QMap<QString, QString> & parameterDump();
|
||||
void setParameterDump( const QMap<QString, QString> & _pdump );
|
||||
|
||||
@@ -103,6 +113,11 @@ public:
|
||||
public slots:
|
||||
void setTempo( bpm_t _bpm );
|
||||
void updateSampleRate();
|
||||
void openPreset( void );
|
||||
void rollPreset( int step );
|
||||
void loadPrograms( int step );
|
||||
void savePreset( void );
|
||||
void setParam( int i, float f );
|
||||
|
||||
|
||||
private:
|
||||
@@ -120,6 +135,10 @@ private:
|
||||
Sint32 m_version;
|
||||
QString m_vendorString;
|
||||
QString m_productString;
|
||||
QString m_presetString;
|
||||
QString m_presetsString;
|
||||
|
||||
QString p_name;
|
||||
|
||||
QMap<QString, QString> m_parameterDump;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include)
|
||||
SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER32}")
|
||||
|
||||
ADD_EXECUTABLE(RemoteVstPlugin32 ${CMAKE_CURRENT_SOURCE_DIR}/../RemoteVstPlugin.cpp)
|
||||
TARGET_LINK_LIBRARIES(RemoteVstPlugin32 -lQtCore4 -lpthread -lgdi32 -lws2_32)
|
||||
|
||||
ADD_CUSTOM_COMMAND(TARGET RemoteVstPlugin32 POST_BUILD COMMAND ${STRIP} ${CMAKE_CURRENT_BINARY_DIR}/RemoteVstPlugin32.exe)
|
||||
|
||||
|
||||
@@ -74,6 +74,8 @@ enum VstRemoteMessageIDs
|
||||
IdVstPluginVersion,
|
||||
IdVstPluginVendorString,
|
||||
IdVstPluginProductString,
|
||||
IdVstPluginPresetString,
|
||||
IdVstPluginPresetsString,
|
||||
IdVstPluginUniqueID,
|
||||
IdVstParameterCount,
|
||||
IdVstParameterDump,
|
||||
|
||||
@@ -67,6 +67,7 @@ private:
|
||||
|
||||
friend class VstEffectControls;
|
||||
friend class VstEffectControlDialog;
|
||||
friend class manageVSTEffectView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* VstEffectControlDialog.cpp - dialog for displaying VST-effect GUI
|
||||
*
|
||||
* Copyright (c) 2006-2010 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2006-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -24,20 +24,28 @@
|
||||
|
||||
#include <QtGui/QLayout>
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QtGui/QMenu>
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
#include "VstEffectControlDialog.h"
|
||||
#include "VstEffect.h"
|
||||
|
||||
#include "pixmap_button.h"
|
||||
#include "embed.h"
|
||||
#include "tooltip.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QtGui/QPainter>
|
||||
|
||||
|
||||
VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
|
||||
EffectControlDialog( _ctl ),
|
||||
m_pluginWidget( NULL )
|
||||
{
|
||||
QVBoxLayout * l = new QVBoxLayout( this );
|
||||
l->setMargin( 0 );
|
||||
l->setSpacing( 0 );
|
||||
QGridLayout * l = new QGridLayout( this );
|
||||
l->setContentsMargins( 20, 10, 10, 10 );
|
||||
l->setVerticalSpacing( 2 );
|
||||
l->setHorizontalSpacing( 2 );
|
||||
|
||||
#ifdef LMMS_BUILD_LINUX
|
||||
_ctl->m_effect->m_plugin->showEditor();
|
||||
@@ -47,9 +55,151 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
|
||||
setWindowTitle( m_pluginWidget->windowTitle() );
|
||||
QPushButton * btn = new QPushButton( tr( "Show/hide VST FX GUI" ) );
|
||||
btn->setCheckable( true );
|
||||
l->addWidget( btn );
|
||||
l->addWidget( btn, 0, 0, 1, 13, Qt::AlignCenter );
|
||||
connect( btn, SIGNAL( toggled( bool ) ),
|
||||
m_pluginWidget, SLOT( setVisible( bool ) ) );
|
||||
btn->setMinimumWidth( 200 );
|
||||
btn->setMaximumWidth( 200 );
|
||||
btn->setMinimumHeight( 24 );
|
||||
btn->setMaximumHeight( 24 );
|
||||
|
||||
|
||||
m_managePluginButton = new pixmapButton( this, "" );
|
||||
m_managePluginButton->setCheckable( false );
|
||||
m_managePluginButton->setCursor( Qt::PointingHandCursor );
|
||||
m_managePluginButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"track_op_menu" ) );
|
||||
m_managePluginButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"track_op_menu" ) );
|
||||
connect( m_managePluginButton, SIGNAL( clicked() ), _ctl,
|
||||
SLOT( managePlugin() ) );
|
||||
toolTip::add( m_managePluginButton, tr( "Control VST-plugin from LMMS host" ) );
|
||||
|
||||
m_managePluginButton->setWhatsThis(
|
||||
tr( "Click here, if you want to control VST-plugin from host." ) );
|
||||
|
||||
|
||||
m_managePluginButton->setMinimumWidth( 21 );
|
||||
m_managePluginButton->setMaximumWidth( 21 );
|
||||
m_managePluginButton->setMinimumHeight( 21 );
|
||||
m_managePluginButton->setMaximumHeight( 21 );
|
||||
|
||||
|
||||
m_openPresetButton = new pixmapButton( this, "" );
|
||||
m_openPresetButton->setCheckable( false );
|
||||
m_openPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_openPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-up-press" ) );
|
||||
m_openPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-up" ) );
|
||||
connect( m_openPresetButton, SIGNAL( clicked() ), _ctl,
|
||||
SLOT( openPreset() ) );
|
||||
toolTip::add( m_openPresetButton, tr( "Open VST-plugin preset" ) );
|
||||
|
||||
m_openPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to open another *.fxp, *.fxb VST-plugin preset." ) );
|
||||
|
||||
m_openPresetButton->setMinimumWidth( 16 );
|
||||
m_openPresetButton->setMaximumWidth( 16 );
|
||||
m_openPresetButton->setMinimumHeight( 16 );
|
||||
m_openPresetButton->setMaximumHeight( 16 );
|
||||
|
||||
|
||||
m_rolLPresetButton = new pixmapButton( this, "" );
|
||||
m_rolLPresetButton->setCheckable( false );
|
||||
m_rolLPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_rolLPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-left-press" ) );
|
||||
m_rolLPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-left" ) );
|
||||
connect( m_rolLPresetButton, SIGNAL( clicked() ), _ctl,
|
||||
SLOT( rolrPreset() ) );
|
||||
toolTip::add( m_rolLPresetButton, tr( "Previous (-)" ) );
|
||||
|
||||
m_rolLPresetButton->setShortcut( Qt::Key_Minus );
|
||||
|
||||
m_rolLPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to switch to another VST-plugin preset program." ) );
|
||||
|
||||
m_rolLPresetButton->setMinimumWidth( 16 );
|
||||
m_rolLPresetButton->setMaximumWidth( 16 );
|
||||
m_rolLPresetButton->setMinimumHeight( 16 );
|
||||
m_rolLPresetButton->setMaximumHeight( 16 );
|
||||
|
||||
|
||||
m_rolRPresetButton = new pixmapButton( this, "" );
|
||||
m_rolRPresetButton->setCheckable( false );
|
||||
m_rolRPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_rolRPresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-right-press" ) );
|
||||
m_rolRPresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"stepper-right" ) );
|
||||
connect( m_rolRPresetButton, SIGNAL( clicked() ), _ctl,
|
||||
SLOT( rollPreset() ) );
|
||||
toolTip::add( m_rolRPresetButton, tr( "Next (+)" ) );
|
||||
|
||||
m_rolRPresetButton->setShortcut( Qt::Key_Plus );
|
||||
|
||||
m_rolRPresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to switch to another VST-plugin preset program." ) );
|
||||
|
||||
m_rolRPresetButton->setMinimumWidth( 16 );
|
||||
m_rolRPresetButton->setMaximumWidth( 16 );
|
||||
m_rolRPresetButton->setMinimumHeight( 16 );
|
||||
m_rolRPresetButton->setMaximumHeight( 16 );
|
||||
|
||||
|
||||
|
||||
_ctl->m_selPresetButton = new QPushButton( tr( "" ), this );
|
||||
|
||||
_ctl->m_selPresetButton->setCheckable( false );
|
||||
_ctl->m_selPresetButton->setCursor( Qt::PointingHandCursor );
|
||||
_ctl->m_selPresetButton->setIcon( PLUGIN_NAME::getIconPixmap( "stepper-down" ) );
|
||||
_ctl->m_selPresetButton->setWhatsThis(
|
||||
tr( "Click here to select presets that are currently loaded in VST." ) );
|
||||
|
||||
_ctl->m_selPresetButton->setMenu(_ctl->menu);
|
||||
|
||||
|
||||
_ctl->m_selPresetButton->setMinimumWidth( 16 );
|
||||
_ctl->m_selPresetButton->setMaximumWidth( 16 );
|
||||
_ctl->m_selPresetButton->setMinimumHeight( 16 );
|
||||
_ctl->m_selPresetButton->setMaximumHeight( 16 );
|
||||
|
||||
|
||||
m_savePresetButton = new pixmapButton( this, "" );
|
||||
m_savePresetButton->setCheckable( false );
|
||||
m_savePresetButton->setCursor( Qt::PointingHandCursor );
|
||||
m_savePresetButton->setActiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"project_save", 21, 21 ) );
|
||||
m_savePresetButton->setInactiveGraphic( PLUGIN_NAME::getIconPixmap(
|
||||
"project_save", 21, 21 ) );
|
||||
connect( m_savePresetButton, SIGNAL( clicked() ), _ctl,
|
||||
SLOT( savePreset() ) );
|
||||
toolTip::add( m_savePresetButton, tr( "Save preset" ) );
|
||||
|
||||
m_savePresetButton->setWhatsThis(
|
||||
tr( "Click here, if you want to save current VST-plugin preset program." ) );
|
||||
|
||||
|
||||
m_savePresetButton->setMinimumWidth( 21 );
|
||||
m_savePresetButton->setMaximumWidth( 21 );
|
||||
m_savePresetButton->setMinimumHeight( 21 );
|
||||
m_savePresetButton->setMaximumHeight( 21 );
|
||||
|
||||
|
||||
l->addWidget( m_openPresetButton, 1, 7, Qt::AlignCenter );
|
||||
l->addWidget( m_rolLPresetButton, 1, 4, Qt::AlignCenter );
|
||||
l->addWidget( m_rolRPresetButton, 1, 5, Qt::AlignCenter );
|
||||
l->addWidget(_ctl->m_selPresetButton, 1, 6, Qt::AlignLeft );
|
||||
|
||||
l->addWidget( m_managePluginButton, 1, 10, 2, 2, Qt::AlignLeft );
|
||||
|
||||
l->addWidget( m_savePresetButton, 1, 8, 2, 2, Qt::AlignCenter );
|
||||
|
||||
l->setRowStretch( 3, 1 );
|
||||
l->setColumnStretch( 13, 1 );
|
||||
|
||||
}
|
||||
#endif
|
||||
#ifdef LMMS_BUILD_WIN32
|
||||
@@ -66,6 +216,14 @@ VstEffectControlDialog::VstEffectControlDialog( VstEffectControls * _ctl ) :
|
||||
|
||||
|
||||
|
||||
void VstEffectControlDialog::paintEvent( QPaintEvent * )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
VstEffectControlDialog::~VstEffectControlDialog()
|
||||
{
|
||||
delete m_pluginWidget;
|
||||
|
||||
@@ -27,8 +27,15 @@
|
||||
|
||||
#include "EffectControlDialog.h"
|
||||
|
||||
#include <QObject>
|
||||
#include <QPainter>
|
||||
|
||||
|
||||
class VstEffectControls;
|
||||
class pixmapButton;
|
||||
class QPixmap;
|
||||
class QPushButton;
|
||||
class pixmapButton;
|
||||
|
||||
|
||||
class VstEffectControlDialog : public EffectControlDialog
|
||||
@@ -37,9 +44,19 @@ public:
|
||||
VstEffectControlDialog( VstEffectControls * _controls );
|
||||
virtual ~VstEffectControlDialog();
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
private:
|
||||
QWidget * m_pluginWidget;
|
||||
|
||||
pixmapButton * m_openPresetButton;
|
||||
pixmapButton * m_rolLPresetButton;
|
||||
pixmapButton * m_rolRPresetButton;
|
||||
pixmapButton * m_selPresetButton;
|
||||
pixmapButton * m_managePluginButton;
|
||||
pixmapButton * m_savePresetButton;
|
||||
|
||||
} ;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -27,12 +27,33 @@
|
||||
#include "VstEffectControls.h"
|
||||
#include "VstEffect.h"
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include <QtGui/QMdiArea>
|
||||
#include <QApplication>
|
||||
|
||||
|
||||
|
||||
VstEffectControls::VstEffectControls( VstEffect * _eff ) :
|
||||
EffectControls( _eff ),
|
||||
m_effect( _eff )
|
||||
m_effect( _eff ),
|
||||
m_subWindow( NULL ),
|
||||
knobFModel( NULL ),
|
||||
vstKnobs( NULL ),
|
||||
ctrHandle( NULL ),
|
||||
lastPosInMenu (0)
|
||||
// m_presetLabel ( NULL )
|
||||
{
|
||||
menu = new QMenu;
|
||||
connect( menu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
VstEffectControls::~VstEffectControls()
|
||||
{
|
||||
delete ctrHandle;
|
||||
ctrHandle = NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,6 +67,29 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
|
||||
if( m_effect->m_plugin != NULL )
|
||||
{
|
||||
m_effect->m_plugin->loadSettings( _this );
|
||||
|
||||
const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
char paramStr[35];
|
||||
vstKnobs = new knob *[paramCount];
|
||||
knobFModel = new FloatModel *[paramCount];
|
||||
QStringList list1;
|
||||
QWidget * widget = new QWidget();
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
|
||||
vstKnobs[i] = new knob( knobBright_26, widget );
|
||||
vstKnobs[i]->setHintText( list1.at(1) + ":", "");
|
||||
vstKnobs[i]->setLabel( list1.at(1).left(15) );
|
||||
|
||||
knobFModel[i] = new FloatModel( (list1.at(2)).toFloat(), 0.0f, 1.0f, 0.01f, this, QString::number(i) );
|
||||
knobFModel[i]->loadSettings( _this, paramStr );
|
||||
connect( knobFModel[i], SIGNAL( dataChanged() ), this, SLOT( setParameter() ) );
|
||||
|
||||
vstKnobs[i]->setModel( knobFModel[i] );
|
||||
}
|
||||
|
||||
}
|
||||
m_effect->m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -53,6 +97,20 @@ void VstEffectControls::loadSettings( const QDomElement & _this )
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::setParameter( void )
|
||||
{
|
||||
|
||||
Model *action = qobject_cast<Model *>(sender());
|
||||
int knobUNID = action->displayName().toInt();
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->setParam( knobUNID, knobFModel[knobUNID]->value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
{
|
||||
_this.setAttribute( "plugin", m_effect->m_key.attributes["file"] );
|
||||
@@ -60,6 +118,16 @@ void VstEffectControls::saveSettings( QDomDocument & _doc, QDomElement & _this )
|
||||
if( m_effect->m_plugin != NULL )
|
||||
{
|
||||
m_effect->m_plugin->saveSettings( _doc, _this );
|
||||
if (knobFModel != NULL) {
|
||||
const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
char paramStr[35];
|
||||
for (int i = 0; i < paramCount; i++)
|
||||
if (knobFModel[i]->isAutomated() || knobFModel[i]->getControllerConnection()) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
knobFModel[i]->saveSettings( _doc, _this, paramStr );
|
||||
}
|
||||
}
|
||||
}
|
||||
m_effect->m_pluginMutex.unlock();
|
||||
}
|
||||
@@ -75,5 +143,286 @@ int VstEffectControls::controlCount()
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::managePlugin( void )
|
||||
{
|
||||
if ( m_effect->m_plugin != NULL && m_subWindow == NULL ) {
|
||||
manageVSTEffectView * tt = new manageVSTEffectView( m_effect, this);
|
||||
ctrHandle = (QObject *)tt;
|
||||
} else if (m_subWindow != NULL) {
|
||||
if (m_subWindow->widget()->isVisible() == FALSE) {
|
||||
m_scrollArea->show();
|
||||
m_subWindow->show();
|
||||
} else {
|
||||
m_scrollArea->hide();
|
||||
m_subWindow->hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::savePreset( void )
|
||||
{
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->savePreset( );
|
||||
/* bool converted;
|
||||
QString str = m_vi->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
QWidget::update();*/
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::updateMenu( void )
|
||||
{
|
||||
|
||||
// get all presets -
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->loadPrograms( 1 );
|
||||
///QWidget::update();
|
||||
|
||||
QString str = m_effect->m_plugin->presetsString();
|
||||
|
||||
QStringList list1 = str.split("|");
|
||||
|
||||
QMenu * to_menu = m_selPresetButton->menu();
|
||||
to_menu->clear();
|
||||
|
||||
QAction *presetActions[list1.size()];
|
||||
|
||||
for (int i = 0; i < list1.size(); i++) {
|
||||
presetActions[i] = new QAction(this);
|
||||
connect(presetActions[i], SIGNAL(triggered()), this, SLOT(selPreset()));
|
||||
|
||||
presetActions[i]->setText(QString("%1. %2").arg(QString::number(i+1), list1.at(i)));
|
||||
presetActions[i]->setData(i);
|
||||
if (i == lastPosInMenu) {
|
||||
presetActions[i]->setIcon(embed::getIconPixmap( "sample_file", 16, 16 ));
|
||||
} else presetActions[i]->setIcon(embed::getIconPixmap( "edit_copy", 16, 16 ));
|
||||
to_menu->addAction( presetActions[i] );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::openPreset( void )
|
||||
{
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->openPreset( );
|
||||
bool converted;
|
||||
QString str = m_effect->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
//QWidget::update();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::rollPreset( void )
|
||||
{
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->rollPreset( 1 );
|
||||
bool converted;
|
||||
QString str = m_effect->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
//QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::rolrPreset( void )
|
||||
{
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->rollPreset( -1 );
|
||||
bool converted;
|
||||
QString str = m_effect->m_plugin->presetString().section("/", 0, 0);
|
||||
if (str != "")
|
||||
lastPosInMenu = str.toInt(&converted, 10) - 1;
|
||||
//QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::selPreset( void )
|
||||
{
|
||||
|
||||
QAction *action = qobject_cast<QAction *>(sender());
|
||||
if (action)
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
lastPosInMenu = action->data().toInt();
|
||||
m_effect->m_plugin->rollPreset( lastPosInMenu + 2 );
|
||||
//QWidget::update();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void VstEffectControls::paintEvent( QPaintEvent * )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
manageVSTEffectView::manageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi ) :
|
||||
m_effect( _eff )
|
||||
{
|
||||
m_vi2 = m_vi;
|
||||
widget = new QWidget();
|
||||
m_vi->m_scrollArea = new QScrollArea( widget );
|
||||
l = new QGridLayout( widget );
|
||||
|
||||
m_vi->m_subWindow = engine::mainWindow()->workspace()->addSubWindow(new QMdiSubWindow, Qt::SubWindow |
|
||||
Qt::CustomizeWindowHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
m_vi->m_subWindow->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Fixed );
|
||||
m_vi->m_subWindow->setFixedSize( 960, 300);
|
||||
m_vi->m_subWindow->setWidget(m_vi->m_scrollArea);
|
||||
m_vi->m_subWindow->setWindowTitle(_eff->m_plugin->name());
|
||||
m_vi->m_subWindow->setWindowIcon( PLUGIN_NAME::getIconPixmap( "logo" ) );
|
||||
//m_vi->m_subWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
|
||||
l->setContentsMargins( 20, 10, 10, 10 );
|
||||
l->setVerticalSpacing( 10 );
|
||||
l->setHorizontalSpacing( 23 );
|
||||
|
||||
m_syncButton = new QPushButton( tr( "VST Sync" ), widget );
|
||||
connect( m_syncButton, SIGNAL( clicked() ), this,
|
||||
SLOT( syncPlugin() ) );
|
||||
m_syncButton->setWhatsThis(
|
||||
tr( "Click here if you want to synchronize all parameters with VST plugin." ) );
|
||||
|
||||
l->addWidget( m_syncButton, 0, 0, 1, 2, Qt::AlignLeft );
|
||||
|
||||
const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
|
||||
int paramCount = (dump).size();
|
||||
|
||||
bool isVstKnobs = true, isKnobFModel = true;
|
||||
|
||||
|
||||
if (m_vi->vstKnobs == NULL) {
|
||||
m_vi->vstKnobs = new knob *[paramCount];
|
||||
isVstKnobs = false;
|
||||
}
|
||||
if (m_vi->knobFModel == NULL) {
|
||||
m_vi->knobFModel = new FloatModel *[paramCount];
|
||||
isKnobFModel = false;
|
||||
}
|
||||
|
||||
char paramStr[35];
|
||||
QStringList list1;
|
||||
|
||||
if (isVstKnobs == false) {
|
||||
for (int i = 0; i < paramCount; i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
|
||||
m_vi->vstKnobs[i] = new knob( knobBright_26, widget);
|
||||
m_vi->vstKnobs[i]->setHintText( list1.at(1) + ":", "");
|
||||
m_vi->vstKnobs[i]->setLabel( list1.at(1).left(15) );
|
||||
|
||||
sprintf( paramStr, "%d", i);
|
||||
m_vi->knobFModel[i] = new FloatModel( (list1.at(2)).toFloat(), 0.0f, 1.0f, 0.01f,
|
||||
_eff, tr( paramStr ) );
|
||||
connect( m_vi->knobFModel[i], SIGNAL( dataChanged() ), this, SLOT( setParameter() ) );
|
||||
m_vi->vstKnobs[i] ->setModel( m_vi->knobFModel[i] );
|
||||
}
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for (int lrow = 0+1; lrow < (int(paramCount / 10) + 1)+1; lrow++) {
|
||||
for (int lcolumn = 0; lcolumn < 10; lcolumn++) {
|
||||
if (i < paramCount)
|
||||
l->addWidget( m_vi->vstKnobs[i], lrow, lcolumn, Qt::AlignCenter );
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
l->setRowStretch( (int(paramCount / 10) + 1), 1 );
|
||||
l->setColumnStretch( 10, 1 );
|
||||
|
||||
widget->setLayout(l);
|
||||
widget->setAutoFillBackground(true);
|
||||
|
||||
m_vi->m_scrollArea->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
|
||||
m_vi->m_scrollArea->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
|
||||
m_vi->m_scrollArea->setPalette( QApplication::palette( m_vi->m_scrollArea ) );
|
||||
m_vi->m_scrollArea->setMinimumHeight( 64 );
|
||||
|
||||
m_vi->m_scrollArea->setWidget( widget );
|
||||
|
||||
m_vi->m_subWindow->show();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVSTEffectView::syncPlugin( void )
|
||||
{
|
||||
char paramStr[35];
|
||||
QStringList list1;
|
||||
const QMap<QString, QString> & dump = m_effect->m_plugin->parameterDump();
|
||||
float f;
|
||||
|
||||
for (int i = 0; i<(dump).size(); i++) {
|
||||
sprintf( paramStr, "param%d", i);
|
||||
list1 = dump[paramStr].split(":");
|
||||
f = (list1.at(2)).toFloat();
|
||||
m_vi2->knobFModel[i]->setValue(f);
|
||||
m_vi2->knobFModel[i]->setInitValue(f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
void manageVSTEffectView::setParameter( void )
|
||||
{
|
||||
|
||||
Model *action = qobject_cast<Model *>(sender());
|
||||
int knobUNID = action->displayName().toInt();
|
||||
|
||||
if ( m_effect->m_plugin != NULL ) {
|
||||
m_effect->m_plugin->setParam( knobUNID, m_vi2->knobFModel[knobUNID]->value() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
manageVSTEffectView::~manageVSTEffectView()
|
||||
{
|
||||
delete m_vi2->m_subWindow;
|
||||
m_vi2->m_subWindow = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#include "moc_VstEffectControls.cxx"
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* VstEffectControls.h - controls for VST effect plugins
|
||||
*
|
||||
* Copyright (c) 2008-2009 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
* Copyright (c) 2008-2011 Tobias Doerffel <tobydox/at/users.sourceforge.net>
|
||||
*
|
||||
* This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net
|
||||
*
|
||||
@@ -28,6 +28,17 @@
|
||||
#include "EffectControls.h"
|
||||
#include "VstEffectControlDialog.h"
|
||||
|
||||
#include <QtGui/QMenu>
|
||||
#include "embed.h"
|
||||
#include <QtGui/QPushButton>
|
||||
|
||||
#include <QtGui/QMdiSubWindow>
|
||||
#include <QtGui/QScrollArea>
|
||||
#include "knob.h"
|
||||
#include <QtGui/QLayout>
|
||||
#include <QPainter>
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class VstEffect;
|
||||
|
||||
@@ -37,9 +48,7 @@ class VstEffectControls : public EffectControls
|
||||
Q_OBJECT
|
||||
public:
|
||||
VstEffectControls( VstEffect * _eff );
|
||||
virtual ~VstEffectControls()
|
||||
{
|
||||
}
|
||||
virtual ~VstEffectControls();
|
||||
|
||||
virtual void saveSettings( QDomDocument & _doc, QDomElement & _parent );
|
||||
virtual void loadSettings( const QDomElement & _this );
|
||||
@@ -56,10 +65,69 @@ public:
|
||||
}
|
||||
|
||||
|
||||
protected slots:
|
||||
void updateMenu( void );
|
||||
void managePlugin( void );
|
||||
void openPreset( void );
|
||||
void savePreset( void );
|
||||
void rollPreset( void );
|
||||
void rolrPreset( void );
|
||||
void selPreset( void );
|
||||
void setParameter( void );
|
||||
|
||||
protected:
|
||||
virtual void paintEvent( QPaintEvent * _pe );
|
||||
|
||||
private:
|
||||
VstEffect * m_effect;
|
||||
|
||||
QPushButton * m_selPresetButton;
|
||||
QMenu *menu;
|
||||
|
||||
QMdiSubWindow * m_subWindow;
|
||||
QScrollArea * m_scrollArea;
|
||||
FloatModel ** knobFModel;
|
||||
knob ** vstKnobs;
|
||||
|
||||
QObject * ctrHandle;
|
||||
|
||||
int lastPosInMenu;
|
||||
// QLabel * m_presetLabel;
|
||||
|
||||
friend class VstEffectControlDialog;
|
||||
friend class manageVSTEffectView;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
class manageVSTEffectView : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
manageVSTEffectView( VstEffect * _eff, VstEffectControls * m_vi );
|
||||
virtual ~manageVSTEffectView();
|
||||
|
||||
|
||||
protected slots:
|
||||
void syncPlugin( void );
|
||||
void setParameter( void );
|
||||
|
||||
private:
|
||||
|
||||
// static QPixmap * s_artwork;
|
||||
|
||||
VstEffectControls * m_vi2;
|
||||
|
||||
|
||||
VstEffect * m_effect;
|
||||
|
||||
|
||||
QWidget *widget;
|
||||
QGridLayout * l;
|
||||
|
||||
QPushButton * m_syncButton;
|
||||
|
||||
} ;
|
||||
|
||||
|
||||
@@ -31,11 +31,12 @@ Echo::Echo(const int &insertion_,
|
||||
REALTYPE *const efxoutl_,
|
||||
REALTYPE *const efxoutr_)
|
||||
:Effect(insertion_, efxoutl_, efxoutr_, NULL, 0),
|
||||
samplerate(SAMPLE_RATE),
|
||||
Pvolume(50), Ppanning(64), Pdelay(60),
|
||||
Plrdelay(100), Plrcross(100), Pfb(40), Phidamp(60),
|
||||
delayTime(1), lrdelay(0), avgDelay(0),
|
||||
delay(new REALTYPE[(int)(MAX_DELAY * SAMPLE_RATE)],
|
||||
new REALTYPE[(int)(MAX_DELAY * SAMPLE_RATE)]),
|
||||
delay(new REALTYPE[(int)(MAX_DELAY * samplerate)],
|
||||
new REALTYPE[(int)(MAX_DELAY * samplerate)]),
|
||||
old(0.0), pos(0), delta(1), ndelta(1)
|
||||
{
|
||||
initdelays();
|
||||
@@ -53,8 +54,8 @@ Echo::~Echo()
|
||||
*/
|
||||
void Echo::cleanup()
|
||||
{
|
||||
memset(delay.l,0,MAX_DELAY*SAMPLE_RATE*sizeof(REALTYPE));
|
||||
memset(delay.r,0,MAX_DELAY*SAMPLE_RATE*sizeof(REALTYPE));
|
||||
memset(delay.l,0,MAX_DELAY*samplerate*sizeof(REALTYPE));
|
||||
memset(delay.r,0,MAX_DELAY*samplerate*sizeof(REALTYPE));
|
||||
old = Stereo<REALTYPE>(0.0);
|
||||
}
|
||||
|
||||
@@ -75,8 +76,8 @@ void Echo::initdelays()
|
||||
//number of seconds to delay right chan
|
||||
float dr = avgDelay + lrdelay;
|
||||
|
||||
ndelta.l = max(1,(int) (dl * SAMPLE_RATE));
|
||||
ndelta.r = max(1,(int) (dr * SAMPLE_RATE));
|
||||
ndelta.l = max(1,(int) (dl * samplerate));
|
||||
ndelta.r = max(1,(int) (dr * samplerate));
|
||||
}
|
||||
|
||||
void Echo::out(const Stereo<float *> &input)
|
||||
@@ -96,16 +97,16 @@ void Echo::out(const Stereo<float *> &input)
|
||||
rdl = input.r[i] * (1.0 - panning) - rdl * fb;
|
||||
|
||||
//LowPass Filter
|
||||
old.l = delay.l[(pos.l+delta.l)%(MAX_DELAY * SAMPLE_RATE)] = ldl * hidamp + old.l * (1.0 - hidamp);
|
||||
old.r = delay.r[(pos.r+delta.r)%(MAX_DELAY * SAMPLE_RATE)] = rdl * hidamp + old.r * (1.0 - hidamp);
|
||||
old.l = delay.l[(pos.l+delta.l)%(MAX_DELAY * samplerate)] = ldl * hidamp + old.l * (1.0 - hidamp);
|
||||
old.r = delay.r[(pos.r+delta.r)%(MAX_DELAY * samplerate)] = rdl * hidamp + old.r * (1.0 - hidamp);
|
||||
|
||||
//increment
|
||||
++pos.l;// += delta.l;
|
||||
++pos.r;// += delta.r;
|
||||
|
||||
//ensure that pos is still in bounds
|
||||
pos.l %= MAX_DELAY * SAMPLE_RATE;
|
||||
pos.r %= MAX_DELAY * SAMPLE_RATE;
|
||||
pos.l %= MAX_DELAY * samplerate;
|
||||
pos.r %= MAX_DELAY * samplerate;
|
||||
|
||||
//adjust delay if needed
|
||||
delta.l = (15*delta.l + ndelta.l)/16;
|
||||
|
||||
@@ -98,6 +98,8 @@ class Echo:public Effect
|
||||
/**\todo This function needs to be implemented or the prototype should be removed*/
|
||||
void setdryonly();
|
||||
private:
|
||||
int samplerate;
|
||||
|
||||
//Parameters
|
||||
char Pvolume; /**<#1 Volume or Dry/Wetness*/
|
||||
char Ppanning; /**<#2 Panning*/
|
||||
|
||||
@@ -58,7 +58,6 @@ class Phaser:public Effect
|
||||
unsigned char Poutsub; //if I wish to subtract the output instead of adding
|
||||
unsigned char Pphase;
|
||||
unsigned char Phyper; //lfo^2 -- converts tri into hyper-sine
|
||||
unsigned char Pbarber; //Enable parber pole phasing
|
||||
unsigned char Panalog;
|
||||
|
||||
//Control parameters
|
||||
|
||||
@@ -248,10 +248,8 @@ void Reverb::settime(unsigned char Ptime)
|
||||
|
||||
void Reverb::setlohidamp(unsigned char Plohidamp)
|
||||
{
|
||||
REALTYPE x;
|
||||
|
||||
if(Plohidamp < 64)
|
||||
Plohidamp = 64; //remove this when the high part from lohidamp will be added
|
||||
Plohidamp = 64; //remove this when the high part from lohidamp will be added
|
||||
|
||||
this->Plohidamp = Plohidamp;
|
||||
if(Plohidamp == 64) {
|
||||
@@ -263,7 +261,7 @@ void Reverb::setlohidamp(unsigned char Plohidamp)
|
||||
lohidamptype = 1;
|
||||
if(Plohidamp > 64)
|
||||
lohidamptype = 2;
|
||||
x = fabs((REALTYPE)(Plohidamp - 64) / 64.1);
|
||||
REALTYPE x = fabs((REALTYPE)(Plohidamp - 64) / 64.1);
|
||||
lohifb = x * x;
|
||||
}
|
||||
}
|
||||
@@ -330,7 +328,7 @@ void Reverb::setlpf(unsigned char Plpf)
|
||||
void Reverb::settype(unsigned char Ptype)
|
||||
{
|
||||
const int NUM_TYPES = 3;
|
||||
int combtunings[NUM_TYPES][REV_COMBS] = {
|
||||
const int combtunings[NUM_TYPES][REV_COMBS] = {
|
||||
//this is unused (for random)
|
||||
{0, 0, 0, 0, 0, 0, 0, 0 },
|
||||
//Freeverb by Jezar at Dreampoint
|
||||
@@ -338,7 +336,7 @@ void Reverb::settype(unsigned char Ptype)
|
||||
//Freeverb by Jezar at Dreampoint //duplicate
|
||||
{1116, 1188, 1277, 1356, 1422, 1491, 1557, 1617 }
|
||||
};
|
||||
int aptunings[NUM_TYPES][REV_APS] = {
|
||||
const int aptunings[NUM_TYPES][REV_APS] = {
|
||||
//this is unused (for random)
|
||||
{0, 0, 0, 0 },
|
||||
//Freeverb by Jezar at Dreampoint
|
||||
|
||||
@@ -395,7 +395,7 @@ void Microtonal::tuningtoline(int n, char *line, int maxn)
|
||||
return;
|
||||
}
|
||||
if(octave[n].type == 1)
|
||||
snprintf(line, maxn, "%d.%d", octave[n].x1, octave[n].x2);
|
||||
snprintf(line, maxn, "%d.%06d", octave[n].x1, octave[n].x2);
|
||||
if(octave[n].type == 2)
|
||||
snprintf(line, maxn, "%d/%d", octave[n].x1, octave[n].x2);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
#ifndef UTIL_H
|
||||
#define UTIL_H
|
||||
|
||||
#include <cstdio>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include "../globals.h"
|
||||
@@ -54,6 +55,15 @@ std::string stringFrom(T x)
|
||||
return ss.str();
|
||||
}
|
||||
|
||||
template<class T>
|
||||
std::string stringFrom(REALTYPE x)
|
||||
{
|
||||
char buf[64];
|
||||
sprintf( buf, "%f", x );
|
||||
return buf;
|
||||
}
|
||||
|
||||
|
||||
template<class T>
|
||||
T stringTo(const char *x)
|
||||
{
|
||||
|
||||
@@ -88,7 +88,7 @@ bool PresetsStore::presetstruct::operator<(const presetstruct &b) const
|
||||
}
|
||||
|
||||
|
||||
void PresetsStore::rescanforpresets(string type)
|
||||
void PresetsStore::rescanforpresets(const string &type)
|
||||
{
|
||||
//std::cout << "Scanning For Presets" << std::endl;
|
||||
//std::cout << "Of Type: " << type << std::endl;
|
||||
|
||||
@@ -52,7 +52,7 @@ class PresetsStore
|
||||
};
|
||||
std::vector<presetstruct> presets;
|
||||
|
||||
void rescanforpresets(const std::string type);
|
||||
void rescanforpresets(const std::string &type);
|
||||
|
||||
private:
|
||||
struct {
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include "MIDIFile.h"
|
||||
|
||||
|
||||
@@ -235,8 +236,7 @@ void MIDIFile::parsenoteoff(char ntrack, char chan, unsigned int dt)
|
||||
unsigned char note;
|
||||
note = getbyte();
|
||||
|
||||
unsigned char noteoff_velocity = getbyte(); //unused by zynaddsubfx
|
||||
noteoff_velocity = 0;
|
||||
(void) getbyte(); //Read in unused noteoff_velocity
|
||||
if(chan >= NUM_MIDI_CHANNELS)
|
||||
return;
|
||||
|
||||
@@ -346,7 +346,6 @@ void MIDIFile::clearmidifile()
|
||||
midifilesize = 0;
|
||||
midifilek = 0;
|
||||
midieof = false;
|
||||
data.tick = 0.05;
|
||||
}
|
||||
|
||||
unsigned char MIDIFile::getbyte()
|
||||
@@ -394,14 +393,13 @@ unsigned short int MIDIFile::getint16()
|
||||
unsigned int MIDIFile::getvarint32()
|
||||
{
|
||||
unsigned long result = 0;
|
||||
unsigned char b;
|
||||
|
||||
/// printf("\n[start]");
|
||||
|
||||
if((result = getbyte()) & 0x80) {
|
||||
result &= 0x7f;
|
||||
uint8_t b;
|
||||
do {
|
||||
b = getbyte();
|
||||
b = getbyte();
|
||||
result = (result << 7) + (b & 0x7f);
|
||||
} while(b & 0x80);
|
||||
}
|
||||
|
||||
@@ -83,10 +83,6 @@ class MIDIFile
|
||||
|
||||
//skip some bytes
|
||||
void skipnbytes(int n);
|
||||
|
||||
struct {
|
||||
double tick; //how many seconds one tick has
|
||||
} data;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -20,8 +20,9 @@
|
||||
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cmath>
|
||||
#include "Envelope.h"
|
||||
#include "../Params/EnvelopeParams.h"
|
||||
|
||||
Envelope::Envelope(EnvelopeParams *envpars, REALTYPE basefreq)
|
||||
{
|
||||
@@ -56,7 +57,7 @@ Envelope::Envelope(EnvelopeParams *envpars, REALTYPE basefreq)
|
||||
|
||||
switch(mode) {
|
||||
case 2:
|
||||
envval[i] = (1.0 - envpars->Penvval[i] / 127.0) * MIN_ENVELOPE_DB;
|
||||
envval[i] = (1.0 - envpars->Penvval[i] / 127.0) * -40;
|
||||
break;
|
||||
case 3:
|
||||
envval[i] =
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#ifndef ENVELOPE_H
|
||||
#define ENVELOPE_H
|
||||
|
||||
#include <math.h>
|
||||
#include "../globals.h"
|
||||
#include "../Params/EnvelopeParams.h"
|
||||
|
||||
@@ -33,7 +32,7 @@ class Envelope
|
||||
public:
|
||||
|
||||
/**Constructor*/
|
||||
Envelope(EnvelopeParams *envpars, REALTYPE basefreq);
|
||||
Envelope(class EnvelopeParams *envpars, REALTYPE basefreq);
|
||||
/**Destructor*/
|
||||
~Envelope();
|
||||
void relasekey();
|
||||
|
||||
@@ -933,7 +933,7 @@ void OscilGen::prepare()
|
||||
|
||||
void OscilGen::adaptiveharmonic(FFTFREQS f, REALTYPE freq)
|
||||
{
|
||||
if((Padaptiveharmonics == 0) /*||(freq<1.0)*/)
|
||||
if(Padaptiveharmonics == 0 /*||(freq<1.0)*/)
|
||||
return;
|
||||
if(freq < 1.0)
|
||||
freq = 440.0;
|
||||
|
||||
@@ -1049,7 +1049,7 @@ char tmp[10];
|
||||
while (klimits[k]!=0){
|
||||
sprintf(tmp,"%d",klimits[k]);
|
||||
keylimitlist->add(tmp);
|
||||
if ((val==-1)){
|
||||
if (val==-1){
|
||||
if (klimits[k]>part->Pkeylimit) val=k;
|
||||
};
|
||||
k++;
|
||||
|
||||
16
src/3rdparty/samplerate/common.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
@@ -46,6 +46,18 @@ typedef long int32_t ;
|
||||
|
||||
#define MAKE_MAGIC(a,b,c,d,e,f) ((a) + ((b) << 4) + ((c) << 8) + ((d) << 12) + ((e) << 16) + ((f) << 20))
|
||||
|
||||
/*
|
||||
** Inspiration : http://sourcefrog.net/weblog/software/languages/C/unused.html
|
||||
*/
|
||||
#ifdef UNUSED
|
||||
#elif defined (__GNUC__)
|
||||
# define UNUSED(x) UNUSED_ ## x __attribute__ ((unused))
|
||||
#elif defined (__LCLINT__)
|
||||
# define UNUSED(x) /*@unused@*/ x
|
||||
#else
|
||||
# define UNUSED(x) x
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
# define WARN_UNUSED __attribute__ ((warn_unused_result))
|
||||
#else
|
||||
|
||||
4
src/3rdparty/samplerate/fastest_coeffs.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
30
src/3rdparty/samplerate/float_cast.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2001-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2001-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU Lesser General Public License as published by
|
||||
@@ -16,7 +16,7 @@
|
||||
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
/* Version 1.4 */
|
||||
/* Version 1.5 */
|
||||
|
||||
#ifndef FLOAT_CAST_HEADER
|
||||
#define FLOAT_CAST_HEADER
|
||||
@@ -121,6 +121,32 @@
|
||||
return retval ;
|
||||
} /* float2int */
|
||||
|
||||
#elif (defined (WIN64) || defined(_WIN64))
|
||||
|
||||
/* Win64 section should be places before Win32 one, because
|
||||
** most likely both WIN32 and WIN64 will be defined in 64-bit case.
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
|
||||
/* Win64 doesn't seem to have these functions, nor inline assembly.
|
||||
** Therefore implement inline versions of these functions here.
|
||||
*/
|
||||
#include <emmintrin.h>
|
||||
#include <mmintrin.h>
|
||||
|
||||
__inline long int
|
||||
lrint(double flt)
|
||||
{
|
||||
return _mm_cvtsd_si32(_mm_load_sd(&flt));
|
||||
}
|
||||
|
||||
__inline long int
|
||||
lrintf(float flt)
|
||||
{
|
||||
return _mm_cvtss_si32(_mm_load_ss(&flt));
|
||||
}
|
||||
|
||||
#elif (defined (WIN32) || defined (_WIN32))
|
||||
|
||||
#undef HAVE_LRINT_REPLACEMENT
|
||||
|
||||
4
src/3rdparty/samplerate/high_qual_coeffs.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2007-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2007-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
4
src/3rdparty/samplerate/mid_qual_coeffs.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2007-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2007-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
4
src/3rdparty/samplerate/samplerate.c
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
4
src/3rdparty/samplerate/samplerate.h
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
|
||||
7
src/3rdparty/samplerate/src_linear.c
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
@@ -58,6 +58,9 @@ linear_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
|
||||
double src_ratio, input_index, rem ;
|
||||
int ch ;
|
||||
|
||||
if (data->input_frames <= 0)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
return SRC_ERR_NO_PRIVATE ;
|
||||
|
||||
|
||||
9
src/3rdparty/samplerate/src_sinc.c
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
@@ -1166,7 +1166,7 @@ prepare_data (SINC_FILTER *filter, SRC_DATA *data, int half_filter_chan_len)
|
||||
len = MIN (filter->in_count - filter->in_used, len) ;
|
||||
len -= (len % filter->channels) ;
|
||||
|
||||
if (len < 0 || filter->b_end + len > filter->b_len)
|
||||
if (len < 0 || filter->b_end + len > filter->b_len)
|
||||
return SRC_ERR_SINC_PREPARE_DATA_BAD_LEN ;
|
||||
|
||||
memcpy (filter->buffer + filter->b_end, data->data_in + filter->in_used,
|
||||
@@ -1194,6 +1194,9 @@ prepare_data (SINC_FILTER *filter, SRC_DATA *data, int half_filter_chan_len)
|
||||
filter->b_real_end = filter->b_end ;
|
||||
len = half_filter_chan_len + 5 ;
|
||||
|
||||
if (len < 0 || filter->b_end + len > filter->b_len)
|
||||
len = filter->b_len - filter->b_end ;
|
||||
|
||||
memset (filter->buffer + filter->b_end, 0, len * sizeof (filter->buffer [0])) ;
|
||||
filter->b_end += len ;
|
||||
} ;
|
||||
|
||||
7
src/3rdparty/samplerate/src_zoh.c
vendored
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** Copyright (C) 2002-2008 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
** Copyright (C) 2002-2011 Erik de Castro Lopo <erikd@mega-nerd.com>
|
||||
**
|
||||
** This program is free software; you can redistribute it and/or modify
|
||||
** it under the terms of the GNU General Public License as published by
|
||||
@@ -17,7 +17,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
** This code is part of Secret Rabibt Code aka libsamplerate. A commercial
|
||||
** This code is part of Secret Rabbit Code aka libsamplerate. A commercial
|
||||
** use license for this code is available, please see:
|
||||
** http://www.mega-nerd.com/SRC/procedure.html
|
||||
*/
|
||||
@@ -56,6 +56,9 @@ zoh_vari_process (SRC_PRIVATE *psrc, SRC_DATA *data)
|
||||
double src_ratio, input_index, rem ;
|
||||
int ch ;
|
||||
|
||||
if (data->input_frames <= 0)
|
||||
return SRC_ERR_NO_ERROR ;
|
||||
|
||||
if (psrc->private_data == NULL)
|
||||
return SRC_ERR_NO_PRIVATE ;
|
||||
|
||||
|
||||
@@ -325,7 +325,7 @@ void AutomationPattern::loadSettings( const QDomElement & _this )
|
||||
}
|
||||
}
|
||||
|
||||
m_hasAutomation = m_timeMap.size() > 1;
|
||||
m_hasAutomation = m_timeMap.size() > 0;
|
||||
if( m_hasAutomation == false )
|
||||
{
|
||||
for( objectVector::iterator it = m_objects.begin();
|
||||
|
||||
@@ -33,119 +33,177 @@
|
||||
|
||||
|
||||
|
||||
ChordCreator::Chord ChordCreator::s_chordTable[] =
|
||||
ChordCreator::ChordTable::Init ChordCreator::ChordTable::s_initTable[] =
|
||||
{
|
||||
{ ChordCreator::tr( "octave" ), { 0, -1 } },
|
||||
{ ChordCreator::tr( "Major" ), { 0, 4, 7, -1 } },
|
||||
{ ChordCreator::tr( "Majb5" ), { 0, 4, 6, -1 } },
|
||||
{ ChordCreator::tr( "minor" ), { 0, 3, 7, -1 } },
|
||||
{ ChordCreator::tr( "minb5" ), { 0, 3, 6, -1 } },
|
||||
{ ChordCreator::tr( "sus2" ), { 0, 2, 7, -1 } },
|
||||
{ ChordCreator::tr( "sus4" ), { 0, 5, 7, -1 } },
|
||||
{ ChordCreator::tr( "aug" ), { 0, 4, 8, -1 } },
|
||||
{ ChordCreator::tr( "augsus4" ), { 0, 5, 8, -1 } },
|
||||
{ ChordCreator::tr( "tri" ), { 0, 3, 6, 9, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "octave" ), { 0, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Major" ), { 0, 4, 7, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Majb5" ), { 0, 4, 6, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "minor" ), { 0, 3, 7, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "minb5" ), { 0, 3, 6, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "sus2" ), { 0, 2, 7, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "sus4" ), { 0, 5, 7, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "aug" ), { 0, 4, 8, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "augsus4" ), { 0, 5, 8, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "tri" ), { 0, 3, 6, 9, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "6" ), { 0, 4, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "6sus4" ), { 0, 5, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "6add9" ), { 0, 4, 7, 12, -1 } },
|
||||
{ ChordCreator::tr( "m6" ), { 0, 3, 7, 9, -1 } },
|
||||
{ ChordCreator::tr( "m6add9" ), { 0, 3, 7, 9, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "6" ), { 0, 4, 7, 9, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "6sus4" ), { 0, 5, 7, 9, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "6add9" ), { 0, 4, 7, 12, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m6" ), { 0, 3, 7, 9, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m6add9" ), { 0, 3, 7, 9, 14, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "7" ), { 0, 4, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "7sus4" ), { 0, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "7#5" ), { 0, 4, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "7b5" ), { 0, 4, 6, 10, -1 } },
|
||||
{ ChordCreator::tr( "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } },
|
||||
{ ChordCreator::tr( "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } },
|
||||
{ ChordCreator::tr( "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } },
|
||||
{ ChordCreator::tr( "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } },
|
||||
{ ChordCreator::tr( "7add11" ), { 0, 4, 7, 10, 17, -1 } },
|
||||
{ ChordCreator::tr( "7add13" ), { 0, 4, 7, 10, 21, -1 } },
|
||||
{ ChordCreator::tr( "7#11" ), { 0, 4, 7, 10, 18, -1 } },
|
||||
{ ChordCreator::tr( "Maj7" ), { 0, 4, 7, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7b5" ), { 0, 4, 6, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7#5" ), { 0, 4, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } },
|
||||
{ ChordCreator::tr( "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } },
|
||||
{ ChordCreator::tr( "m7" ), { 0, 3, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "m7b5" ), { 0, 3, 6, 10, -1 } },
|
||||
{ ChordCreator::tr( "m7b9" ), { 0, 3, 7, 10, 13, -1 } },
|
||||
{ ChordCreator::tr( "m7add11" ), { 0, 3, 7, 10, 17, -1 } },
|
||||
{ ChordCreator::tr( "m7add13" ), { 0, 3, 7, 10, 21, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7" ), { 0, 3, 7, 11, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7" ), { 0, 4, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7sus4" ), { 0, 5, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7#5" ), { 0, 4, 8, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7b5" ), { 0, 4, 6, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7#9" ), { 0, 4, 7, 10, 13, 18, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7b9" ), { 0, 4, 7, 10, 13, 16, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7#5#9" ), { 0, 4, 8, 12, 14, 19, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7#5b9" ), { 0, 4, 8, 12, 14, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7b5b9" ), { 0, 4, 6, 10, 12, 15, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7add11" ), { 0, 4, 7, 10, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7add13" ), { 0, 4, 7, 10, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "7#11" ), { 0, 4, 7, 10, 18, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj7" ), { 0, 4, 7, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj7b5" ), { 0, 4, 6, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj7#5" ), { 0, 4, 8, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj7#11" ), { 0, 4, 7, 11, 18, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj7add13" ), { 0, 4, 7, 11, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m7" ), { 0, 3, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m7b5" ), { 0, 3, 6, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m7b9" ), { 0, 3, 7, 10, 13, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m7add11" ), { 0, 3, 7, 10, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m7add13" ), { 0, 3, 7, 10, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m-Maj7" ), { 0, 3, 7, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m-Maj7add11" ), { 0, 3, 7, 11, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m-Maj7add13" ), { 0, 3, 7, 11, 21, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "9" ), { 0, 4, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9sus4" ), { 0, 5, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "add9" ), { 0, 4, 7, 14, -1 } },
|
||||
{ ChordCreator::tr( "9#5" ), { 0, 4, 8, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9b5" ), { 0, 4, 6, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } },
|
||||
{ ChordCreator::tr( "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } },
|
||||
{ ChordCreator::tr( "Maj9" ), { 0, 4, 7, 11, 14, -1 } },
|
||||
{ ChordCreator::tr( "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } },
|
||||
{ ChordCreator::tr( "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } },
|
||||
{ ChordCreator::tr( "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } },
|
||||
{ ChordCreator::tr( "m9" ), { 0, 3, 7, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "madd9" ), { 0, 3, 7, 14, -1 } },
|
||||
{ ChordCreator::tr( "m9b5" ), { 0, 3, 6, 10, 14, -1 } },
|
||||
{ ChordCreator::tr( "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9" ), { 0, 4, 7, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9sus4" ), { 0, 5, 7, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "add9" ), { 0, 4, 7, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9#5" ), { 0, 4, 8, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9b5" ), { 0, 4, 6, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9#11" ), { 0, 4, 7, 10, 14, 18, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "9b13" ), { 0, 4, 7, 10, 14, 20, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj9" ), { 0, 4, 7, 11, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj9sus4" ), { 0, 5, 7, 11, 15, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj9#5" ), { 0, 4, 8, 11, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj9#11" ), { 0, 4, 7, 11, 14, 18, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m9" ), { 0, 3, 7, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "madd9" ), { 0, 3, 7, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m9b5" ), { 0, 3, 6, 10, 14, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m9-Maj7" ), { 0, 3, 7, 11, 14, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "11" ), { 0, 4, 7, 10, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } },
|
||||
{ ChordCreator::tr( "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "m11" ), { 0, 3, 7, 10, 14, 17, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "11" ), { 0, 4, 7, 10, 14, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "11b9" ), { 0, 4, 7, 10, 13, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj11" ), { 0, 4, 7, 11, 14, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m11" ), { 0, 3, 7, 10, 14, 17, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m-Maj11" ), { 0, 3, 7, 11, 14, 17, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "13" ), { 0, 4, 7, 10, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } },
|
||||
{ ChordCreator::tr( "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } },
|
||||
{ ChordCreator::tr( "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } },
|
||||
{ ChordCreator::tr( "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "m13" ), { 0, 3, 7, 10, 14, 21, -1 } },
|
||||
{ ChordCreator::tr( "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } },
|
||||
|
||||
{ ChordCreator::tr( "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } },
|
||||
{ ChordCreator::tr( "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } },
|
||||
{ ChordCreator::tr( "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } },
|
||||
{ ChordCreator::tr( "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } },
|
||||
{ ChordCreator::tr( "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Neopolitan minor" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Hungarian minor" ), { 0, 2, 3, 6, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } },
|
||||
{ ChordCreator::tr( "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } },
|
||||
{ ChordCreator::tr( "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } },
|
||||
{ ChordCreator::tr( "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } },
|
||||
{ ChordCreator::tr( "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } },
|
||||
|
||||
{ "", { -1, -1 } }
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "13" ), { 0, 4, 7, 10, 14, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "13#9" ), { 0, 4, 7, 10, 15, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "13b9" ), { 0, 4, 7, 10, 13, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "13b5b9" ), { 0, 4, 6, 10, 13, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Maj13" ), { 0, 4, 7, 11, 14, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m13" ), { 0, 3, 7, 10, 14, 21, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "m-Maj13" ), { 0, 3, 7, 11, 14, 21, -1 } },
|
||||
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Major" ), { 0, 2, 4, 5, 7, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Harmonic minor" ), { 0, 2, 3, 5, 7, 8, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Melodic minor" ), { 0, 2, 3, 5, 7, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Whole tone" ), { 0, 2, 4, 6, 8, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Diminished" ), { 0, 2, 3, 5, 6, 8, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Major pentatonic" ), { 0, 2, 4, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Minor pentatonic" ), { 0, 3, 5, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Jap in sen" ), { 0, 1, 5, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Major bebop" ), { 0, 2, 4, 5, 7, 8, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Dominant bebop" ), { 0, 2, 4, 5, 7, 9, 10, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Blues" ), { 0, 3, 5, 6, 7, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Arabic" ), { 0, 1, 4, 5, 7, 8, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Enigmatic" ), { 0, 1, 4, 6, 8, 10, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Neopolitan" ), { 0, 1, 3, 5, 7, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Neopolitan minor" ), { 0, 1, 3, 5, 7, 8, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Hungarian minor" ), { 0, 2, 3, 6, 7, 8, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Dorian" ), { 0, 2, 3, 5, 7, 9, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Phrygolydian" ), { 0, 1, 3, 5, 7, 8, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Lydian" ), { 0, 2, 4, 6, 7, 9, 11, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Mixolydian" ), { 0, 2, 4, 5, 7, 9, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Aeolian" ), { 0, 2, 3, 5, 7, 8, 10, -1 } },
|
||||
{ QT_TRANSLATE_NOOP( "ChordCreator", "Locrian" ), { 0, 1, 3, 5, 6, 8, 10, -1 } },
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
ChordCreator::Chord::Chord( const char * n, const ChordSemiTones & semi_tones ) :
|
||||
m_name( ChordCreator::tr( n ) )
|
||||
{
|
||||
for( m_size = 0; m_size < MAX_CHORD_POLYPHONY; m_size++ )
|
||||
{
|
||||
if( semi_tones[m_size] == -1 )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
m_semiTones[m_size] = semi_tones[m_size];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool ChordCreator::Chord::hasSemiTone( Sint8 semi_tone ) const
|
||||
{
|
||||
for( int i = 0; i < size(); ++i )
|
||||
{
|
||||
if( semi_tone == m_semiTones[i] )
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ChordCreator::ChordTable::ChordTable() :
|
||||
QVector<Chord>()
|
||||
{
|
||||
for( int i = 0;
|
||||
i < static_cast<int>( sizeof s_initTable / sizeof *s_initTable );
|
||||
i++ )
|
||||
{
|
||||
push_back( Chord( s_initTable[i].m_name, s_initTable[i].m_semiTones ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
const ChordCreator::Chord & ChordCreator::ChordTable::getByName( const QString & name, bool is_scale ) const
|
||||
{
|
||||
for( int i = 0; i < size(); i++ )
|
||||
{
|
||||
if( at( i ).getName() == name && is_scale == at( i ).isScale() )
|
||||
return at( i );
|
||||
}
|
||||
|
||||
static Chord empty;
|
||||
return empty;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
ChordCreator::ChordCreator( Model * _parent ) :
|
||||
Model( _parent, tr( "Chords" ) ),
|
||||
m_chordsEnabledModel( false, this ),
|
||||
m_chordsModel( this, tr( "Chord type" ) ),
|
||||
m_chordRangeModel( 1.0f, 1.0f, 9.0f, 1.0f, this, tr( "Chord range" ) )
|
||||
{
|
||||
for( int i = 0; s_chordTable[i].interval[0] != -1; ++i )
|
||||
const ChordTable & chord_table = ChordTable::getInstance();
|
||||
for( int i = 0; i < chord_table.size(); ++i )
|
||||
{
|
||||
m_chordsModel.addItem( tr( s_chordTable[i].name.toUtf8().
|
||||
constData() ) );
|
||||
m_chordsModel.addItem( chord_table[i].getName() );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -162,6 +220,7 @@ ChordCreator::~ChordCreator()
|
||||
void ChordCreator::processNote( notePlayHandle * _n )
|
||||
{
|
||||
const int base_note_key = _n->key();
|
||||
const ChordTable & chord_table = ChordTable::getInstance();
|
||||
// we add chord-subnotes to note if either note is a base-note and
|
||||
// arpeggio is not used or note is part of an arpeggio
|
||||
// at the same time we only add sub-notes if nothing of the note was
|
||||
@@ -186,13 +245,13 @@ void ChordCreator::processNote( notePlayHandle * _n )
|
||||
// create it in the following loop, then we loop until
|
||||
// there's a -1 in the interval-array
|
||||
for( int i = ( octave_cnt == 0 ) ? 1 : 0;
|
||||
s_chordTable[selected_chord].interval[i] != -1;
|
||||
i < chord_table[selected_chord].size();
|
||||
++i )
|
||||
{
|
||||
// add interval to sub-note-key
|
||||
const int sub_note_key = sub_note_key_base +
|
||||
(int) s_chordTable[
|
||||
selected_chord].interval[i];
|
||||
(int) chord_table[
|
||||
selected_chord][i];
|
||||
// maybe we're out of range -> let's get outta
|
||||
// here!
|
||||
if( sub_note_key > NumKeys )
|
||||
@@ -255,11 +314,10 @@ Arpeggiator::Arpeggiator( Model * _parent ) :
|
||||
m_arpDirectionModel( this, tr( "Arpeggio direction" ) ),
|
||||
m_arpModeModel( this, tr( "Arpeggio mode" ) )
|
||||
{
|
||||
for( int i = 0; ChordCreator::s_chordTable[i].interval[0] != -1; ++i )
|
||||
const ChordCreator::ChordTable & chord_table = ChordCreator::ChordTable::getInstance();
|
||||
for( int i = 0; i < chord_table.size(); ++i )
|
||||
{
|
||||
m_arpModel.addItem( ChordCreator::tr(
|
||||
ChordCreator::s_chordTable[i].
|
||||
name.toUtf8().constData() ) );
|
||||
m_arpModel.addItem( chord_table[i].getName() );
|
||||
}
|
||||
|
||||
m_arpDirectionModel.addItem( tr( "Up" ), new PixmapLoader( "arp_up" ) );
|
||||
@@ -314,8 +372,8 @@ void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
}
|
||||
}
|
||||
|
||||
const int cur_chord_size = ChordCreator::getChordSize(
|
||||
ChordCreator::s_chordTable[selected_arp] );
|
||||
const ChordCreator::ChordTable & chord_table = ChordCreator::ChordTable::getInstance();
|
||||
const int cur_chord_size = chord_table[selected_arp].size();
|
||||
const int range = (int)( cur_chord_size * m_arpRangeModel.value() );
|
||||
const int total_range = range * cnphv.size();
|
||||
|
||||
@@ -401,8 +459,7 @@ void Arpeggiator::processNote( notePlayHandle * _n )
|
||||
const int sub_note_key = base_note_key + (cur_arp_idx /
|
||||
cur_chord_size ) *
|
||||
KeysPerOctave +
|
||||
ChordCreator::s_chordTable[selected_arp].
|
||||
interval[cur_arp_idx % cur_chord_size];
|
||||
chord_table[selected_arp][cur_arp_idx % cur_chord_size];
|
||||
|
||||
// range-checking
|
||||
if( sub_note_key >= NumKeys ||
|
||||
|
||||
@@ -87,6 +87,13 @@ InstrumentSoundShaping::InstrumentSoundShaping(
|
||||
m_filterModel.addItem( tr( "Allpass" ), new PixmapLoader( "filter_ap" ) );
|
||||
m_filterModel.addItem( tr( "Moog" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "2x LowPass" ), new PixmapLoader( "filter_2lp" ) );
|
||||
m_filterModel.addItem( tr( "RC LowPass 12dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "RC BandPass 12dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "RC HighPass 12dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filterModel.addItem( tr( "RC LowPass 24dB" ), new PixmapLoader( "filter_lp" ) );
|
||||
m_filterModel.addItem( tr( "RC BandPass 24dB" ), new PixmapLoader( "filter_bp" ) );
|
||||
m_filterModel.addItem( tr( "RC HighPass 24dB" ), new PixmapLoader( "filter_hp" ) );
|
||||
m_filterModel.addItem( tr( "Vocal Formant Filter" ), new PixmapLoader( "filter_hp" ) );
|
||||
}
|
||||
|
||||
|
||||
|
||||