tag:blogger.com,1999:blog-28993484492865290182024-03-19T08:06:40.909+00:00The Stereo Action DimensionMIDI and audio programming on OS X and iOSSimon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.comBlogger9125tag:blogger.com,1999:blog-2899348449286529018.post-1961294420323595142013-01-19T20:30:00.000+00:002013-01-24T20:37:34.859+00:00On Screen Keyboard for OS X (Updated)<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoT6d2jUJIRo87fXoebareAKZd-NN6m4h-vx2LafuAHQ8H746Ho26O1nhQng2VFWJ2SwccACfLHkdMKnNeU1lQ7yeAcRGvE-Kyn8OfDTszF-uRikdvhPXq41J5AGxeJXFOcitvtseYWMA/s1600/PianoKeys.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="73" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoT6d2jUJIRo87fXoebareAKZd-NN6m4h-vx2LafuAHQ8H746Ho26O1nhQng2VFWJ2SwccACfLHkdMKnNeU1lQ7yeAcRGvE-Kyn8OfDTszF-uRikdvhPXq41J5AGxeJXFOcitvtseYWMA/s320/PianoKeys.png" width="320" /></a></div>
<br />
<br />
This project has now been updated for Lion and Mountain Lion, so it supports:<br />
<br />
<ul>
<li>Lion document versioning and autosaving</li>
<li>Undo and Redo for all UI actions</li>
</ul>
<div>
The code's also been cleaned up so it builds cleanly under Clang/LLVM (apparently some of my Objective C programming habits from the time I first wrote it are now considered "archaic" by the static analyzer - that's what you get for learning it in the early '90s!)<br />
<br /></div>
<div>
<a name='more'></a></div>
<div>
Grab the updated source code from:</div>
<div>
<br /></div>
<div>
<a href="http://www.mediafire.com/?pmct35ikdfa7vf6" rel="nofollow" target="_blank">XCode 4.51 Project (MediaFire download)</a><br />
<br />
Or try the installer package from:<br />
<br />
<a href="http://www.mediafire.com/?f653wbnzagy52sb" rel="nofollow" target="_blank">OS X Installer Package (MediaFire download)</a></div>
Simon Lawrencehttp://www.blogger.com/profile/12618284155550014035noreply@blogger.com0tag:blogger.com,1999:blog-2899348449286529018.post-76040452528786963702013-01-19T16:39:00.000+00:002013-01-19T17:30:50.130+00:00Bochum Welt - R.O.B. (Robotic Operating Buddy)Just can't stop listening to this album lately.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.youtube.com/embed/DQfPR0hwLg0?feature=player_embedded' frameborder='0'></iframe></div>
<br />
<br />
Buy it in wav or mp3 format <a href="http://www.rephlex.com/releases/view/6/Bochum%20Welt/R.O.B.%20%28Robotic%20Operating%20Buddy%29/CAT%20192">here</a> - it will definitely repay your investment.<br />
<br />
<i>Disclaimer: The value of <span class="s1">investments can go up</span> as well as <span class="s1">down</span>. Past performance is not a guide to future performance.</i>Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com0tag:blogger.com,1999:blog-2899348449286529018.post-2254544552898344152011-07-20T20:36:00.001+01:002011-08-02T18:01:44.744+01:00Build a Synthesizer from Common Household Materials<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvx6kVtVaRtPKIcJ_Squtdh2rNTO3kXOLUujaNSnNne2zOqyJc4wsWbgYnCPQJv0Gm0t46TuL87Y-RPlPRUJ4tRa9samDnZ8Qfr82LgYk4Q4nxCgKytDQ-Nx_pU14jWRgmmlAd-ZPhG3s/s1600/AirWave+Preliminary.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}"><img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 320px; height: 240px;" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUvx6kVtVaRtPKIcJ_Squtdh2rNTO3kXOLUujaNSnNne2zOqyJc4wsWbgYnCPQJv0Gm0t46TuL87Y-RPlPRUJ4tRa9samDnZ8Qfr82LgYk4Q4nxCgKytDQ-Nx_pU14jWRgmmlAd-ZPhG3s/s320/AirWave+Preliminary.png" border="0" alt="" id="BLOGGER_PHOTO_ID_5636304904454397586" /></a><br /><div style="text-align: left;">This is my new project, a four oscillator mono synth for iPad based on sawtooth <a href="http://www.music.mcgill.ca/~gary/307/week5/bandlimited.html">BLITs</a> and a Moog-style 24dB per octave low pass filter. MIDI control is by WiFi or CoreMIDI compatible interface. All processing is 64 bit internally.</div><div style="text-align: left;"><br /></div><div style="text-align: left;">Free App Store link to be published soon (once the retro panel graphics are complete!)</div><div style="text-align: center;"><br /></div><div><br /></div>Simon Lawrencehttp://www.blogger.com/profile/12618284155550014035noreply@blogger.com0tag:blogger.com,1999:blog-2899348449286529018.post-28639914083537261102011-07-14T20:45:00.000+01:002013-01-24T20:38:15.265+00:00Simple Arpeggiator for OS X - Part 1This is a simple standalone arpeggiator application for OS X. Its primary reason for existing is that I have several synthesizers such as the <a href="http://www.nordkeyboards.com/main.asp?tm=Products&clpm=Nord_Modular">Clavia Nord Modular</a> that provide every imaginable feature <i>except</i> an arpeggiator, and you can't play the music of any of the all time greats such as A Flock of Seagulls, Men Without Hats or Dollar without one. From a programming point of view, it demonstrates the construction of MIDI data with accurate timing without undue CPU overhead using the Mach thread scheduling capabilities of OS X.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji43unEpeMj26oLXm8e1FoBkOa9_hYA_KlgugiVZYwTnsv10NQ8vEDeWqNEw0DXzdGO1fajX5SgyoI4HVL5DcVOoi7GhrcLT6kpSAS5ufL9QCKwi2eCCA-sQTuHGO1WmrebhOV_Y3Z80o/s1600/PocketArpeggiator.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEji43unEpeMj26oLXm8e1FoBkOa9_hYA_KlgugiVZYwTnsv10NQ8vEDeWqNEw0DXzdGO1fajX5SgyoI4HVL5DcVOoi7GhrcLT6kpSAS5ufL9QCKwi2eCCA-sQTuHGO1WmrebhOV_Y3Z80o/s320/PocketArpeggiator.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<a name='more'></a>Further discussion forthcoming. You can download the source code here:<br />
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.mediafire.com/file/cbcv003sf7bu4bb/PocketArpeggiator.zip" rel="nofollow" target="_blank"><strike>XCode 3.2 Project (MediaFire download)</strike></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Updated project for XCode 4.51 (OS X Snow Leopard or later):</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.mediafire.com/?5ko4f37qk6qayds" rel="nofollow" target="_blank">XCode 4.51 Project (MediaFire download)</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Note the application is no longer document based, and supports undo/redo. If you use the original Leopard version for some reason, make sure you don't open more than one document window as it may hang OS X, which I suppose is some sort of achievement.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Installer package:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<a href="http://www.mediafire.com/?j8clh62qmbps6ph" rel="nofollow" target="_blank">OS X Installer 10.6-10.8, 32 and 64 bit universal (MediaFire download)</a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Enjoy.</div>
Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com0Chalfont St Giles, Buckinghamshire, UK51.6319757 -0.5701404999999795151.601199699999995 -0.60200349999997949 51.6627517 -0.53827749999997954tag:blogger.com,1999:blog-2899348449286529018.post-45713243620464117582011-06-12T20:12:00.000+01:002013-01-19T16:40:19.661+00:00On Screen Keyboard for OS X - Part 1Have you ever wished you could have a MIDI controller keyboard on the screen that you could play using the mouse or QWERTY keyboard? No, me neither, but it's a useful debugging tool and a perfect complement to <a href="http://antifluke.blogspot.com/2011/07/network-midi-on-ios-part-1.html">this.</a><br />
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoT6d2jUJIRo87fXoebareAKZd-NN6m4h-vx2LafuAHQ8H746Ho26O1nhQng2VFWJ2SwccACfLHkdMKnNeU1lQ7yeAcRGvE-Kyn8OfDTszF-uRikdvhPXq41J5AGxeJXFOcitvtseYWMA/s1600/PianoKeys.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="91" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoT6d2jUJIRo87fXoebareAKZd-NN6m4h-vx2LafuAHQ8H746Ho26O1nhQng2VFWJ2SwccACfLHkdMKnNeU1lQ7yeAcRGvE-Kyn8OfDTszF-uRikdvhPXq41J5AGxeJXFOcitvtseYWMA/s400/PianoKeys.png" width="400" /></a></div>
<div>
<br />
<br />
<i>Note that this application has been updated for more recent versions of OS X - see <a href="http://antifluke.blogspot.co.uk/2013/01/on-screen-keyboard-for-os-x-updated.html">here</a> for the updated project.</i><br />
<i><br /></i>
<a name='more'></a>I'll discuss its inner workings in future posts, but for now here's the source code:<br />
<br />
<a href="http://www.mediafire.com/file/twfkq8y188tt53v/PianoKeys.zip">XCode 3.2 Project (MediaFire download)</a></div>
<div>
<br />
Have fun.</div>
Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com0tag:blogger.com,1999:blog-2899348449286529018.post-87351290236407023052011-06-02T14:55:00.000+01:002011-07-22T18:09:20.401+01:00Network MIDI on iOS - Part 3In this part I will discuss how incoming MIDI is received into the application and subsequently processed. The source code for this project is available for download in <a href="http://antifluke.blogspot.com/2011/07/network-midi-on-ios-part-1.html">Part 1</a> of this article.<br /><br /><a name='more'></a>The MIDI controller class (see MIDIController.h) provides a formal protocol, MIDIReceivedDelegate, and a corresponding delegate property. This defines the following methods:<br /><br /><span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">- (void) midiControllerUpdated:(Byte)controller onChannel:(Byte)channel toValue:(Byte)value;</span><br /><span class="Apple-style-span" style="font-family:'Courier New', Courier, monospace;">- (void) midiNoteOnOff:(Byte)note onChannel:(Byte)channel withVelocity:(Byte)velocity on:(BOOL)on;</span><br /><br />These methods encapsulate the complexity of receiving MIDI data - but how is this accomplished behind the scenes?<br /><br />When we created the MIDI client in part 2 of this article, we also created a MIDI input port. This was passed a pointer to a callback function, MIDIInputReadProc. This callback function is called by the operating system when MIDI data is received at the port. As a real time callback function which may be re-entrant when the system is under load, certain restrictions should be adhered to. In particular, this function should avoid:<br /><ul><li>Allocating and deallocating memory</li><li>Acquiring locks</li><li>Performing lengthy operations</li></ul>The function walks the list of MIDI packets received as follows:<br /><br />For each MIDI packet received:<br /><div><ul><li>The packet's length and data are written into a <a href="http://en.wikipedia.org/wiki/Circular_buffer">structured circular buffer</a> (see MIDIPacketBuffer.h)</li><li>A <a href="http://developer.apple.com/library/mac/#documentation/Darwin/Conceptual/KernelProgramming/synchronization/synchronization.html">Mach semaphore</a> is incremented to signal the rest of the application that another packet is available for processing.</li></ul><div>Note that the structured buffer in this example disregards the timestamp of the MIDI packet. This will be covered in a later example.<br /><br />Another thread (see midiInputThreadProc) waits on this semaphore. If the semaphore is signalled, the length of the next MIDI packet is retrieved from the circular buffer, and then that amount of data is copied into a regular buffer.<br /><br />This data is then parsed from this buffer. The following <a href="http://www.midi.org/techspecs/midimessages.php">MIDI commands</a> are identified in this example:<br /><br /><ul><li>Control changes</li><li>Note on/off</li></ul><div>Other commands are discarded. When a recognised command is received, <a href="http://en.wikipedia.org/wiki/Grand_Central_Dispatch">Grand Central Dispatch</a> is used to enqueue a block that will invoke the controller's delegate asynchronously on the main queue. The delegate will then respond to the invocation and perform any necessary UI updates etc.</div><div><br /></div><div>By these means, the application decouples the processing of MIDI data from its receipt, and conforms with the requirements placed on it by the CoreMIDI port model.</div><br /></div></div>Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com15tag:blogger.com,1999:blog-2899348449286529018.post-79183055621339144102011-05-30T20:49:00.000+01:002011-07-19T14:57:32.133+01:00Network MIDI on iOS - Part 2In this part, I will discuss finding and publishing network MIDI services using Bonjour, and creating the MIDI client using the CoreMIDI API. The source code for this project is available for download in <a href="http://antifluke.blogspot.com/2011/07/network-midi-on-ios-part-1.html">Part 1</a> of this article.<br />
<br />
<a name='more'></a>The network MIDI services in OS X and iOS can be discovered in the same way as any other Bonjour service. In the initialiser of the MIDIController class (see MIDIController.m) an instance of <a href="http://developer.apple.com/library/ios/#documentation/Cocoa/Reference/Foundation/Classes/NSNetServiceBrowser_Class/Reference/Reference.html">NSNetServiceBrowser</a> is created, and instructed to search for services of the type MIDINetworkBonjourServiceType i.e. @"_apple-midi._udp". By implementing the delegate protocol for this browser, a MIDIController instance can monitor available services of this type on the network.<br />
<div><br />
</div><div>These services are exposed to the remainder of the application as a dictionary. In addition, various operations are provided to allow connection, disconnection etc. (see the section marked "Connection Management" in the implementation for details). The sample application uses these methods to provide a simple UI to connect to any detected services. The settings page is displayed by flipping the main view. From here, we can select one or more of the remote MIDI services available on the current LAN.<br />
<div><br />
<div class="separator" style="clear: both; text-align: justify;"> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitBsg4wGHyUdvOMI3DXIuW-wkDG82r3XCkwBcrIF3UNbHGCpIE5LoXsYlDZP_R_MO4NJV2owg4ccERCmUbR3YXqa_WX0dRIHOO53A3JAOKy45iwALQauhhvNJWNpTONbvxl6lGLhevTtM/s1600/Settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitBsg4wGHyUdvOMI3DXIuW-wkDG82r3XCkwBcrIF3UNbHGCpIE5LoXsYlDZP_R_MO4NJV2owg4ccERCmUbR3YXqa_WX0dRIHOO53A3JAOKy45iwALQauhhvNJWNpTONbvxl6lGLhevTtM/s320/Settings.png" width="222" /></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvnvFOGbEaxgl88fM-95BQxbpaduvtP3Njd4m-h8UkwPg5NI8ozD7XoP-uSDFrrYZGqGvz2_Uqj9V6aI45wMBxqG0AEJH0rdIuHQJFhnWFFXGAMq3yYBc4euMu0LAjM0lJWFAEpjP44xQ/s1600/Settings+2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvnvFOGbEaxgl88fM-95BQxbpaduvtP3Njd4m-h8UkwPg5NI8ozD7XoP-uSDFrrYZGqGvz2_Uqj9V6aI45wMBxqG0AEJH0rdIuHQJFhnWFFXGAMq3yYBc4euMu0LAjM0lJWFAEpjP44xQ/s320/Settings+2.png" width="222" /></a></div><div style="text-align: justify;"><br />
</div>Note that connections can also be made from the other end. By opening Audio MIDI Setup on a Mac on the same LAN, we can browse to the iPhone and initiate a connection from the computer. In this instance, the MIDIController instance will inform the UI that a connection has been made via an NSNotification. If multiple connections are made to or from the same device, they are bridged in that:<br />
<ul><li>All incoming data from the network is merged as if it was coming from a single device</li>
<li>Outgoing data from the device is sent to all network services</li>
</ul><div>The settings view also allows the user to set the MIDI channel on which messages will be sent in response to actions from the main UI views. This is similarly the channel on which the app will listen for incoming MIDI commands.</div><div><br />
</div></div><div>The MIDIController initialiser also sets up the shared <a href="http://developer.apple.com/library/ios/#documentation/CoreMidi/Reference/MIDINetworkSession_ClassReference/Reference/Reference.html">MIDINetworkSession</a> instance, which acts as a bridge between the network services and the CoreMIDI API. A MIDI client, input port and output port are then created. The input port is connected to the source endpoint of the MIDINetworkSession instance. Note that these endpoints are named from the perspective of the iOS application; the "source" endpoint is where data will be received from the network, and the "destination" endpoint is where the application will send data to the network.<br />
<br />
To send data to the output port once a connection has been made, the app invokes the methods in the section marked Sending in the implementation file, namely:<br />
<br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-(void) allNotesOffOnChannel:(NSUInteger)channel;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-(void) sendChangeForController:(NSUInteger)controller onChannel:(NSUInteger)channel withValue:(NSUInteger)value;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-(void) sendNote:(NSUInteger)note on:(BOOL)on onChannel:(NSUInteger)channel withVelocity:(NSUInteger)velocity;</span><br />
<span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">-(void) sendMMCCommand:(NSUInteger)command toDevice:(NSUInteger)device;</span><br />
<div><br />
</div><div>Internally, these use the writeMIDIPacket methods to construct a MIDIPacketList and send it via the output port created above to the MIDINetworkSession's destinationEndpoint. Care should be taken to construct the packet lists correctly, as sending garbage data (for instance where the packet count is set too high) will typically result in disconnection by the remote service.</div><div><br />
The sendChangeForController:onChannel:withValue: method is invoked in response to user input from the controller tab:<br />
<br />
</div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj9Af3sAy8Sr2OH6IYgqKaY030Qz202hyBcGs1b29U7IqAyM1Meepyy1PdEcyePzjO_HUBf4MZfmHC8rgOz96feMv_yzY6_31TSeaKnMZHcE2Jzk79e-pinBuPcLHHYRUAfE16tJ-duKc/s1600/IMG_0207.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgj9Af3sAy8Sr2OH6IYgqKaY030Qz202hyBcGs1b29U7IqAyM1Meepyy1PdEcyePzjO_HUBf4MZfmHC8rgOz96feMv_yzY6_31TSeaKnMZHcE2Jzk79e-pinBuPcLHHYRUAfE16tJ-duKc/s320/IMG_0207.PNG" width="222" /></a></div><div class="separator" style="clear: both; text-align: left;"><br />
</div>The sendNote:on:onChannel:withVelocity: method is invoked when the user presses the "keys" on the Notes tab:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4B8KgNK9vvd6OmaiAeL8T2EMS4DNeMvVpAOyNCTyvgtYXiRao18jyJgEvTPfqe7hBYFedXSzzNU2p0bXvVCOvAlLGDRJ86fFd_jQyLz2VRzKnQe4kJpQEjG8oGU8Wlncy_fFLTu_8WNA/s1600/IMG_0208.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj4B8KgNK9vvd6OmaiAeL8T2EMS4DNeMvVpAOyNCTyvgtYXiRao18jyJgEvTPfqe7hBYFedXSzzNU2p0bXvVCOvAlLGDRJ86fFd_jQyLz2VRzKnQe4kJpQEjG8oGU8Wlncy_fFLTu_8WNA/s320/IMG_0208.PNG" width="222" /></a></div><br />
The sendMMCCommand:toDevice: method is invoked in response to button presses on the MMC tab:<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5QCujHB_VHTcqIF74gLjWVyx94Ld1PwvZclMBkuBe3Kx_zeQ4d5D5NMQA4Avy4o_VTTcFJ8LAuu5Ajn_u8UZvP1IwZPATlnvFRoMZuzLstWNjqha7Wm17BBIDyBhk39JdiaebX66LCus/s1600/IMG_0209.PNG" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5QCujHB_VHTcqIF74gLjWVyx94Ld1PwvZclMBkuBe3Kx_zeQ4d5D5NMQA4Avy4o_VTTcFJ8LAuu5Ajn_u8UZvP1IwZPATlnvFRoMZuzLstWNjqha7Wm17BBIDyBhk39JdiaebX66LCus/s320/IMG_0209.PNG" width="222" /></a></div><br />
<i>Please note that the MMC command output hasn't been tested as I don't have any devices that respond to this part of the MIDI protocol. Let me know via the comments if you have any problems.</i><br />
<br />
The operation of the input port is described in <a href="http://antifluke.blogspot.com/2011/07/network-midi-on-ios-part-3.html">Part 3</a> of this article.<br />
<br />
<br />
</div></div>Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com0tag:blogger.com,1999:blog-2899348449286529018.post-15126372800278253222011-05-30T19:33:00.000+01:002014-09-14T19:00:22.686+01:00Network MIDI on iOS - Part 1<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: inherit;">This is an app I wrote to try out some ideas for networked MIDI on iPhone and iPad. It connects to a host computer running OS X Tiger or later (see the documentation for Apple's Audio MIDI Setup application), or any compatible RTP MIDI host such as <a href="http://www.tobias-erichsen.de/rtpMIDI.html">rtpMIDI for Windows</a>.</span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div class="separator" style="clear: both; text-align: left;">
<span class="Apple-style-span" style="font-family: inherit;"></span></div>
<div class="separator" style="clear: both; text-align: center;">
<span class="Apple-style-span" style="font-family: inherit; margin-left: 1em; margin-right: 1em;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRJQvUyYsVGgptDi9nquY9qBao52WZTjbopj32NTqknyud2kOcts_jnD915ynOkolsDNsLP_-HltLGTkEmOvPzJ7ghVIak-OuYkRuIVDH_FmypWsASnq6xv3eAB1cVaTqPrjHKqYA6gRg/s1600/Network+MIDI+on+iOS.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRJQvUyYsVGgptDi9nquY9qBao52WZTjbopj32NTqknyud2kOcts_jnD915ynOkolsDNsLP_-HltLGTkEmOvPzJ7ghVIak-OuYkRuIVDH_FmypWsASnq6xv3eAB1cVaTqPrjHKqYA6gRg/s320/Network+MIDI+on+iOS.png" height="320" width="164" /></a></span></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"></span>
<br />
<a name='more'></a></div>
<div>
<span class="Apple-style-span" style="font-family: inherit;">I will discuss the implementation details in further blog posts, as it introduces some useful concepts such as:</span></div>
<div>
<ul>
<li><span class="Apple-style-span" style="font-family: inherit;">Composing outgoing MIDI data in response to user input</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">Processing incoming MIDI data in real time (with semaphores and lock free buffers)</span></li>
<li><span class="Apple-style-span" style="font-family: inherit;">Finding network services with Bonjour</span></li>
</ul>
<div>
<span class="Apple-style-span" style="font-family: inherit;">For now, here's the source code.</span>
<span class="Apple-style-span" style="font-family: inherit;"></span></div>
</div>
<div>
<span class="Apple-style-span" style="font-family: inherit;"><br /></span>
<span class="Apple-style-span" style="font-family: inherit;"><strike><a href="http://www.mediafire.com/file/wtcsts114owm42d/NetworkMIDI.zip" rel="nofollow" target="_blank">XCode 4 Project (MediaFire download)</a></strike></span><br />
<span class="Apple-style-span" style="font-family: inherit;"><br /></span></div>
<div>
Updated project for iOS 5.1 - 6 using ARC:<br />
<br />
<strike><a href="http://www.mediafire.com/?316g6ph767guez7" rel="nofollow" target="_blank">XCode 4.51 Project (MediaFire download)</a>
</strike></div>
<div>
<br />
Updated project for iOS 7 (should work back to iOS 5.1):<br />
<div>
<br /></div>
<div>
<a href="http://www.mediafire.com/download/hc00ep92x5p2hia/NetworkMIDI_XCode_5.1.zip" target="_blank">Xcode 5.1 Project (MediaFire download)</a></div>
<b><strike><br /></strike></b>
<b><strike>Please note you need to run this on a device rather than the simulator.</strike></b></div>
<div>
<br />
(Now seems to work OK on the iOS 7 simulator at least).<br />
<br />
<b></b>Updated:</div>
<div>
</div>
<div>
<br />
See <a href="http://antifluke.blogspot.com/2011/05/network-midi-on-ios-part-2.html">Part 2</a> and <a href="http://antifluke.blogspot.com/2011/07/network-midi-on-ios-part-3.html">Part 3</a>.</div>
Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com12tag:blogger.com,1999:blog-2899348449286529018.post-66591986902247234952010-09-02T13:20:00.000+01:002011-07-15T13:28:22.897+01:00QCommander 0.1 Release<div><div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Q Commander is a freeware Macintosh application for use with the <a href="http://www.suzukimusic.com/education/qchord/">Suzuki Music QChord</a>. The purpose of the application is to translate the MIDI information produced by the QChord so that it can be used to control other MIDI devices.<br />
<br />
<div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5EiEAA3XTPSZ7JFXMgzxcRLL6I2RW_lR_nl8S76cehYjAwLxZexlC9pURYj3WuMfe1LDyv_xTHPQPFksIMjFibx8NjINg1PKR_ZLmjyYuYavVwOW5LEqG6Mo2JO4_XBdM3reE3yD4fLaV/s1600/QChord+Commander.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5EiEAA3XTPSZ7JFXMgzxcRLL6I2RW_lR_nl8S76cehYjAwLxZexlC9pURYj3WuMfe1LDyv_xTHPQPFksIMjFibx8NjINg1PKR_ZLmjyYuYavVwOW5LEqG6Mo2JO4_XBdM3reE3yD4fLaV/s320/QChord+Commander.png" /></a></div><br />
<br />
<a name='more'></a><br />
The standard MIDI output produced from the QChord presents difficulties to sequencers and external sound modules in that, for example:</div></div><div><ul><li>The strumplate outputs note information spread across three fixed MIDI channels.</li>
<li>Chord note information is output on a fixed MIDI channel.</li>
<li>Pitch bend messages are used extensively by the strumplate. Many non-General MIDI devices do not respond correctly to this.</li>
<li>The Rhythms are always output on channel 10, irrespective of whether they are audible through the QChord’s speaker.</li>
</ul></div></div><div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">Q Commander translates the strumplate notes to the components of the selected chord without pitch bend, and supresses the rhythm track. Strumplate and chord notes can be routed to the MIDI channels of your choice, and some of the controls on the QChord can be mapped to MIDI controllers. In addition, a virtual MIDI output is provided to enable use with MIDI sequencer and soft synth applications.</div></div><div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div></div><div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">This is a preliminary release of the software for testing. Further features will be added (as my free time permits) to enable the use of additional chord types not present on the QChord (such as ninths and slash chords), and to enable closer integration with MIDI sequencers.</div></div><div><div class="separator" style="clear: both; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: auto;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">A brief user guide is included.</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;">To download the disk images, please use the following Mediafire links:</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><a href="http://www.mediafire.com/file/uwszyx1nx8hlbm0/QCommander%200.1%20Universal.dmg">Universal binary for Intel and PowerPC Macs, OS X 10.4 or later</a></div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><br />
</div><div style="margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px;"><a href="http://www.mediafire.com/file/jjvd8dcaaaavm02/QCommander%200.1%20PPC%20for%2010.3.9.dmg">Power PC only version for OS X 10.3.9</a></div></div>Simon Lawrencehttp://www.blogger.com/profile/00390916026288409969noreply@blogger.com22