mirror of
https://github.com/thestk/stk
synced 2026-01-16 22:31:52 +00:00
Version 4.4.2
This commit is contained in:
committed by
Stephen Sinclair
parent
b6a2202011
commit
baca57040b
@@ -19,7 +19,7 @@
|
||||
Alternately, control changes can be sent to all voices in a given
|
||||
group.
|
||||
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2009.
|
||||
by Perry R. Cook and Gary P. Scavone, 1995 - 2010.
|
||||
*/
|
||||
/***************************************************/
|
||||
|
||||
@@ -165,10 +165,10 @@ void Voicer :: setFrequency( long tag, StkFloat noteNumber )
|
||||
void Voicer :: pitchBend( StkFloat value, int group )
|
||||
{
|
||||
StkFloat pitchScaler;
|
||||
if ( value < 64.0 )
|
||||
pitchScaler = pow(0.5, (64.0-value)/64.0);
|
||||
if ( value < 8192.0 )
|
||||
pitchScaler = pow( 0.5, (8192.0-value) / 8192.0 );
|
||||
else
|
||||
pitchScaler = pow(2.0, (value-64.0)/64.0);
|
||||
pitchScaler = pow( 2.0, (value-8192.0) / 8192.0 );
|
||||
for ( unsigned int i=0; i<voices_.size(); i++ ) {
|
||||
if ( voices_[i].group == group )
|
||||
voices_[i].instrument->setFrequency( (StkFloat) (voices_[i].frequency * pitchScaler) );
|
||||
@@ -178,10 +178,10 @@ void Voicer :: pitchBend( StkFloat value, int group )
|
||||
void Voicer :: pitchBend( long tag, StkFloat value )
|
||||
{
|
||||
StkFloat pitchScaler;
|
||||
if ( value < 64.0 )
|
||||
pitchScaler = pow(0.5, (64.0-value)/64.0);
|
||||
if ( value < 8192.0 )
|
||||
pitchScaler = pow( 0.5, (8192.0-value) / 8192.0 );
|
||||
else
|
||||
pitchScaler = pow(2.0, (value-64.0)/64.0);
|
||||
pitchScaler = pow( 2.0, (value-8192.0) / 8192.0 );
|
||||
for ( unsigned int i=0; i<voices_.size(); i++ ) {
|
||||
if ( voices_[i].tag == tag ) {
|
||||
voices_[i].instrument->setFrequency( (StkFloat) (voices_[i].frequency * pitchScaler) );
|
||||
|
||||
Reference in New Issue
Block a user