Permalink
Browse files

added a preview toggle to MIDI via OSC, misc small work

  • Loading branch information...
1 parent 10a7515 commit c4d19f8b7caa523ab1016a85cedd9c8ae7076c02 raycutler committed Sep 24, 2009
@@ -0,0 +1,15 @@
+{\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf110
+{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
+{\colortbl;\red255\green255\blue255;}
+\vieww9000\viewh8400\viewkind0
+\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural
+
+\f0\fs24 \cf0 written by Ray Cutler\
+\
+sending MIDI via OSC is not a new concept- most apps/OSC libraries don't support it due to the platform-specific nature of MIDI implementations, but one of OSC's basic data types is a MIDI message.\
+\
+this app does two things:\
+\
+1)- it will take MIDI, convert it into OSC messages which use the MIDI data type, and send these OSC messages somewhere.\
+\
+2)- if it receives any OSC messages which use the native MIDI-over-OSC data type, it will convert those messages into MIDI messages, and send them to one of the MIDI devices on your system.}
@@ -7,6 +7,7 @@
@interface MVOMIDIManager : VVMIDIManager {
MutLockArray *receivedOSCStringArray;
IBOutlet NSTextField *receivedOSCField;
+ IBOutlet NSButton *receivedOSCPreviewToggle;
IBOutlet NSTableView *sourcesTableView;
IBOutlet NSTableColumn *sourcesNameColumn;
@@ -90,7 +90,8 @@ - (void) receivedOSCMessage:(OSCMessage *)m {
for (NSString *midiString in it)
[tmpString appendString:[NSString stringWithFormat:@"%@\n",midiString]];
[receivedOSCStringArray unlock];
- [receivedOSCField setStringValue:tmpString];
+ if ([receivedOSCPreviewToggle intValue] == NSOnState)
+ [receivedOSCField setStringValue:tmpString];
}
}
@@ -13,6 +13,7 @@
@interface MVOOSCManager : OSCManager {
MutLockArray *receivedMIDIStringArray;
IBOutlet NSTextField *receivedMIDIField;
+ IBOutlet NSButton *receivedMIDIPreviewToggle;
MutLockArray *outgoingBuffer;
VVThreadLoop *oscSendingThread;
@@ -109,7 +109,8 @@ - (void) receivedMIDI:(NSArray *)a {
for (NSString *midiString in it)
[tmpString appendString:[NSString stringWithFormat:@"%@\n",midiString]];
[receivedMIDIStringArray unlock];
- [receivedMIDIField setStringValue:tmpString];
+ if ([receivedMIDIPreviewToggle intValue] == NSOnState)
+ [receivedMIDIField setStringValue:tmpString];
}
}
}
Oops, something went wrong.
@@ -65,6 +65,7 @@
@property (assign,readonly) BOOL returnOnMain;
@property (readonly) NSMutableData *responseData;
@property (readonly) NSString *responseString;
+@property (readonly) CURLcode err;
@end
@@ -168,15 +168,20 @@ - (struct curl_httppost *) lastFormPtr {
return lastFormPtr;
}
- (void) appendDataToPOST:(NSData *)d {
+ NSLog(@"%s",__func__);
if (d == nil)
return;
if (postData == nil)
postData = [[NSMutableData dataWithCapacity:0] retain];
- [postData appendData:d];
+ NSLog(@"\t\tappending %ld bytes",[d length]);
+ //[postData appendData:d];
+ [postData appendBytes:[postData bytes] length:[postData length]];
}
- (void) appendStringToPOST:(NSString *)s {
if (s == nil)
return;
+ NSLog(@"%s",__func__);
+ NSLog(@"\t\tappending %ld, %@",[s length],s);
[self appendDataToPOST:[s dataUsingEncoding:NSUTF8StringEncoding]];
}
/*
@@ -203,6 +208,7 @@ - (void) writePtr:(void *)ptr size:(size_t)s {
@synthesize lastFormPtr;
@synthesize returnOnMain;
@synthesize responseData;
+@synthesize err;
- (NSString *) responseString {
if (responseData == nil)
@@ -255,6 +255,7 @@
96C2F2141017815F004E19B0 /* OSCConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 96C2F2131017815F004E19B0 /* OSCConstants.h */; settings = {ATTRIBUTES = (Public, ); }; };
96C9DAF4106B0301006DD331 /* MVOMIDIManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C9DAF3106B0301006DD331 /* MVOMIDIManager.m */; };
96C9DAF7106B0335006DD331 /* MVOOSCManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 96C9DAF6106B0335006DD331 /* MVOOSCManager.m */; };
+ 96E26B35106C319700C5B418 /* Credits.rtf in Resources */ = {isa = PBXBuildFile; fileRef = 96E26B34106C319700C5B418 /* Credits.rtf */; };
96E7ECC3106B160C00B90822 /* VVBasics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961EA8ED100E8565007E6C25 /* VVBasics.framework */; };
96E7ECC4106B161000B90822 /* VVMIDI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 961745F4100F86B400FB60E6 /* VVMIDI.framework */; };
96E7ECC5106B161100B90822 /* VVOSC.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9628D0C5100E89F700C3944E /* VVOSC.framework */; };
@@ -635,6 +636,7 @@
96C9DAF3106B0301006DD331 /* MVOMIDIManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MVOMIDIManager.m; path = MIDIviaOSC/MVOMIDIManager.m; sourceTree = "<group>"; };
96C9DAF5106B0335006DD331 /* MVOOSCManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = MVOOSCManager.h; path = MIDIviaOSC/MVOOSCManager.h; sourceTree = "<group>"; };
96C9DAF6106B0335006DD331 /* MVOOSCManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = MVOOSCManager.m; path = MIDIviaOSC/MVOOSCManager.m; sourceTree = "<group>"; };
+ 96E26B34106C319700C5B418 /* Credits.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = Credits.rtf; path = MIDIviaOSC/Credits.rtf; sourceTree = "<group>"; };
96ED419710628A5500D8373F /* VVCURLDL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = VVCURLDL.h; path = VVBasics/src/VVCURLDL.h; sourceTree = "<group>"; };
96ED419810628A5500D8373F /* VVCURLDL.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = VVCURLDL.m; path = VVBasics/src/VVCURLDL.m; sourceTree = "<group>"; };
BD9F6A0A10191358004D8CD9 /* FreeFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FreeFrame.h; path = VVFFGL/FrameworkSrc/FreeFrame.h; sourceTree = "<group>"; };
@@ -970,6 +972,7 @@
96B4931F106AEB8A008FB26E /* MIDI via OSC app */ = {
isa = PBXGroup;
children = (
+ 96E26B34106C319700C5B418 /* Credits.rtf */,
96B49304106AEB4C008FB26E /* MIDIviaOSC-Info.plist */,
96B49322106AEC32008FB26E /* main.m */,
96B49323106AEC32008FB26E /* MainMenu.xib */,
@@ -1515,6 +1518,7 @@
buildActionMask = 2147483647;
files = (
96B49325106AEC32008FB26E /* MainMenu.xib in Resources */,
+ 96E26B35106C319700C5B418 /* Credits.rtf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

0 comments on commit c4d19f8

Please sign in to comment.