Skip to content

Commit

Permalink
fix slider 'slipping'
Browse files Browse the repository at this point in the history
Sliders display linear, but set exponential - like MIDI sliders
  • Loading branch information
jrsurge committed Aug 31, 2017
1 parent 6a5f624 commit 2f4cfbd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Classes/Components/SuperDiffuse_ControlFader.sc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SuperDiffuse_ControlFader : SuperDiffuse_Subject {
// They are scaled here to have an exponential response
value_ { | v |
m_value = v.pow(2);
AppClock.sched(0,{m_slider.value_(m_value)});
AppClock.sched(0,{m_slider.value_(v)});
}

valueAction_ { | v |
Expand Down Expand Up @@ -91,6 +91,7 @@ SuperDiffuse_ControlFader : SuperDiffuse_Subject {
//m_midiLearnButton.free;

m_layout = VLayout();
// Slider displays linearly, but values are actually exponential - this stops graphical 'slipping' when moving manually
m_slider = Slider().maxWidth_(50).action_({|v| this.valueAction_(v.value)}).value_(this.value);
//m_midiLearnButton = Button().maxWidth_(50).states_([["L"]]).action_({ this.learn; });
m_layout.add(m_slider,align:\center);
Expand Down

0 comments on commit 2f4cfbd

Please sign in to comment.