It is currently Thu Mar 28, 2024 3:35 am


Favorite midi scanner for wiring keyboards?

Building organ consoles for use with Hauptwerk, adding MIDI to existing consoles, obtaining parts, ...
  • Author
  • Message
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Favorite midi scanner for wiring keyboards?

PostMon Jun 14, 2021 3:28 pm

For parallel wired keyboards I suggest using one $15 Arduino Mega per keyboard to achieve the necessary 61 inputs. The Arduinos are then daisy chained through their serial ports in such a way that the result is one data stream with different channels automatically assigned to each keyboard.

Here is the code:

https://sites.google.com/site/casavanto ... el-scanner

Certainly the cheapest way to go!
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostMon Jun 14, 2021 4:32 pm

Is a wiring diagram available?

Rgds,
Ed
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostMon Jun 14, 2021 7:19 pm

Think I have it figured out, thanks. Missed daisy chain connections on first read thru.

Rgds,
Ed
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostTue Jun 15, 2021 4:14 pm

After loading Arduino software, (I copied and pasted the code from my documents folder where the code was saved to) etc., I'm getting these errors:

c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino: In function 'void loop()':
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:153:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:253:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:272:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:377:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:412:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:451:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:547:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:584:1: error: a function-definition is not allowed here before '{' token
{
^
c:\Users\Ed\Documents\Arduino\sketch_jun15b\sketch_jun15b.ino:590:1: error: expected '}' at end of input
}
^
Compilation error: Error: 2 UNKNOWN: exit status 1

BTW, I'm using - Arduino IDE 2.0 beta

Rgds,
Ed
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Favorite midi scanner for wiring keyboards?

PostTue Jun 15, 2021 8:36 pm

I'm at a loss as to what is going on here. It looks like mismatched brackets somewhere.

I copied and pasted the code directly from my website and it compiled without error.
I'm still using version 1.0.6 and reluctant to switch. You know, if it works ...

Also, an Organ Forum member used this same code in his system and reported that it works just fine.

It would be useful to know which line the compiler is highlighting in an effort to track down the error.

Keep me posted, John
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostWed Jun 16, 2021 6:28 pm

Is there s place in the code that allows for MIDI channel to be set other than channel 1?

Rgds,
Ed
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Favorite midi scanner for wiring keyboards?

PostWed Jun 16, 2021 9:10 pm

In the procedures, turnNoteON () and turnNoteOFF () changing:     
Serial.write (0x90);          //note ON, channel 1,
to      
Serial.write (0x91);          //note ON, channel 2,
causes the last Arduino in the daisy chain to output on channel 2 instead of channel 1.
Preceding Arduinos are then assigned channels 3, 4, 5 etc. instead of 2,3,4 etc.

This is handled automatically by the procedure,  processSerial () with the line:
      Serial.write (noteStatusRx + 1);              //output on port 0, one channel up 
where one is added to the channel number of any data passing through.

Basically, you can program the channel sequence to start on any channel number you want.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostWed Jun 16, 2021 10:49 pm

Great. That's kinda what I figured looking at the code. Does that require all of the Arduinos to be connected daisy chained (via Serial Port 0) at the time the code is installed?

The one slight objection is in the way the Arduino connections are made. I ordered these prototype boards from Amazon:
https://www.amazon.com/gp/product/B08LH8YZSY/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

Used the prototype board piggy-backed over the Arduino using dressmaker pins soldered to the prototype board then pushed into the Arduino connectors. Using nylon spacers with 4/40 screws to fasten the boards together. Conveniently the power and USB connectors are accessible.

"Sandwiched" between the Arduino board and the prototype board I created a wiring interface - connecting the designated Arduino pins to four - 16 pin IDC connectors on the top side of the prototype board in a more conventional keyboard scanner layout. Also mounted two 5 pin din chassis receptacles on top of the prototype board using this output circuit

Image

I noticed the provision for a single 15K expr pedal or other variable control.. Some other neat codes you have created as well. 8) BTW, using Arduino IDE 1.8.15 may have solved my original problem. Haven't finished doing the mod and installing yet.

Rgds,
Ed
Offline

larason2

Member

  • Posts: 751
  • Joined: Thu Feb 04, 2016 9:32 pm

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 8:14 am

Wiring the Midi plug as you have diagrammed may work, but it didn’t work for me. I ended up having to desolder the resistor from the pin the Tx connects to to get it to work.
Offline

larason2

Member

  • Posts: 751
  • Joined: Thu Feb 04, 2016 9:32 pm

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 8:18 am

For the connections to the Arduino, what I did is put an IDC connector on the end of my cables, then wire the IDC connector directly to the Arduino using jumpers. It’s not as permanent as soldering, but it’s easy to rewire while you’re getting the programming and final wiring figured out. I have tried bread boards but I don’t like them, I don’t feel the contacts are very reliable.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 10:59 am

This is an easy (depending on your skill set) to moderate project. Would say doable for many HW folks. Something to consider not only for the cost saving, but esp with Amazon's 2 day prime delivery, a very fast GET.

