Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with pitch bend range #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ set(target vstsid)
set(copyright "igorski.nl 2018-2023")
set(major_version 1)
set(minor_version 1)
set(release_number 1)
set(release_number 2)
set(build_number 1) # TODO supply through CLI (build number is not included in public facing version strings)
set(SMTG_CREATE_MODULE_INFO false)

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ You can copy the build output into your system VST(3) folder and run it directly
When debugging, you can also choose to run the plugin against Steinbergs validator and editor host utilities:

```
{VST3_SDK_ROOT}/build/bin/validator build/VST3/vstsid.vst3
{VST3_SDK_ROOT}/build/bin/validator build/VST3/*.vst3
{VST3_SDK_ROOT}/build/bin/editorhost build/VST3/vstsid.vst3
```

Expand Down
6 changes: 4 additions & 2 deletions src/vst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ VSTSID::VSTSID ()
, fLFORate( 0.f )
, fLFODepth( 1.f )
, fRingModRate( 0.f )
, fMasterTuning( 0.f )
, fPitchBendRange( 1.f )
, fPortamento( 0.f )
, currentProcessMode( -1 ) // -1 means not initialized
Expand Down Expand Up @@ -349,7 +350,7 @@ tresult PLUGIN_API VSTSID::setState( IBStream* state )
fPitchBendRange = savedPBrange;
}

float savedPortamento = 0;
float savedPortamento = 0.f;
if ( streamer.readFloat( savedPortamento ) != false ) {
fPortamento = savedPortamento;
}
Expand Down Expand Up @@ -549,7 +550,8 @@ void VSTSID::initPlugin( float sampleRate )

void VSTSID::scaleTuning()
{
_scaledTuning = Calc::pitchShiftFactor( fMasterTuning * round( fPitchBendRange * VST::MAX_PITCH_BEND ));
float roundedPitchBend = round( fPitchBendRange * VST::MAX_PITCH_BEND );
_scaledTuning = Calc::pitchShiftFactor( fMasterTuning == 0 ? roundedPitchBend : fMasterTuning * roundedPitchBend );
}

void VSTSID::syncModel()
Expand Down