Skip to content

Commit

Permalink
Merge pull request #142 from DamRsn/damien/prepare_1.1.0_update
Browse files Browse the repository at this point in the history
1.1.0 update
  • Loading branch information
DamRsn authored Jan 11, 2025
2 parents 5d54522 + aae3228 commit 113f058
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 86 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.16)
project(NeuralNotePlugin VERSION 1.0.0)
project(NeuralNotePlugin VERSION 1.1.0)

# C++ settings
set(CMAKE_CXX_STANDARD 17)
Expand Down Expand Up @@ -152,6 +152,7 @@ target_link_libraries(${BaseTargetName}

if (${LTO})
target_link_libraries(${BaseTargetName} PUBLIC juce_recommended_lto_flags)
message(STATUS "Link Time Optimization (LTO) enabled")
endif ()

if (BUILD_UNIT_TESTS)
Expand Down
6 changes: 3 additions & 3 deletions Installers/Mac/NeuralNote.pkgproj
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>1.0.0</string>
<string>1.1.0</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down Expand Up @@ -1068,7 +1068,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>1.0.0</string>
<string>1.1.0</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down Expand Up @@ -1636,7 +1636,7 @@
<key>USE_HFS+_COMPRESSION</key>
<false/>
<key>VERSION</key>
<string>1.0.0</string>
<string>1.1.0</string>
</dict>
<key>TYPE</key>
<integer>0</integer>
Expand Down
2 changes: 1 addition & 1 deletion Installers/Windows/neuralnote.iss
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

[Setup]
AppName=NeuralNote
AppVersion=1.0.0
AppVersion=1.1.0
OutputBaseFilename=NeuralNoteInstaller
DefaultDirName={pf}\NeuralNote
DefaultGroupName=NeuralNote
Expand Down
27 changes: 1 addition & 26 deletions Installers/license.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
NeuralNote is licensed under the Apache-2.0 License.
Source code is available at: https://github.com/DamRsn/NeuralNote
Copyright 2024 Damien Ronssin
Copyright 2025 Damien Ronssin


Apache License
Expand Down Expand Up @@ -179,28 +179,3 @@ Copyright 2024 Damien Ronssin
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
6 changes: 3 additions & 3 deletions Lib/Model/BasicPitch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ void BasicPitch::reset()
mNumFrames = 0;
}

