Skip to content

Commit

Permalink
Added scaling of level meter (#59)
Browse files Browse the repository at this point in the history
* Added scaling of level meter

* Fix bypass

* Fix parameters in Ableton

* Share workflow with signed exe

* Share secret with reusable workflow

* Fix wrong env vars for macOS

* Bring back original macOS secret flow

* Bring back non-reusable workflow

* Bring back non-reusable workflow

* Fix documentation

---------

Co-authored-by: VOV3SH <[email protected]>
  • Loading branch information
vvvar and VOV3SH authored Mar 19, 2023
1 parent 59d46f6 commit 2da3242
Show file tree
Hide file tree
Showing 27 changed files with 351 additions and 187 deletions.
50 changes: 40 additions & 10 deletions .github/workflows/execute_merge_checks.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
name: Execute nmerger checks
run-name: "Merge checks for PR #${{ github.event.number }}"
name: Perform merge checks
on: pull_request

env:
BUILD_TYPE: Release
VST_TARGET_NAME: PeakEater_VST3
AU_TARGET_NAME: PeakEater_AU
LV2_TARGET_NAME: PeakEater_LV2
CLAP_TARGET_NAME: PeakEater_CLAP
JUCE_REVISION: 4e68af7
VERSION: 0.5.1
BUILD_ID: "${{ github.run_id }}.${{ github.run_number }}.${{ github.run_attempt }}"
MACOS_RELEASE_NAME: PeakEater_v0.6.0_macOS
WINDOWS_RELEASE_NAME: PeakEater_v0.6.0_Windows
LINUX_RELEASE_NAME: PeakEater_v0.6.0_Linux
jobs:
macos:
name: macOS
Expand All @@ -30,6 +31,30 @@ jobs:
which node
npm --version
which npm
- name: Install the Apple certificate and provisioning profile
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.MACOS_BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.MACOS_P12_PASSWORD }}
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.MACOS_BUILD_PROVISION_PROFILE_BASE64 }}
KEYCHAIN_PASSWORD: ${{ secrets.MACOS_KEYCHAIN_PASSWORD }}
run: |
# create variables
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificate and provisioning profile from secrets
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificate to keychain
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Install Python Dependencies
run: python -m pip install -r ${{github.workspace}}/requirements.txt
- name: Init Git Submodules
Expand All @@ -47,12 +72,17 @@ jobs:
- name: Build LV2
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --target ${{env.LV2_TARGET_NAME}}
- name: Package
run: python ${{github.workspace}}/Scripts/Release/MacOS.py --release_type=${{env.BUILD_TYPE}} --release_version=${{env.VERSION}}
env:
MACOS_APPLE_IDENTITY: ${{ secrets.MACOS_APPLE_IDENTITY }}
MACOS_APPLE_ID: ${{ secrets.MACOS_APPLE_ID }}
MACOS_APPLE_PASSWORD: ${{ secrets.MACOS_APPLE_PASSWORD }}
MACOS_APPLE_TEAM_ID: ${{ secrets.MACOS_APPLE_TEAM_ID }}
run: python ${{github.workspace}}/Scripts/Release/MacOS.py --release_type=${{env.BUILD_TYPE}} --sign_and_notarize=True --release_version=0.6.0
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: PeakEater_v${{env.VERSION}}_macOS_${{env.BUILD_ID}}
path: ${{github.workspace}}/build/release/PeakEater-${{env.VERSION}}.dmg
name: ${{ env.MACOS_RELEASE_NAME }}
path: ${{github.workspace}}/build/release/PeakEater-0.6.0.dmg

