views:

48

answers:

1

hi all

i am trying to make a musical app for iphone. the app is simple. there is a couple of musical note sample (caf) files. when user taps the predefined positions on uıview(like strings). app plays note sample and add a string value to a nsmutablearray about note.

played note lists displays in a table.

now i want to add a shake and play mode to app. when user shake iphone, recorded notes start to play from first record to last record and loop again. also if user shake iphone harder notes will plays faster.

how can i do that. any idea? thanks

A: 

what bit do you need help with ? Shaking ? To tell how hard a phone is being shaken check the accelerometer values. I do something similar in one of my apps, checking magnitude and duration of acceleration in

  • (void) accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration;
Andiih
thanks. i need help about shaking and how can i increase playing speed.
JudasDSC
How on earth are we supposed to answer questions like that ? You will change playing speed by altering something in your code that schedules the note play rate. Probably a variable. You might play your notes using scheduledTimerWithTimeInterval:invocation:repeats: in which case you would need to change the TimeInterval
Andiih
i asked about that you said. when i asked how, i mean with a counter variable inside loop or with a timer. sorry for my english but i ask clearly again. i need a sample code about playing musical notes when user shake iphone. if user shakes faster notes playin faster too.
JudasDSC
I'm sorry, I don't think that's sample code - thats asking someone to write your application for you.
Andiih