Page 1 of 1

Controlling Linnstrument lights with Microsoft Excel VBA

Posted: Tue Apr 30, 2024 5:04 am
by thewanderingv
Hi folks,

I've been experimenting with the lights on the Linnstrument (I know Roger and others feel it's best to stick with them as they are to improve learning but it's difficult to resist!), and found that the easiest way for me to program them in ways that I wanted was using Microsoft Excel. Because I learned music in different systems (Western Classical and Indian Carnatic), I was looking for ways to quickly send certain scales that I wanted to improvise with or explore using the Linnstrument layout, but I found that there was no tool that helped me do that in the ways I wanted to.

I've never coded anything useful in my life before, but figured that I'd try and use Excel at first to organize my thinking about what I wanted to do -- primarily because music is formulaic and Excel is great at automating formulae. The more I looked into it, I found that the combination of a simple computational tool like Excel along with scripting capabilities was worth exploring further.

So I spent a few days working on some VBA scripts -- all of which prepare midi instructions in the format that (the outstanding) Sendmidi uses. A few more days, and I realized that I could actually send those instructions to the Linnstrument on the fly. I did this by linking it to a shell scripting arrangement where Excel exports a temporary file containing a concatenated Midi instruction set that's then executed by the outstanding Sendmidi tool.

What's different (I think) from other tools is that you don't have to go into each square to change things - there is a lot of automation to make things go faster: you can very quickly turn all lights off, reset to default, just light up the Cs and Gs for practice. But most importantly, you can just put a couple of Xs on the notes or scale you want to construct, and then hit the send button to have Linnstrument light up just those notes/scales.

I attach a few screenshots in case anyone is interested. Happy to share the file--with the caveat that this is my first time coding so it's probably the messiest and most inefficient coding you'll see in your lifetime. I did this in a Mac, and I understand it's 10000 times easier to do with Windows primarily because of all the new sandboxes and restrictions in place with more recent MacOS releases.


Screenshot 2024-04-30 at 07.49.58.png
Screenshot 2024-04-30 at 07.50.53.png
Screenshot 2024-04-30 at 07.51.24.png
Screenshot 2024-04-30 at 08.10.49.png

Cheers
Vinny

Re: Controlling Linnstrument lights with Microsoft Excel VBA

Posted: Tue Apr 30, 2024 5:07 am
by thewanderingv
Just to add that I've been experimenting with the NRPN global and accent light codes since my primary use is to light up all squares belonging to a specific note but it doesn't seem to work as well - the CC commands are more reliable. I'm not sure why because the NRPN commands work fine when I slowly input them manually via Sendmidi, but when they are sent as a bulk instruction it ends up being very buggy and random lights go on and off.

Re: Controlling Linnstrument lights with Microsoft Excel VBA

Posted: Tue Apr 30, 2024 7:11 am
by FranklyFlawless
Thank you for your contribution Vinny.

Re: Controlling Linnstrument lights with Microsoft Excel VBA

Posted: Sat May 04, 2024 2:19 pm
by BobDog
Absolutely brilliant, hats off to you Vinny.