hi,
i'm a beginner on Xcode so please help me with some code exemple
for my first post, i have a question :
i work on a midi interface with some buttons sending midi note
this code is for an Uibutton switch
if you press it , it send a midi noteON message,wait a little and send midi noteOFF
my question is :
how to make a toggle button with this code
i want press one time, the button send a midi noteON message, wait
and it sent the midi noteOFF only if i press it again
same question to do this :
how to make a flash button with this code
i press the button and hold my finger on it, so the midi noteON message is transmited,
and when i release the button, only at this time it send a midi noteOFF message
Thank's for your future answer(s), but as i told you, i'm a beginner in Xcode so if you can help me give me some code example to explain
i'm a beginner on Xcode so please help me with some code exemple
for my first post, i have a question :
i work on a midi interface with some buttons sending midi note
this code is for an Uibutton switch
if you press it , it send a midi noteON message,wait a little and send midi noteOFF
my question is :
how to make a toggle button with this code
i want press one time, the button send a midi noteON message, wait
and it sent the midi noteOFF only if i press it again
same question to do this :
how to make a flash button with this code
i press the button and hold my finger on it, so the midi noteON message is transmited,
and when i release the button, only at this time it send a midi noteOFF message
in the .h
@property (retain, nonatomic) IBOutlet UIButton *button6;
- (IBAction) sendMidiData38;
in the .m
- (IBAction) sendMidiData38
{[self performSelectorInBackgroundselector(sendMidiData InBackground38) withObject:button6];}
- (void) sendMidiDataInBackground38
{
const UInt8 note = 101;
const UInt8 noteOn[] = { 0x92, note, 127 };
const UInt8 noteOff[] = { 0x82, note, 0 };
[midi sendBytes:noteOn size:sizeof(noteOn)];
[NSThread sleepForTimeInterval:0.1];
[midi sendBytes:noteOff size:sizeof(noteOff)];
}
Thank's for your future answer(s), but as i told you, i'm a beginner in Xcode so if you can help me give me some code example to explain