From 6277410e9f3b3fd28c9e3e4a844c02d6baa323c6 Mon Sep 17 00:00:00 2001 From: Oskar Wallgren Date: Fri, 9 Sep 2016 04:13:12 +0200 Subject: [PATCH] fixup --- src/core/InstrumentFunctions.cpp | 7 +++---- src/gui/widgets/InstrumentFunctionViews.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/core/InstrumentFunctions.cpp b/src/core/InstrumentFunctions.cpp index d29c4b01a6a..886edf2d8e7 100644 --- a/src/core/InstrumentFunctions.cpp +++ b/src/core/InstrumentFunctions.cpp @@ -412,7 +412,7 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) if( m_arpSkipModel.value() ) { - if( 101 * ( (float) rand() / (float) RAND_MAX ) < m_arpSkipModel.value() ) + if( 100 * ( (float) rand() / (float)( RAND_MAX + 1.0f ) ) < m_arpSkipModel.value() ) { if( cur_arp_idx == 0 ) { @@ -430,10 +430,9 @@ void InstrumentFunctionArpeggio::processNote( NotePlayHandle * _n ) // Miss notes randomly. We intercept int dir and abuse it // after need. :) - int miss = m_arpMissModel.value(); - if( miss ) + if( m_arpMissModel.value() ) { - if( 100 * ( (float) rand() / (float) RAND_MAX ) < ( miss * miss ) / 100 ) + if( 100 * ( (float) rand() / (float)( RAND_MAX + 1.0f ) ) < m_arpMissModel.value() ) { dir = ArpDirRandom; } diff --git a/src/gui/widgets/InstrumentFunctionViews.cpp b/src/gui/widgets/InstrumentFunctionViews.cpp index 66fd6b2bd0a..b5fd931c6b9 100644 --- a/src/gui/widgets/InstrumentFunctionViews.cpp +++ b/src/gui/widgets/InstrumentFunctionViews.cpp @@ -140,16 +140,16 @@ InstrumentFunctionArpeggioView::InstrumentFunctionArpeggioView( InstrumentFuncti m_arpSkipKnob->setLabel( tr( "SKIP" ) ); - m_arpSkipKnob->setHintText( tr( "Fail rate:" ) + " ", " " + tr( "%" ) ); + m_arpSkipKnob->setHintText( tr( "Skip rate:" ) + " ", " " + tr( "%" ) ); m_arpSkipKnob->setWhatsThis( tr( "The skip function will make the arpeggiator pause one step " - "randomly. From it's start in full counter clockwise " + "randomly. From its start in full counter clockwise " "position and no effect it will gradually progress to " - "more or less full amnesia at maximum setting.") ); + "full amnesia at maximum setting.") ); m_arpMissKnob->setLabel( tr( "MISS" ) ); - m_arpMissKnob->setHintText( tr( "Fail rate:" ) + " ", " " + tr( "%" ) ); + m_arpMissKnob->setHintText( tr( "Miss rate:" ) + " ", " " + tr( "%" ) ); m_arpMissKnob->setWhatsThis( tr( "The miss function will make the arpeggiator miss the " "intended note.") );