http://www.codeproject.com/Articles/622 ... OutputBase
Keeping in mind that I'm a very consistent programmer: uniformly terrible in C#, .net and Cobra, would you guys take a moment and point me in the right direction on how to think this all out? Obviously, I'll need to port his sample MIDI output program-ette and get it working on Cobra.
- Code: Select all
using(OutputDevice outDevice = new OutputDevice(0))
{
ChannelMessageBuilder builder = new ChannelMessageBuilder();
builder.Command = ChannelCommand.NoteOn;
builder.MidiChannel = 0;
builder.Data1 = 60;
builder.Data2 = 127;
builder.Build();
outDevice.Send(builder.Result);
Thread.Sleep(1000);
builder.Command = ChannelCommand.NoteOff;
builder.Data2 = 0;
builder.Build();
outDevice.Send(builder.Result);
}
(This looks fairly trivial to port, though I didn't quite get the assignment in the "using" statement. May I assume this is nothing more than just another C-ish "do two or three dimly related things in only one line of code, so that the code becomes unreadable by amateurish programmers"?)
In any case, what I'm hoping for from you guys is a brief general discussion, or links pointing to such a discussion, of how best to use Leslie's C# code in a Cobra environment? Do I port his classes (Horrors!), somehow instantiate his C# classes directly from Cobra, or somehow compile his C# code and then somehow call to the compiled code from Cobra. In short, I guess I'm ready to do my first investigation of how Cobra "plays nice" with C#, and I guess more generally how .net langs in gen'l "play nice" with other .net langs. Where do I begin, please?
Thanks.
-Paul