私は 4 つのタッチを取り、それらを適切にスケーリングし、それらの値を送信して組み込みシンセサイザーを制御するアプリに取り組んでいます。
私がこれまでに持っているものは次のとおりです。
//Assign seperate touches to scaling values
_firstTouch=[[OneTouch alloc] initWithFrame:frame1
scalingValue:PITCH_SCALING
withColor:[UIColor redColor]
delegate:self
uniqueID:1];
_secondTouch=[[OneTouch alloc] initWithFrame:frame2
scalingValue:OFFSET_SCALING
withColor:[UIColor blackColor]
delegate:self
uniqueID:2];
_thirdTouch=[[OneTouch alloc] initWithFrame:frame3
scalingValue:DENSITY_SCALING
withColor:[UIColor cyanColor]
delegate:self
uniqueID:3];
_fourthTouch=[[OneTouch alloc] initWithFrame:frame4
scalingValue:DURATION_SCALING
withColor:[UIColor orangeColor]
delegate:self
uniqueID:4];
「スケーリング」値は、対応する .h ファイルで設定したマクロです。彼らです:
#define PITCH_SCALING 1000.0
#define OFFSET_SCALING 20000.0
#define DENSITY_SCALING 100.0
#define DURATION_SCALING 1.0
どのようにすればよいか分からないのは、各タッチをプログラムして、最大 (スケーリングされた) 値と最小値の間を移動することです (たとえば、ピッチは 100 から 1000 の間でスケーリングされます)。
何か案は?ありがとう!