Send midi note on/note off with velocity over wifi from iPad - ios

Does anyone have example with iOS/Objective C, on how to send midi "note on/note off" signal (with different velocity) over wifi so that iPad would display in "Mac OS X->Audio Midi Setup->Network. then I click connect device" and by simple touching on the button on iPad code will send midi command. I believe I need to use some protocol,but I'm newbie on this, please help me.
Thanks.

You have to use the coremidi framework (provided by the IOS). See here for a introduction: http://www.synthtopia.com/content/2011/06/02/coremidi-brain-dump/

If you are still looking I wrote sample code that is on GITHUB that wirelessly sends/receives MIDI notes ON/OFF messages from iPhone/iPad to Windows PC, Apple Mac or any other device listening. Full instruction on GITHUB.
see: https://github.com/JohnGoodstadt/MidiNotes

Related

Stream camera from iOS app to OSX app

I would like to use an iOS device as a camera and stream the data to an accompanying OSX app. Wifi is not a valid option and I'm assuming Bluetooth will be too slow, so I'm planning to connect the phone via USB to the Mac.
I've gone through this networking tutorial and have looked at Apple's EADemo code with EASessionManager, etc. but haven't figured out how to put everything together.
When my iOS device is connected via USB to my Mac, it doesn't show up in
[[EAAccessoryManager sharedAccessoryManager] connectedAccessories]
so I'm kind of lost. Am I going down the wrong path? Any suggestions would be really helpful! Thanks in advance!

Bluetooth iOS printing on Bixolon SPP-R200II

