Sunday, October 4, 2015

Promise to myself kept but is it the working version!

I had promissed myself that I would submit by the end of this week. And I did! A few minutes ago, deciding that I have procrastinated enough, submitted it!

I did it while washing the dishes, doing laundry and putting 3 kids to bed.

So although I did have a working code, one does hope that she managed to upload the correct version!

Can we say I am a member of #WomenWhoCode now?


Link to my lovely, trendy, fashionable code? Here it is! 

Is it possible to define Echo without really understanding it?

Today, having finally initialized my Class and having completed the mandatory parts of Project Pitch Perfect, I decided to explore combining the 4 effects to a single function.

I already had the pitch effects in 1, and the speed in another function.

//set Pitch
        let changePitchEffect = AVAudioUnitTimePitch()
        changePitchEffect.pitch = pitch

        audioEngine.attachNode(changePitchEffect)

So my logic was, if this is the way I changed the pitch let me apply it to speed/rate of the AUdio as well :
//set Rate
        let changeRateEffect = AVAudioUnitVarispeed()
        changeRateEffect.rate = rate
        audioEngine.attachNode(changeRateEffect)

Ta daaaa, it worked.

After a research of short(!) time, I found an example on StackOverFlow that connects multiple effects and applied it to my code.

Ta daaaa, it worked!

So I decided to be more adventurous and after reading manual for an hour and going through some mindboggling examples in Stackoverflow AND with lots of help from Trial and Error Methodology(!) I got the Reverb working... 

//Setting the reverb effect
        let changeReverbEffect = AVAudioUnitReverb()
        changeReverbEffect.loadFactoryPreset(AVAudioUnitReverbPreset.LargeHall2)
        changeReverbEffect.wetDryMix = reverb
        audioEngine.attachNode(changeReverbEffect)

I did manage to apply Echo as well and got a semi-satisfactory result. I tried to find the length of the recorded audio and set it to those number of seconds to get the perfect echo, but without any success. So I set a 30 value and seems to work fine with normal length recordings... 

So the only thing I have left is adding a Pause button! And this was where I messed up the last time. But this time I made sure I have "commit" pressed :-) :-) 



Friday, October 2, 2015

How long does it take to initialize a Class

Seriously! I spent 2 hours and cannot initialize the class I defined :-))))



Tomorrow, I will initialize this sesison or go jump off a roof top

(kidding of course :-) )