Closed dferrandizmont closed 9 years ago
Can you post a bit more of your code, like the relevant stuff in setup() or update()?
Of course, here is the whole code:
.h
ofxAudioUnit reverb;
ofxAudioUnitFilePlayer player;
ofxAudioUnitOutput output;
.cpp
#include "ofApp.h"
//--------------------------------------------------------------
void ofApp::setup(){
reverb = ofxAudioUnit(kAudioUnitType_Effect, kAudioUnitSubType_Reverb2);
player.connectTo(reverb).connectTo(output);
output.start();
player.setFile(ofFilePath::getAbsolutePath("chopin.mp3"));
player.loop();
}
//--------------------------------------------------------------
void ofApp::update(){}
//--------------------------------------------------------------
void ofApp::draw(){}
//--------------------------------------------------------------
void ofApp::exit(){}
//--------------------------------------------------------------
void ofApp::touchDown(ofTouchEventArgs & touch){}
//--------------------------------------------------------------
void ofApp::touchMoved(ofTouchEventArgs & touch){
float newReverb = ofMap(touch.x, 0, ofGetWidth(), 0, 100);
AudioUnitSetParameter(reverb.getUnit(),
kReverb2Param_DryWetMix,
kAudioUnitScope_Global,
0,
newReverb,
0);
}
//--------------------------------------------------------------
void ofApp::touchUp(ofTouchEventArgs & touch){}
//--------------------------------------------------------------
void ofApp::touchDoubleTap(ofTouchEventArgs & touch){}
//--------------------------------------------------------------
void ofApp::touchCancelled(ofTouchEventArgs & touch){}
//--------------------------------------------------------------
void ofApp::lostFocus(){}
//--------------------------------------------------------------
void ofApp::gotFocus(){}
//--------------------------------------------------------------
void ofApp::gotMemoryWarning(){}
//--------------------------------------------------------------
void ofApp::deviceOrientationChanged(int newOrientation){}
Thank you.
Going to close this, but thanks for the report! Managing the parameters for iOS-specific units is out of the scope of the addon I feel.
Hi, i'm trying to use a reverb effect on iOS and I can't. My problem is that I can't set the
kReverb2Param_DryWetMix
to 0 (default is 100%) and when the sound starts it starts with reverb, and my second problem is that if I writefloat newReverb = ofMap(touch.x, 0, ofGetWidth(), 0, 100, true);
the
kReverb2Param_DryWetMix
doesn't change it value and I don't know why.Thanks.