void BasicPitch::setParameters(float inNoteSensibility, float inSplitSensibility, float inMinNoteDurationMs)
void BasicPitch::setParameters(float inNoteSensitivity, float inSplitSensitivity, float inMinNoteDurationMs)
{
mParams.frameThreshold = 1.0f - inNoteSensibility;
mParams.onsetThreshold = 1.0f - inSplitSensibility;
mParams.frameThreshold = 1.0f - inNoteSensitivity;
mParams.onsetThreshold = 1.0f - inSplitSensitivity;

mParams.minNoteLengthFrames =
static_cast<int>(std::round(inMinNoteDurationMs / 1000.0f / (FFT_HOP / BASIC_PITCH_SAMPLE_RATE)));
Expand Down
6 changes: 3 additions & 3 deletions Lib/Model/BasicPitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ class BasicPitch

/**
* Set parameters for next transcription or midi update.
* @param inNoteSensibility Note sensibility threshold (0.05, 0.95). Higher gives more notes.
* @param inSplitSensibility Split sensibility threshold (0.05, 0.95). Higher will split note more, lower will merge close notes with same pitch
* @param inNoteSensitivity Note sensitivity threshold (0.05, 0.95). Higher gives more notes.
* @param inSplitSensitivity Split sensitivity threshold (0.05, 0.95). Higher will split note more, lower will merge close notes with same pitch
* @param inMinNoteDurationMs Minimum note duration to keep in ms.
*/
void setParameters(float inNoteSensibility, float inSplitSensibility, float inMinNoteDurationMs);
void setParameters(float inNoteSensitivity, float inSplitSensitivity, float inMinNoteDurationMs);

/**
* Transcribe the input audio. The note event vector can be obtained after this with getNoteEvents
Expand Down
2 changes: 1 addition & 1 deletion NeuralNote/Source/Components/NumericTextEditor.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class NumericTextEditor
Desktop::getInstance().removeGlobalMouseListener(this);
};

setText(numberToStr(mProcessor->getValueTree().getProperty(inPropIdentifier)), false);
setText(numberToStr(mProcessor->getValueTree().getProperty(mIdentifier)), false);

mProcessor->addListenerToStateValueTree(this);
}
Expand Down
20 changes: 10 additions & 10 deletions NeuralNote/Source/Components/Views/TranscriptionOptionsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
TranscriptionOptionsView::TranscriptionOptionsView(NeuralNoteAudioProcessor& processor)
: mProcessor(processor)
{
mNoteSensibility =
std::make_unique<Knob>(*mProcessor.getParams()[ParameterHelpers::NoteSensibilityId], "NOTE SENSIBILITY", false);
mNoteSensibility->setTooltip(NeuralNoteTooltips::to_note_sensibility);
addAndMakeVisible(*mNoteSensibility);
mNoteSensitivity =
std::make_unique<Knob>(*mProcessor.getParams()[ParameterHelpers::NoteSensitivityId], "NOTE SENSITIVITY", false);
mNoteSensitivity->setTooltip(NeuralNoteTooltips::to_note_sensitivity);
addAndMakeVisible(*mNoteSensitivity);

mSplitSensibility = std::make_unique<Knob>(
*mProcessor.getParams()[ParameterHelpers::SplitSensibilityId], "SPLIT SENSIBILITY", false);
mSplitSensibility->setTooltip(NeuralNoteTooltips::to_split_sensibility);
addAndMakeVisible(*mSplitSensibility);
mSplitSensitivity = std::make_unique<Knob>(
*mProcessor.getParams()[ParameterHelpers::SplitSensitivityId], "SPLIT SENSITIVITY", false);
mSplitSensitivity->setTooltip(NeuralNoteTooltips::to_split_sensitivity);
addAndMakeVisible(*mSplitSensitivity);

mMinNoteDuration = std::make_unique<Knob>(
*mProcessor.getParams()[ParameterHelpers::MinimumNoteDurationId], "MIN NOTE DURATION", false, " ms");
Expand All @@ -38,8 +38,8 @@ void TranscriptionOptionsView::resized()
{
int button_y_start = 40;

mNoteSensibility->setBounds(18, button_y_start, 66, 89);
mSplitSensibility->setBounds(106, button_y_start, 66, 89);
mNoteSensitivity->setBounds(18, button_y_start, 66, 89);
mSplitSensitivity->setBounds(106, button_y_start, 66, 89);
mMinNoteDuration->setBounds(193, button_y_start, 66, 89);
mPitchBendDropDown->setBounds(100, 129 + LEFT_SECTIONS_TOP_PAD, 154, 17);
}
Expand Down
4 changes: 2 additions & 2 deletions NeuralNote/Source/Components/Views/TranscriptionOptionsView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class TranscriptionOptionsView : public juce::Component
private:
NeuralNoteAudioProcessor& mProcessor;

std::unique_ptr<Knob> mNoteSensibility;
std::unique_ptr<Knob> mSplitSensibility;
std::unique_ptr<Knob> mNoteSensitivity;
std::unique_ptr<Knob> mSplitSensitivity;
std::unique_ptr<Knob> mMinNoteDuration;

std::unique_ptr<juce::ComboBox> mPitchBendDropDown;
Expand Down
4 changes: 2 additions & 2 deletions NeuralNote/Source/NeuralNoteTooltips.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
namespace NeuralNoteTooltips
{
// Transcription options
const String to_note_sensibility = "Set note sensibility\n"
const String to_note_sensitivity = "Set note sensitivity\n"
"Higher values will detect more notes";

const String to_split_sensibility = "Set split sensibility\n"
const String to_split_sensitivity = "Set split sensitivity\n"
"Higher values result in more splits\nLower values results in longer held notes";

const String to_min_note_duration = "Set minimum note duration\n"
Expand Down
43 changes: 30 additions & 13 deletions NeuralNote/Source/ParameterHelpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
namespace ParameterHelpers
{

static constexpr int versionHint = 1;
static constexpr int versionHint = 2;

enum ParamIdEnum {
MuteId = 0,
NoteSensibilityId,
SplitSensibilityId,
NoteSensitivityId,
SplitSensitivityId,
MinimumNoteDurationId,
PitchBendModeId,
AudioPlayerGainId,
Expand All @@ -36,8 +36,8 @@ enum ParamIdEnum {
};

static const StringArray ParamIdStr {"MUTE",
"NOTE_SENSIBILITY",
"SPLIT_SENSIBILITY",
"NOTE_SENSITIVITY",
"SPLIT_SENSITIVITY",
"MINIMUM_NOTE_DURATION",
"PITCH_BEND_MODE",
"AUDIO_PLAYER_GAIN",
Expand All @@ -57,10 +57,10 @@ inline String toName(ParamIdEnum id)
switch (id) {
case MuteId:
return "Mute";
case NoteSensibilityId:
return "Note Sensibility";
case SplitSensibilityId:
return "Split Sensibility";
case NoteSensitivityId:
return "Note Sensitivity";
case SplitSensitivityId:
return "Split Sensitivity";
case MinimumNoteDurationId:
return "Min Note Duration";
case PitchBendModeId:
Expand Down Expand Up @@ -95,7 +95,7 @@ inline String toName(ParamIdEnum id)

inline const String& getIdStr(ParamIdEnum id)
{
return ParamIdStr[id];
return ParamIdStr[static_cast<int>(id)];
}

inline ParameterID toJuceParameterID(ParamIdEnum id)
Expand All @@ -113,10 +113,10 @@ inline std::unique_ptr<RangedAudioParameter> getRangedAudioParamForID(ParamIdEnu
switch (id) {
case MuteId:
return std::make_unique<AudioParameterBool>(toJuceParameterID(id), toName(id), false);
case NoteSensibilityId:
case NoteSensitivityId:
return std::make_unique<AudioParameterFloat>(
toJuceParameterID(id), toName(id), NormalisableRange<float>(0.05f, 0.95f, 0.01f), 0.7f);
case SplitSensibilityId:
case SplitSensitivityId:
return std::make_unique<AudioParameterFloat>(
toJuceParameterID(id), toName(id), NormalisableRange<float>(0.05f, 0.95f, 0.01f), 0.5f);
case MinimumNoteDurationId:
Expand Down Expand Up @@ -171,6 +171,19 @@ inline AudioProcessorValueTreeState::ParameterLayout createParameterLayout()
return {params.begin(), params.end()};
}

/**
* Migration from version hint 1 to 2 (for version >= v1.1.0). Changed "sensibility" to "sensitivity".
* @param inParamId The potentially old parameter id, modified in place if necessary.
*/
inline void _migrationVersionHint1To2(String& inParamId)
{
if (inParamId == "NOTE_SENSIBILITY") {
inParamId = getIdStr(NoteSensitivityId);
} else if (inParamId == "SPLIT_SENSIBILITY") {
inParamId = getIdStr(SplitSensitivityId);
}
}

inline void updateParametersFromState(const ValueTree& inParameterTree,
std::array<RangedAudioParameter*, TotalNumParams>& inParams)
{
Expand All @@ -182,7 +195,10 @@ inline void updateParametersFromState(const ValueTree& inParameterTree,
if (child.isValid() && child.hasProperty(NnId::IdId) && child.hasProperty(NnId::ValueId)) {
auto param_id = child.getProperty(NnId::IdId).toString();

int index = ParameterHelpers::ParamIdStr.indexOf(param_id);
// Migration from hint 1 to 2 (sensibility to sensitivity)
_migrationVersionHint1To2(param_id);

int index = ParamIdStr.indexOf(param_id);

if (index >= 0) {
auto* param = inParams[index];
Expand All @@ -197,6 +213,7 @@ inline void updateParametersFromState(const ValueTree& inParameterTree,
}
}
}

} // namespace ParameterHelpers

#endif //ParameterHelpers_h
5 changes: 4 additions & 1 deletion NeuralNote/Source/TimeQuantizeOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,10 @@ std::vector<Notes::Event> TimeQuantizeOptions::quantize(const std::vector<Notes:

void TimeQuantizeOptions::clear()
{
mTimeQuantizeInfo = TimeQuantizeInfo();
// Kepp bpm and time signature, reset ref positions
mTimeQuantizeInfo.refPositionQn = 0;
mTimeQuantizeInfo.refLastBarQn = 0;
mTimeQuantizeInfo.refPositionSeconds = 0;
mWasRecording = false;
mWasPlaying = false;
mNumRecordedSamples = 0;
Expand Down
16 changes: 8 additions & 8 deletions NeuralNote/Source/TranscriptionManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ TranscriptionManager::TranscriptionManager(NeuralNoteAudioProcessor* inProcessor

auto& apvts = mProcessor->getAPVTS();

apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::NoteSensibilityId), this);
apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::SplitSensibilityId), this);
apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::NoteSensitivityId), this);
apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::SplitSensitivityId), this);
apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::MinimumNoteDurationId), this);
apvts.addParameterListener(ParameterHelpers::getIdStr(ParameterHelpers::PitchBendModeId), this);

