Using AENewTimePitchFilter in channel group [TAAE]

Hi all,

I'm making an iOS app where the mic input should be split in two parts - one part is "clean" (no effects on it) and the other is "modified" (with some effects). The idea could be roughly schematised as follows:

MIC ----> playthrough 1 (clean) ----------------------------------------> output
-----> playthrough 2 (modified)------------------------------------->output

I don't know if that's the way to go, but I thought I'd create two channel groups, cleanGroup and modifiedGroup, each having a playthrough, while the 2nd one will also have some additional effects. Specifically, in the .h file I created these groups and some effects:

@interface ViewController : UIViewController{
    AEChannelGroupRef cleanGroup; // no effects on that
    AEChannelGroupRef modifiedGroup; // put effects

@property (nonatomic, strong) AEAudioController *audioController;
@property (nonatomic, strong) AEPlaythroughChannel *playthrough;
@property (nonatomic, strong) AEPlaythroughChannel *playthrough2;
// the effects to be added
@property (nonatomic, strong) AENewTimePitchFilter *pitchShift;
@property (nonatomic, strong) AEDelayFilter *delay;
@property (nonatomic, strong) AEDistortionFilter *distortion;

and then in the .m file:

    cleanGroup = [_audioController createChannelGroup];
    modifiedGroup = [_audioController createChannelGroup];

    // defining playthrough 1 of clean stuff
    _playthrough = [[AEPlaythroughChannel alloc] init];
    [_audioController addInputReceiver:_playthrough];
    // and putting it to the clean group
    [_audioController addChannels:@[_playthrough] toChannelGroup: cleanGroup];

    // defining playthrough 2 of modified stuff    
    _playthrough2 = [[AEPlaythroughChannel alloc] init];
    [_audioController addInputReceiver:_playthrough2];
    // and putting it to the modified group
    [_audioController addChannels:@[_playthrough2] toChannelGroup:modifiedGroup];

    // defining delay params
    _delay = [[AEDelayFilter alloc] init];
    _delay.delayTime = .25; = 1.;
    _delay.wetDryMix = 100.;
    _delay.lopassCutoff = 500;
    // everything is fine - modified group accepts delay
    [_audioController addFilter:_delay toChannelGroup:modifiedGroup];

    // defining distortion params
    _distortion = [[AEDistortionFilter alloc] init];
    _distortion.linearTerm = 5.;
    _distortion.squaredTerm = 5.;
    _distortion.cubicTerm = 5.;
    // everything fine again
    [_audioController addFilter:_distortion toChannelGroup:modifiedGroup];

    // defining octave up pitch shift
    _pitchShift = [[AENewTimePitchFilter alloc] init];
    [_pitchShift setPitch:1200.];
    [_pitchShift setRate:0.];
    [_pitchShift setOverlap:0.];
    // OOPS! If I remove comments on the next line no sound comes out AT ALL!
//    [_audioController addFilter:_pitchShift toChannelGroup:modifiedGroup];

There is a message in the Xcode log:
AEAudioController.m:4003: Update graph: -10863

I don't know what that means...

If I don't split the signals and apply the _pitchShift filter directly to the _audioController then everything works as expected.

What am I doing wrong? Is AENewTimePitchFilter not supposed to be working on AEChannelGroupRef groups?

Thanks :)


  • edited July 2016

    Hi @maximoskp. Hmm.. that's an excellent question! Not really sure why that's happening, but I think for a new project I'd probably suggest using TAAE2, which makes this sort of signal flow easier, or AudioKit, which makes everything easier (as long as you're not writing much custom realtime code, which it doesn't look like you are)

  • Thanks @Michael! I've approached it with libPD but I think I'll also try to do it with TAAE2, since I might need some sample-by-sample manipulation later on. Anyway, thanks again!

Sign In or Register to comment.