GithubHelp home page GithubHelp logo

gandrim / keyboardscanner Goto Github PK

View Code? Open in Web Editor NEW

This project forked from oxesoft/keyboardscanner

0.0 1.0 0.0 2.16 MB

Turn your broken (or unused) keyboard into a MIDI controller (with pedal and veloticy)

Home Page: https://www.youtube.com/watch?v=z840N9P-T2k

C++ 100.00%

keyboardscanner's Introduction

Moura's Keyboard Scanner

Turn your broken (or unused) keyboard in a MIDI controller (with pedal and veloticy)

This Arduino sketch was the one that I used to make the project demonstrated in this video. It is about a keyboard controller that I've made using an old Alesis QS6 Keyboard directly connected to an Arduino Mega rev3 acting as keyboard scanner with velocity reading and sustain pedal support.

In 2017 I did the same with another keyboard (an old Casio from a friend). The code was refactored and a great library called DIO2 was used to speed up the scanning and clean up the old code.

In 2020, thanks to Leandro Meucchi, from Argentina, the code is simpler to be used with any keyboard. He made the PDF showing the keyboard wiring for Yamaha PSR530 keyboard, that helps a lot do understand what needs to be done.

Warning: this sketch is for keyboard with velocity support only.

keyboardscanner

How velocity works

Normally it is a ribbon rubber with two contacts for each key that touch the board in two diffent moments: since the key was pressed until it slopes the board completly. The code measure the difference, varying between 2 and 120 ms, depending on the keyboard. It is transformed in a MIDI value from 0 to 127.

Diagram of one key

This scheme makes clear how to identify input and output pins. This has been the main question of guys on Youtube. I hope it helps:

key

How to make your own MIDI controller

  1. Disassemble the keyboard to have access to the flat cables (one, two or even three, depending on the number of keys and manufacturer);
  2. Using a multimeter with the diode testing function selected, find out and understand the matrix, starting from the first key. Some keyboards have a logical pattern, some doesn't;
  3. Connect the ribbon pins directly to the Arduino Mega (because it has enough pins to connect any keyboard with velocity). You dont't need to change anything in the keyboard circuit board;
  4. Change the pins in the code (output_pins + input_pins), uncomment DEBUG_MIDI_MESSAGE and see the console output;
  5. If the MIDI messages looks OK, comment DEBUG_MIDI_MESSAGE back and use some Serial<->MIDI Bridge like the excelent Hairless;
  6. If everything goes well, consider turn you Arduino in a MIDI interface using HIDUINO or similar firmware.
  7. Enjoy!

keyboardscanner's People

Contributors

oxesoft avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.