Expand Down Expand Up @@ -73,8 +73,8 @@ void TranscriptionManager::setLaunchNewTranscription()
void TranscriptionManager::parameterChanged(const String& parameterID, float newValue)
{
if (mProcessor->getState() == PopulatedAudioAndMidiRegions) {
if (parameterID == ParameterHelpers::getIdStr(ParameterHelpers::NoteSensibilityId)
|| parameterID == ParameterHelpers::getIdStr(ParameterHelpers::SplitSensibilityId)
if (parameterID == ParameterHelpers::getIdStr(ParameterHelpers::NoteSensitivityId)
|| parameterID == ParameterHelpers::getIdStr(ParameterHelpers::SplitSensitivityId)
|| parameterID == ParameterHelpers::getIdStr(ParameterHelpers::MinimumNoteDurationId)) {
mProcessor->getAPVTS().getRawParameterValue(parameterID)->store(newValue);
mShouldUpdateTranscription = true;
Expand All @@ -99,8 +99,8 @@ void TranscriptionManager::parameterChanged(const String& parameterID, float new

void TranscriptionManager::_runModel()
{
mBasicPitch.setParameters(mProcessor->getParameterValue(ParameterHelpers::NoteSensibilityId),
mProcessor->getParameterValue(ParameterHelpers::SplitSensibilityId),
mBasicPitch.setParameters(mProcessor->getParameterValue(ParameterHelpers::NoteSensitivityId),
mProcessor->getParameterValue(ParameterHelpers::SplitSensitivityId),
mProcessor->getParameterValue(ParameterHelpers::MinimumNoteDurationId));
mBasicPitch.transcribeToMIDI(
mProcessor->getSourceAudioManager()->getDownsampledSourceAudioForTranscription().getWritePointer(0),
Expand Down Expand Up @@ -138,8 +138,8 @@ void TranscriptionManager::_updateTranscription()
jassert(mProcessor->getState() == PopulatedAudioAndMidiRegions);

if (mProcessor->getState() == PopulatedAudioAndMidiRegions) {
mBasicPitch.setParameters(mProcessor->getParameterValue(ParameterHelpers::NoteSensibilityId),
mProcessor->getParameterValue(ParameterHelpers::SplitSensibilityId),
mBasicPitch.setParameters(mProcessor->getParameterValue(ParameterHelpers::NoteSensitivityId),
mProcessor->getParameterValue(ParameterHelpers::SplitSensitivityId),
mProcessor->getParameterValue(ParameterHelpers::MinimumNoteDurationId));

mBasicPitch.updateMIDI();
Expand Down
Binary file modified NeuralNote_UI.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion PACKAGING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Package NeuralNote for macOS

- Build the app, VST3 and AU in Release mode.
- Build the app, VST3 and AU in Release mode (don't forget to turn on universal binary (`-DUniversalBinary=ON`) and
LTO (`-DLTO=ON`).
- Install [Packages](http://s.sudre.free.fr/Software/Packages/about.html) if you don't have it already.
- Set up an Apple Developer certificate and load it into Keychain (for both the app and the installer).
- Run the `sign_and_package_neuralnote_macos.sh` script to sign the 3 artifacts and package them into a an
Expand Down
16 changes: 6 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ your favorite Digital Audio Workstation.

## Install NeuralNote

Download the latest release for your platform [here](https://github.com/DamRsn/NeuralNote/releases) (Windows and macOS (
Universal) supported)!
Download the latest release for your platform [here](https://github.com/DamRsn/NeuralNote/releases) (Windows, macOS (
Universal) and Linux supported)!

Installers are available for both Windows and Mac, including Standalone, VST3, and AU (Mac only) versions. The
installers allow users to select which format(s) they want to install. On macOS, the code is signed, while on Windows,
it is not. This means you may need to take a few additional steps to use NeuralNote on Windows.

For Linux, raw binaries are provided for VST3 and Standalone. You can install them by copying the files to the
appropriate locations.

## Usage

![UI](NeuralNote_UI.png)
Expand Down Expand Up @@ -119,14 +122,6 @@ But here's a description of the process we followed to create those files:

The original basic-pitch CNN was split in 4 sequential models wired together, so they can be run with RTNeural.

## Roadmap

- Improve stability
- UX improvements (zoom in/out, play/pause with spacebar, etc.)
- Add tooltips
- Make internal synth support pitch bends
- Linux support

## Bug reports and feature requests

If you have any request/suggestion concerning the plugin or encounter a bug, please file a GitHub issue.
Expand Down Expand Up @@ -177,3 +172,4 @@ Many thanks to the contributors!
- [trirpi](https://github.com/trirpi)
- More scale options in `SCALE QUANTIZE`.
- Horizontal zoom for the audio waveform and the piano roll.
- [polygon](https://github.com/polygon) and [SamuMazzi](https://github.com/SamuMazzi): Linux support.
2 changes: 1 addition & 1 deletion ThirdParty/JUCE
Submodule JUCE updated 497 files

0 comments on commit 113f058

Please sign in to comment.