44#include " ServiceCall.h"
55#include < stdint.h>
66
7- VoltsPerOctave::VoltsPerOctave () : tune(0.0 ) {
7+ VoltsPerOctave::VoltsPerOctave (bool input ) : tune(0.0 ) {
88 int32_t volts_offset = 0 , volts_scalar = 0 ;
99 void * args[] = {
10- (void *)" VO " , (void *)&volts_offset,
11- (void *)" VS " , (void *)&volts_scalar
10+ (void *)(input ? " IO " : " OO " ) , (void *)&volts_offset,
11+ (void *)(input ? " IS " : " OS " ) , (void *)&volts_scalar
1212 };
1313 int ret = getProgramVector ()->serviceCall (OWL_SERVICE_GET_PARAMETERS, args, 4 );
1414 if (ret == OWL_SERVICE_OK){
15- multiplier = (float )volts_scalar/INT32_MAX ;
16- offset = (float )volts_offset/INT32_MAX ;
15+ multiplier = (float )volts_scalar/UINT16_MAX ;
16+ offset = (float )volts_offset/UINT16_MAX ;
1717 }else {
1818 if (getProgramVector ()->hardware_version == OWL_MODULAR_HARDWARE){
19- multiplier = -4 .40f ;
20- offset = -0 .0585f ;
19+ if (input){
20+ multiplier = -4.29 ;
21+ offset = -0.06382 ;
22+ }else {
23+ multiplier = -4.642 ;
24+ offset = 0.1208 ;
25+ }
2126 }else {
2227 multiplier = 2 .0f ;
2328 offset = 0 .0f ;
@@ -32,7 +37,7 @@ VoltsPerOctave::VoltsPerOctave(float o, float m)
3237void VoltsPerOctave::getFrequency (FloatArray samples, FloatArray output){
3338 ASSERT (output.getSize () >= samples.getSize (), " Output buffer too short" );
3439 // todo: block based implementation
35- // samples.add(- offset, output);
40+ // samples.subtract( offset, output);
3641 // samples.multiply(multiplier, output);
3742 // for(int i=0; i<samples.getSize(); ++i)
3843 // output[i] = voltsToHertz(output[i]);
0 commit comments