1818
1919#include " DistrhoPluginNekobi.hpp"
2020
21- extern " C" {
2221
2322#include " nekobee-src/nekobee_synth.c"
2423#include " nekobee-src/nekobee_voice.c"
@@ -31,7 +30,7 @@ extern "C" {
3130bool dssp_voicelist_mutex_trylock (nekobee_synth_t * const synth)
3231{
3332 /* Attempt the mutex lock */
34- if (pthread_mutex_trylock (& synth->voicelist_mutex ) != 0 )
33+ if (! synth->voicelist_mutex . try_lock () )
3534 {
3635 synth->voicelist_mutex_grab_failed = 1 ;
3736 return false ;
@@ -47,9 +46,9 @@ bool dssp_voicelist_mutex_trylock(nekobee_synth_t* const synth)
4746 return true ;
4847}
4948
50- bool dssp_voicelist_mutex_unlock (nekobee_synth_t * const synth)
49+ void dssp_voicelist_mutex_unlock (nekobee_synth_t * const synth)
5150{
52- return ( pthread_mutex_unlock (& synth->voicelist_mutex ) == 0 );
51+ synth->voicelist_mutex . unlock ( );
5352}
5453
5554// -----------------------------------------------------------------------
@@ -79,7 +78,6 @@ void nekobee_handle_raw_event(nekobee_synth_t* const synth, const uint8_t size,
7978 }
8079}
8180
82- } /* extern "C" */
8381
8482START_NAMESPACE_DISTRHO
8583
@@ -109,7 +107,6 @@ DistrhoPluginNekobi::DistrhoPluginNekobi()
109107
110108 fSynth .voice = nekobee_voice_new ();
111109 fSynth .voicelist_mutex_grab_failed = 0 ;
112- pthread_mutex_init (&fSynth .voicelist_mutex , nullptr );
113110
114111 fSynth .channel_pressure = 0 ;
115112 fSynth .pitch_wheel_sensitivity = 0 ;
@@ -299,7 +296,7 @@ void DistrhoPluginNekobi::setParameterValue(uint32_t index, float value)
299296 break ;
300297 case paramTuning:
301298 fParams .tuning = value;
302- fSynth .tuning = ( value+ 12 .0f )/ 24 . 0f * 1.5 + 0 . 5f ; // FIXME: log?
299+ fSynth .tuning = exp2f ( value / 12 .0f );
303300 DISTRHO_SAFE_ASSERT (fSynth .tuning >= 0 .5f && fSynth .tuning <= 2 .0f );
304301 break ;
305302 case paramCutoff:
0 commit comments