Objective c 如何使切换按钮影响Xcode 4.3中的用户脚本(cmix)
我正在为iphone/ipad构建IRTcmix版本的RTcmix中的一个简单的分步序列器,使用UI按钮来控制序列中哪些音符处于打开或关闭状态 我一直在使用一组其他应用程序的RTcmix示例,并试图将自己的应用程序拼凑在一起,但我不确定如何使用切换样式的UIButton更改.score文件中变量的值 以下是RTcmix应用程序的一些代码片段: 从RTcmix manager.h:Objective c 如何使切换按钮影响Xcode 4.3中的用户脚本(cmix),objective-c,xcode,uibutton,xcode4.3,Objective C,Xcode,Uibutton,Xcode4.3,我正在为iphone/ipad构建IRTcmix版本的RTcmix中的一个简单的分步序列器,使用UI按钮来控制序列中哪些音符处于打开或关闭状态 我一直在使用一组其他应用程序的RTcmix示例,并试图将自己的应用程序拼凑在一起,但我不确定如何使用切换样式的UIButton更改.score文件中变量的值 以下是RTcmix应用程序的一些代码片段: 从RTcmix manager.h: @interface RTcmixManager : RTcmixPlayer { RTcmixScore
@interface RTcmixManager : RTcmixPlayer {
RTcmixScore *polyScore;
}
@property (nonatomic, retain) RTcmixScore *polyScore;
- (void)noteOn:(int)note;
- (void)noteOff:(int)note;
@end
还有RTcmix经理
- (void)noteOn:(int)note {
[polyScore.mainScoreParameters replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:note]];
[polyScore.mainScoreParameters replaceObjectAtIndex:1 withObject:[NSNumber numberWithInt:1]];
[self parseScoreWithRTcmixScore:polyScore];
polyScore.setupIsActive = YES;
}
- (void)noteOff:(int)note {
[polyScore.mainScoreParameters replaceObjectAtIndex:0 withObject:[NSNumber numberWithInt:note]];
[polyScore.mainScoreParameters replaceObjectAtIndex:1 withObject:[NSNumber numberWithInt:0]];
[self parseScoreWithRTcmixScore:polyScore];
}
viewcontroller.h:
@interface RTPolyphonyViewController : UIViewController {
RTcmixManager *rtcmixManager;
}
- (IBAction)keyDown:(UIButton *)sender;
- (IBAction)keyUp:(UIButton *)sender;
@end
viewcontroller.m:
- (IBAction)keyDown:(UIButton *)sender {
[rtcmixManager noteOn:sender.tag];
}
- (IBAction)keyUp:(UIButton *)sender {
[rtcmixManager noteOff:sender.tag];
}
.sco文件%@中的一个片段是用户输入更改的变量:
NoteNumber = %@
NoteVelocity = %@
alreadySounding = note_exists(oscNotes[NoteNumber])
MAXMESSAGE(0, alreadySounding)
我对objective C和xcode非常陌生,我想知道如何使UI按钮在分数文件中的两个值之间切换,就像开关一样。例如,切换时的按钮使分数文件中的NoteNumber值设置为1,而关闭时的值为0。因为我是Xcode和objective C的初学者,所以我不确定如何使用正确的语法使按钮能够打开和关闭,也不确定如何将所述按钮与.sco文件连接起来,尽管我查看了示例代码,但似乎无法理解它们是如何连接的