Isomet Modular Synthesiser (iMS) API
v1.4.2
iMS API
|
This tutorial will demonstrate a simple example for creating a new software project in Visual Studio 2013/2015, how to reference the API and write a simple application that connects to the iMS. In part (b) we extend the example to play back an image that can be observed on a spectrum analyzer or oscilloscope.
You will need to have available:
Connect the iMS system to your PC's USB port. Apply power to the iMS.
Start up Visual Studio 2013. From the "Community 2013" window, press Start -> New Project... Expand the Installed Templates to see under "Visual C++" -> "Win32" and select "Win32 Console Application"
In the Application Wizard that comes up, select "Next" (not "Finish") then ensure the box next to "Empty Project" is checked. Click Finish.
Right click on "Header Files", select Add -> Existing Item...
Right Click on "Source Files", select Add -> New Item...
The new source file will open in the main editor window in Visual Studio. Add the following code to get started:
We now have a blank source file to work in, but we need to configure Visual Studio to know how to compile against the software library. Right click against the project name (iMS_tutorial1 - the line BELOW "Solution 'iMS_tutorial1'") and select properties.
From the Property Pages, now expand "Linker -> General" and select "Additional Library Directories" and go through the same process to add a reference to the SDK folder containing the 32-bit DLL (/lib/i386)
The last step in setting up the project is in Windows Explorer to copy the .dll iMSLibrary_dbg.dll from /lib/i386 to the project folder you created: (e.g. C:\temp\iMStutorial1\iMStutorial1). It should be in the same folder as the source file Source.cpp.
Now we will add some code to search for an iMS System and try to connect to the first one that we find
In the main function, copy the following code and insert before the "return 0;" line:
This code will create a connection list (see ConnectionList.h) that knows how to communicate with an iMS system on all supported connection types. We then ask the list to scan these connections to discover any iMS's connected to the host. Any that it finds are returned in an array complete with all the information that we were able to find out about them (configuration, model numbers, serial numbers etc). If none were found, the application aborts and exits.
In this example, the first iMS in the array is connected to, but you could be more specific by interrogating the iMS's serial numbers or other data - see the documentation for IMSSystem.h for more detail.
The application displays the message "Connecting to IMS System on port: " with a string descriptor of the connection port, and tests that it has a valid connection with both a synthesiser and a controller. If not, it will abort and warn the user.
You can run this application (press F5) and it should show the "Connecting" message then exit successfully. Your first iMS application!
Continue to Tutorial 1(b): Programming and Playing an Image