We are users of POS printer Bixolon SPP-R200II which we use for realisation of one of our projects. In the specification of this model it is listed that printer supports printing on iOS devices (iPhone & iPad) but until now we have not succeeded to achieve that. We switch the printer onto iOS mode with a required combination we fonud in official documentation and we got confirmation message. Then we connected to the printer from bluetooth interface inside iPhone Settings app.
After that we tryed to print on this device in various ways - using official test app from AppStore (https://itunes.apple.com/us/app/bixolon-printer-utility/id647125968?mt=8) and using official Bixolon SDK (http://www.bixolon.com/upload/download/software_all_bixolon_printer_sdk_for_ios_v3.1.8.zip) but unfortunately we havent managed to get any result. In this sample apps printer was not even listed as a possible connection point.
Can you direct us in any way to get the printing on iOS devices working? Thank you!
To connect to the SPP-R200II you need to enable MFi Mode for the printer.
Turn on printer
Open the cover and press the power button and paper feed button at the same time for 2 seconds
Close the cover when the buzzer sounds
The printer should now print "iOS mode enable!!" [sic]. If not, you just turned off MFi mode and need to repeat the steps to turn it on again.
Unfortunately the sample application distributed with the Bixolon SDK 3.1.8 is broken and when you press "Lookup/Targeting" nothing will happen. To fix it add this line to didFindPrinter in ViewController.h:
_uiTextFieldAddress.text = [NSString stringWithFormat:#"BT_%#", printer.macAddress];
It should now be possible to connect the printer simply by pressing "Lookup/Targeting" and then "Connect" when you se the Bluetooth address in the text field.
We had the same problem and after contacting technical support, concluded that the model we have is not compatible with iOS, the part number must be 3 letters i, for example SPP-R200IIIK/USA. After making the switch equipment provider, everything works perfectly.
Is the printer paired with the device in settings? It must be paired before the application can interact with it.

Bluetooth connection to LEGO Mindstorms EV3 brick from iOS app

Does anybody know how to establish a bluetooth connection from a self-written iOS app to the
new LEGO Mindstorms EV3 programmable brick?
I tried to do this via the scanForPeripheralsWithServices:options: method of CBCentralManager,
but the brick is not recognized.
But if I enable Bluetooth in the Settings of the iPhone, then the EV3 device is displayed there. There is also an app in the AppStore from LEGO ("Commander") which talks to the brick via Bluetooth, so I think this should be possible in general (as I know, it was not possible for the previous Mindstorms NXT brick).
Does anybody have an idea how I can do this?
Thanks!
As said, the device isn't listed using CoreBluetooth, got it using EAcessory framework, you need to have the item "COM.LEGO.MINDSTORMS.EV3" in UISupportedExternalAccessoryProtocols in your App-Info.plist :
<EAAccessory: 0x15567180> {
connected:YES
connectionID:18565483
name: MFI Accessory
manufacturer: LEGO
modelNumber: DM240411
serialNumber:
firmwareRevision: 1.0.0
hardwareRevision: 1.0.0
protocols: (
"COM.LEGO.MINDSTORMS.EV3"
)
delegate: (null)
}
As with the Lego app, you need to first connect to the EV3 using Settings App.
Then, look at the Apple EADemo sample, it show how to use EASession (encapsulate read/write stream).
Maybe sending data like the C# gathered from monobrick.dk source code (said in Mailerdaimon answer) will work... I'll get a try via Wifi (after porting C# to ObjC, long job), after that, writing to EASession might be easier. I'll update this answer when done.
You will have to wait until Lego release the SDK which hopefully contains information about the protocol.
It was possible with the NXT and i think it will be possible with the EV3.
In the mean time you could try to send your messages via Wifi which is possible right now.
Note that there are two protocol with which the EV3 communicates over Bluetooth. One is used by the LEGO EV3 App on the iPhone and the other one is the same available over USB-HID and WiFi and is partly specified by Communication developer manual and by the source code. The latter protocol is the one you should use.
You can call/link against/check the source code of my uploader for c4ev3 to see how the connection is realized.
HTH.
Enable the Bluetooth and iPod/iPhone option on the EV3 brick. Can be done from tools menu on the EV3.
Enable Bluetooth on the iPhone.
Start Bluetooth pairing process.
Launch the Lego EV3 App on the iPhone.
Done.

Connect and Disconnect USB Cable to iPhone using IOS programming

I am developing a iPhone app like " Eject device" on computer. which means, when I connect USB cable for connecting to computer, this application just disconnect that connection by a single Click. I was googled about this, and I got some idea about EAAccessoryManager . this EAAccessoryManager only for notification. when USB cable connects or disconnect it can notify to the user. But I need to disconnect connection programmatically . is there any API or Tutorial available for this ? Kindly help me please.
You should probably look at IOKit. I believe IOKit works with USB device both on iOS and OS X.
You may be interested to take a look at these link:
https://developer.apple.com/library/mac/#documentation/DeviceDrivers/Conceptual/USBBook/USBIntro/USBIntro.html
http://iphonedevwiki.net/index.php/IOKit.framework
Also, there is very good book on iOS/OS X kernel and I believe there is a whole chapter regarding IOKit:
http://www.amazon.com/Mac-OS-iOS-Internals-Apples/dp/1118057651
You can find the private API for the iOS Frameworks in https://github.com/kennytm/iphone-private-frameworks, but I don't think that this capability is present. The reason I think this is because there is no reason to want to do this from the iPhone, and therefore no reason for Apple to include it in the API.

Arduino as keyboard on iPad

I'm trying to use a makey makey (a device based on the Arduino Leonardo) as a keyboard for an iPad. I know that it has already been done, but I'm not able to reproduce it. My guess is that some versions of the iPad don't recognize this device.
Since I can use a USB keyboard and I know that mice are not recognized, I'd like to program the makey makey in such a way that it is "recognized only as a keyboard" (the original device can be used as a mouse and as a keyboard). I'm very new to Arduino, could someone give me a hint please?
A colleague helped me for this issue and we were able to solve it. We just erased this line about CDC:
#define CDC_ENABLED
in the file "USBDesc.h" (in the folder available on github: "firmware/Arduino/hardware/MaKeyMaKey/cores"). After doing this, there is a problem when compiling the code on the device, because the Arduino is not recognized anymore. You can still add your code to the Arduino, but you have to reset the device just after compilation start.
Using the ProMicro 5v and a "Case Logic 2.0 USB Hub" and the Camera kit I was able to get the programed keyboard commands to be recognized by the iPad without modifying "USBDesc.h" file.
ProMicro has built in HID emulation support very similar to Arduino Leonardo. Besides the "USB IO Board: The connected device is not supported" error, the device is apparently unofficially supported. I believe this has something to do with the hub.
In my arduino code I am using the "Keyboard_ascii.h" library and am using Keyboard.print, and Keyboard.write commands to send the key commands / text to the iPad.

Resources