I am struggling to understand and program with python to control my project. I have a Raspberry Pi Rev 2. I also have a board i have designed and made consisting of a MPR121 Capacitive touch sensor and a MCP23017 https://www.dropbox.com/s/0d399qhg5l6o7 ... %20HDR.jpg

I am a total noob to linux and programming and cannot seem to understand how i can get what i want (not for lack of trying).
Ive managed to get everything working but to write a code for exactly what i want ???? Im lost
I can understand some basic functions like print(" "), if x >=1 , if x is equal to or greater than 1 then do.... else do....but how to implicate this into controlling the things i want is making my head feel like its about to pop.
My goal is to have a project where i can put an electrode from the capacitive touch sensor onto say a tree which when touched triggers the sound of say an owl, ive looked at the beetbox and sampled the code from this, this sort of worked, i can see 'pin x was just touched' ect but the audio, this didnt work as i didnt appear to have pygame (however i didnt get any errors from python?), so anyway off i went to get pygame installed, eventually after days of searching on the net and advice from many sources i managed to get sounds i downloaded to play using mpg321-filename.mp3 which i then typed into the code here and there, i then ran into the problem of the nasty clicking/popping which apparently is a 2.5v dc shift which is a known bug on the Pi's, so then i have tried to use the hdmi sound output, somehow i managed to get it working once very briefly, but no more, i really do not know how i got it to work or why.
But wait, that's not all i would like to do, i would also like to trigger a relay as the sound is playing. eg if i placed an electrode on say a tree, then when that said tree is touched the audio is triggered as well as my relay, hence the MCP23017. Now i have played with the chip and some sample code from skpang (ledchaser.py) i have leds working and flashing, ive now connected my new board (mcp23017 and the mpr121) to the 8ch 5v relay card. And now have the problem that every channel is on, i believe this is because when the code starts all channels are set as outputs which tells them all to be gnd, this is causing my 5v0 regulator to get very hot. How would i possibly go about telling the mcp23017 to make its GPI0 a/b 0-7 gnd when the mpr121 is triggered, and then clear itself after 0.x seconds?
Again im sorry for coming on here and blah blah blah but could anybody please help me?
I would like to know how i can get my touch sensors to trigger sound(with no pops) and at the same time trigger my relays, Ive searched online loads and cannot find any code for either chip i can break down to see how its working and then compile to make something to suit my application.
I know youve probably looked at this and are saying you've bitten off far more than you can chew but hey, you have to learn somewhere and this is easy compared to some of the future projects i have in mind.
Thankyou in advance
Chris