In place of the real Arduino Mega 2560 (rev 3) board, total codt is $39.81 - ($35.81 for the board - plus another $4.00 for the prototype board and connectors)

https://www.amazon.com/ARDUINO-MEGA-2560-REV3-A000067/dp/B0046AMGW0/ref=sr_1_1_sspa?dchild=1&keywords=Arduino+MEGA+2560&qid=1623945740&sr=8-1-spons&psc=1&smid=AA57DDZKZUZDL&spLa=ZW5jcnlwdGVkUXVhbGlmaWVyPUFUSjZQSUlVUFAxTlcmZW5jcnlwdGVkSWQ9QTA2MDEwNTEyUU1LVlNaUlFVU0JVJmVuY3J5cHRlZEFkSWQ9QTEwMDkxNTIzRUY2OTJKVzY4WVpWJndpZGdldE5hbWU9c3BfYXRmJmFjdGlvbj1jbGlja1JlZGlyZWN0JmRvTm90TG9nQ2xpY2s9dHJ1ZQ==

Since Arduino is open source I'm going to try a clone version:

https://www.amazon.com/gp/product/B01H4ZLZLQ/ref=ppx_yo_dt_b_asin_title_o01_s00?ie=UTF8&psc=1

Have read mostly good reports for this particular board (which includes the boot loader). Total cost - $21.23 - ($17.23 plus another $4.00 for the prototype board and connectors). Even with the assembly/build time, a lot faster (and cheaper) than with other keyboard skanner - encoder sources. I did originally buy the genuine Arduino Mega 2560 to help support the Arduino community.

Rgds,
Ed
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 12:11 pm

Strictly for the geeky, tech minded, (which you don't at all need to know anything about), here is a related schematic:

https://ae01.alicdn.com/kf/Hc4ee556161ee4bd191fb230bf7c78f384.jpg.

Rgds,
Ed
Offline

jkinkennon

Member

  • Posts: 1208
  • Joined: Thu May 07, 2009 9:43 am
  • Location: Vancouver, WA

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 12:20 pm

I would caution against looking for the cheapest encoder available. The professionals who make a living designing and selling encoders aren't going to sell an encoder for the cost of the parts or even for three times the cost of the parts. My favorites have been the Midi Boutique encoders though I don't know how the company is doing without the founder. I'm sure the midi-hardware units are equally good.

There are cheap DIY solutions with good hardware for a few dollars. The programming will vary but it may be a risk worth taking especially for those who really enjoy programming. For everyone else a few hundred dollars for solid, first rate products is not unreasonable compared to the other costs of building a VPO.
Offline
User avatar

engrssc

Member

  • Posts: 7283
  • Joined: Mon Aug 22, 2005 10:12 pm
  • Location: Roscoe, IL, USA

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 2:01 pm

Totally agree. I wasn't esp going for cheap but my last order took six weeks. Considered Arduinos as an alternative work around. Just curious, how do Teensy boards rate? (Much depends on the programmer's skill.) Nothing tech and computers is totally without possible issues. Consider the scale of Fastly's bug last Tuesday bringing down a large part of the Internet. To their credit, it was fixed in 50 or so minutes.

Rgds,
Ed
Offline

Coenraads

Member

  • Posts: 73
  • Joined: Fri Feb 01, 2019 10:13 pm

Re: Favorite midi scanner for wiring keyboards?

PostThu Jun 17, 2021 4:31 pm

Re: installing the code. No, the boards do not need to be connected while doing this. Start by editing the channel start number, if you want it to be other than one as described earlier. Next, without making any further channel changes, load this identical code separately into each of the Arduinos you wish to use.

Re: making connections. Here I have nothing new to offer. (And don't get me going on DuPont connectors) I like the boards you purchased and would go that route. But dressmaker pins? I would probably use standard header pins. Do make sure that all the units share a common ground which should also run to each of the common switch buses. And don't forget to connect Tx from one board to Rx of the next board in the daisy chain to complete the serial connections.Here is another (although expensive) alternative I'd consider if faced with making 61 connections to each of several Arduinos.

https://www.amazon.com/Electronics-Salo ... 33&sr=8-16

Re: two 220 ohm resistors with MIDI OUT. I've never had a problem with this configuration when I have used M-Audio or Roland 5-pin DIN to USB converters. The $5 cheap units sometimes work and sometimes don't. I've had some success resurrecting these by redoing the shoddy soldering inside the case.

Re: expression pedal. Had a pin left over and thought this would be a useful feature. If you are not using this feature, make sure that pin 69 is tied high or low. Unconnected, it may float and generate spurious control signals.

Re: Arduino board. I really like the quality of the boards supplied by Elegoo. And I can be assured that it has the (square) Atmel communications chip. Well worth the few extra dollars.

Re: MIDI Boutique (and others) These are  excellent alternatives for those  who want something tested and tried. But some of us just enjoy the challenge of "rolling our own." And if it saves a few dollars, so much the better.
PreviousNext

Return to DIY organ consoles / MIDI

Who is online

Users browsing this forum: No registered users and 7 guests

cron