UITableView with Shake and play
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
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;
精彩评论