windows:
name: Windows
Expand All @@ -74,7 +104,7 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: PeakEater_v${{env.VERSION}}_Windows_${{env.BUILD_ID}}
name: ${{ env.WINDOWS_RELEASE_NAME }}
path: |
${{github.workspace}}/build/PeakEater_artefacts/${{env.BUILD_TYPE}}/VST3/PeakEater.vst3/Contents/x86_64-win/PeakEater.vst3
${{github.workspace}}/build/PeakEater_artefacts/${{env.BUILD_TYPE}}/LV2/PeakEater.lv2
Expand Down Expand Up @@ -105,8 +135,8 @@ jobs:
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: PeakEater_v${{env.VERSION}}_Linux_${{env.BUILD_ID}}
name: ${{ env.LINUX_RELEASE_NAME }}
path: |
${{github.workspace}}/build/PeakEater_artefacts/VST3/PeakEater.vst3/Contents/x86_64-linux/PeakEater.so
${{github.workspace}}/build/PeakEater_artefacts/LV2/PeakEater.lv2
${{github.workspace}}/build/PeakEater_artefacts/CLAP/PeakEater.clap
${{github.workspace}}/build/PeakEater_artefacts/CLAP/PeakEater.claps
14 changes: 7 additions & 7 deletions .github/workflows/publish_release_draft.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Publish Release Draft
run-name: Create release draft for v0.5.1
run-name: Create release draft for v0.6.0
on:
push:
branches:
Expand All @@ -12,9 +12,9 @@ env:
LV2_TARGET_NAME: PeakEater_LV2
CLAP_TARGET_NAME: PeakEater_CLAP
JUCE_REVISION: 4e68af7
MACOS_RELEASE_NAME: PeakEater_v0.5.1_macOS
WINDOWS_RELEASE_NAME: PeakEater_v0.5.1_Windows
LINUX_RELEASE_NAME: PeakEater_v0.5.1_Linux
MACOS_RELEASE_NAME: PeakEater_v0.6.0_macOS
WINDOWS_RELEASE_NAME: PeakEater_v0.6.0_Windows
LINUX_RELEASE_NAME: PeakEater_v0.6.0_Linux
jobs:
macos:
name: macOS
Expand Down Expand Up @@ -81,12 +81,12 @@ jobs:
MACOS_APPLE_ID: ${{ secrets.MACOS_APPLE_ID }}
MACOS_APPLE_PASSWORD: ${{ secrets.MACOS_APPLE_PASSWORD }}
MACOS_APPLE_TEAM_ID: ${{ secrets.MACOS_APPLE_TEAM_ID }}
run: python ${{github.workspace}}/Scripts/Release/MacOS.py --release_type=${{env.BUILD_TYPE}} --sign_and_notarize=True --release_version=0.5.1
run: python ${{github.workspace}}/Scripts/Release/MacOS.py --release_type=${{env.BUILD_TYPE}} --sign_and_notarize=True --release_version=0.6.0
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ env.MACOS_RELEASE_NAME }}
path: ${{github.workspace}}/build/release/PeakEater-0.5.1.dmg
path: ${{github.workspace}}/build/release/PeakEater-0.6.0.dmg

windows:
name: Windows
Expand Down Expand Up @@ -183,5 +183,5 @@ jobs:
draft: true
removeArtifacts: true
makeLatest: true
tag: "v0.5.1"
tag: "v0.6.0"
artifacts: "${{ env.MACOS_RELEASE_NAME }}.zip,${{ env.WINDOWS_RELEASE_NAME }}.zip,${{ env.LINUX_RELEASE_NAME }}.zip"
3 changes: 2 additions & 1 deletion .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"cStandard": "c17",
"cppStandard": "c++17",
"intelliSenseMode": "macos-clang-x64",
"compileCommands": "${workspaceFolder}/build/compile_commands.json"
"compileCommands": "${workspaceFolder}/build/compile_commands.json",
"configurationProvider": "ms-vscode.cmake-tools"
}
],
"version": 4
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
* - Release
* - Debug
*/
"peakeater.config": "Debug",
"peakeater.config": "Release",
"[cpp]": {
"editor.defaultFormatter": "zachflower.uncrustify"
},
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
cmake_minimum_required(VERSION 3.15)
project(PeakEater VERSION 0.5.1)
project(PeakEater VERSION 0.6.0)
set(CMAKE_CXX_STANDARD 20)

add_subdirectory(Dependencies/JUCE)
add_subdirectory(Dependencies/clap-juce-extensions EXCLUDE_FROM_ALL)
add_subdirectory(Dependencies/clap-juce-extensions EXCLUDE_FROM_ALL)

juce_add_plugin(PeakEater
PLUGIN_MANUFACTURER_CODE Tado
Expand All @@ -30,6 +30,7 @@ target_sources(PeakEater
Source/GUIv2/dial/ceilingdial/CeilingDialLookAndFeel.cpp
Source/GUIv2/linkinout/LinkInOut.cpp
Source/GUIv2/bypass/BypassButton.cpp
Source/GUIv2/scaling/ScalingSwitch.cpp
Source/GUIv2/levelmeter/LevelMeterComponent.cpp
Source/GUIv2/analyser/peakanalyzer/PeakMeter.cpp
Source/GUIv2/analyser/peakanalyzer/PeakAnalyzerComponent.cpp
Expand Down
82 changes: 37 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,34 @@

<!-- TABLE OF CONTENTS -->

<details open="open">
<summary>Table of Contents</summary>
<ol>
<li><a href="#about">About</a></li>
<li>
<a href="#features">Features</a>
<ul>
<li><a href="#input--output-rms-meters">Input/Output RMS Meters</a></li>
<li><a href="#input--output-gain">Input & Output Gain</a></li>
<li><a href="#link-input-with-output">Link Input with Output</a></li>
<li><a href="#ceiling-control">Ceiling control</a></li>
<li><a href="#visualizer">Visualizer</a></li>
<li><a href="#analyzer">Analyzer</a></li>
<li><a href="#switchable-scales">Switchable scales</a></li>
<li><a href="#6-clipping-types">6 Clipping Types</a></li>
<li><a href="#oversampling">Oversampling</a></li>
<li><a href="#bypass-mode">Bypass mode</a></li>
<li><a href="#resizing">Resizing</a></li>
<li><a href="#vst3-au-lv2-and-clap-support">VST3, AU, LV2 and CLAP Support</a></li>
<li><a href="#available-on-all-major-platforms">macOS, Windows and Linux Support</a></li>
</ul>
</li>
<li>
<a href="#installation">Installation</a>
<ul>
<li><a href="#macos">macOS</a></li>
<li><a href="#windows">Windows</a></li>
<li><a href="#linux">Linux</a></li>
</ul>
</li>
<li>
<a href="#building-from-sources">Building from sources</a>
<ul>
<li><a href="#prerequisites">Prerequisites</a></li>
<li><a href="#build">Build</a></li>
</ul>
</li>
<li><a href="#contributing">Contributing</a></li>
<li><a href="#license">License</a></li>
<li><a href="#acknowledgements">Acknowledgements</a></li>
</ol>
</details>
Table of Contents

- [About](#about)
- [Features](#features)
- [Input/Output RMS Meters](#rms-meters)
- [Input & Output Gain](#input--output-gain)
- [Link Input with Output](#link-input-with-output)
- [Ceiling Control](#ceiling-control)
- [Visualizer](#visualizer)
- [Analyzer](#analyzer)
- [Configurable Tickmarks](#configurable-tickmarks)
- [Configurable Scaling](#configurable-scaling)
- [6 Clipping Types](#6-clipping-types)
- [Oversampling](#oversampling)
- [Bypass Mode](#bypass-mode)
- [Resizing](#resizing)
- [VST3, AU, LV2 and CLAP Support](#vst3-au-lv2-and-clap-support)
- [macOS, Windows and Linux Support](#available-on-all-major-platforms)
- [Installation](#installation)
- [macOS](#macos)
- [Windows](#windows)
- [Linux](#linux)
- [Building from sources](#building-from-sources)
- [Prerequisites](#prerequisites)
- [Build](#build)
- [Contributing](#contributing)
- [License](#license)
- [Acknowledgements](#acknowledgements)

<!-- ABOUT -->

Expand All @@ -63,7 +49,7 @@ PeakEater is a free, easy to use waveshaping plugin. PeakEater lets you choose b

## Features

### Input & Output RMS Meters
### RMS Meters

<img src="Resources/screenshots/screenshot-in.png" alt="input-rms-screen" height="250"/><---><img src="Resources/screenshots/screenshot-out.png" alt="output-rms-screen" height="250"/>

Expand Down Expand Up @@ -99,11 +85,17 @@ Displays magnitude(in dB's) so you can see how peaks were eaten over time.

Shows approximated RMS that was cut("Eaten") in last 2 seconds and current clipping algorithm. Double-click on numbers to drop it to zero and force to re-calculate.

### Switchable scales
### Configurable Tickmarks

<img src="Resources/screenshots/screenshot-switch-ticks.gif" alt="switch-db-level-scales" width="400"/>

Right click on Visualizer to switch between different scales.
Right-Mouse-Click on Visualizer to switch between different tickmarks.

## Configurable Scaling

<img src="Resources/screenshots/screenshot-scaling.gif" alt="switch-db-level-scales" width="400"/>

Also, you can switch between linear and non-linear scaling.

### 6 Clipping Types

Expand Down
Binary file modified Resources/screenshots/screenshot-mac.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Resources/screenshots/screenshot-scaling.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Resources/screenshots/screenshot-switch-ticks.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Scripts/Release/configs/inno-config.iss
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Setup]
AppName=PeakEater
AppVersion=0.5.1
AppVersion=0.6.0
DefaultDirName={cf}
DefaultGroupName=PeakEater
OutputBaseFilename=PeakEater-windows
Expand Down
2 changes: 1 addition & 1 deletion Scripts/Release/configs/wix-config.wxs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="12345678-1111-2222-3333-666666666666" Name="PeakEater" Version="0.5.1.0" Manufacturer="T-Audio" Language="1033">
<Product Id="*" UpgradeCode="12345678-1111-2222-3333-666666666666" Name="PeakEater" Version="0.6.0.0" Manufacturer="T-Audio" Language="1033">
<Package InstallerVersion="200" InstallScope="perMachine" Compressed="yes" Comments="PeakEater is a free open-source VST3/AU waveshaper plugin"/>
<MediaTemplate EmbedCab="yes" />

Expand Down
17 changes: 7 additions & 10 deletions Source/DSP/LevelMeter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,42 @@ namespace dsp
{
namespace
{
float constexpr gDefaultLevel = 0.0f;
float constexpr gMinusInfinity = -36.0f;

template <typename T>
T gMagnitudeToDecibels (T const& magnitude)
{
// return 20.0f * std::log10 (magnitude);
return juce::Decibels::gainToDecibels<T> (magnitude, gMinusInfinity);
}

template <typename T>
T gCalculateAmplification (int const& channelIndex, juce::AudioBuffer<T> const& buffer)
T gCalculateAmplification (juce::AudioBuffer<T> const& buffer)
{
// return buffer.getRMSLevel (channelIndex, 0, buffer.getNumSamples());
return buffer.getMagnitude (0, buffer.getNumSamples());
}

template <typename T>
T gCalculateDecibels (juce::AudioBuffer<T> const& buffer)
{
auto const magnitude = gCalculateAmplification (0, buffer);
auto const magnitude = gCalculateAmplification (buffer);
return gMagnitudeToDecibels (magnitude);
}
} // namespace

template <typename T>
LevelMeter<T>::LevelMeter()
: mDecibels (gDefaultLevel)
, mAmplificationL (gDefaultLevel)
, mAmplificationR (gDefaultLevel)
: mDecibels (gMinusInfinity)
, mAmplificationL (gMinusInfinity)
, mAmplificationR (gMinusInfinity)
{
}

template <typename T>
void LevelMeter<T>::updateLevels (juce::AudioBuffer<T> const& buffer)
{
mDecibels = gCalculateDecibels (buffer);
mAmplificationL = gCalculateAmplification (0, buffer);
mAmplificationR = gCalculateAmplification (1, buffer);
mAmplificationL = gCalculateAmplification (buffer);
mAmplificationR = gCalculateAmplification (buffer);
}

template <typename T>
Expand Down
8 changes: 8 additions & 0 deletions Source/GUIv2/CentralPanel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ CentralPanel::CentralPanel (std::shared_ptr<juce::AudioProcessorValueTreeState>
, mControlPanel (parameters, inputLevelMeter, clippingLevelMeter, outputLevelMeter)
, mLinkingPanel (parameters, inputLevelMeter, clippingLevelMeter, outputLevelMeter)
, mAnalyserComponent (parameters, inputLevelMeter, clippingLevelMeter, outputLevelMeter)
, mScalingSwitch(ticks)
{
addAndMakeVisible (mClipMeter);
addAndMakeVisible (mControlPanel);
addAndMakeVisible (mLinkingPanel);
addAndMakeVisible (mAnalyserComponent);
addAndMakeVisible (mScalingSwitch);
}

void CentralPanel::resized()
Expand Down Expand Up @@ -46,6 +48,12 @@ void CentralPanel::resized()
.withHeight(localBounds.proportionOfHeight (0.155f))
.withX(localBounds.proportionOfWidth (0.1f))
.withY(localBounds.proportionOfHeight (0.05f)));

mScalingSwitch.setBounds(localBounds
.withWidth(localBounds.proportionOfWidth(0.076f))
.withHeight(localBounds.proportionOfWidth(0.076f))
.withX(localBounds.proportionOfWidth (0.84f))
.withY(localBounds.proportionOfHeight (0.71f)));
}
} // namespace gui
} // namespace pe
2 changes: 2 additions & 0 deletions Source/GUIv2/CentralPanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "LinkingPanel.h"
#include "analyser/AnalyserComponent.h"
#include "clipmeter/ClipMeter.h"
#include "scaling/ScalingSwitch.h"

namespace pe
{
Expand All @@ -31,6 +32,7 @@ ClipMeter mClipMeter;
ControlPanel mControlPanel;
LinkingPanel mLinkingPanel;
AnalyserComponent mAnalyserComponent;
ScalingSwitch mScalingSwitch;

JUCE_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR (CentralPanel)
};
Expand Down
Loading

0 comments on commit 2da3242

Please sign in to comment.