Git Product home page Git Product logo

synthesiakontrol's Introduction

Synthesia Kontrol Guide

Use Native Instruments Komplete Kontrol MK1 and MK2 light guide in Synthesia to learn keyboard.

Synthesia Kontrol

This is a project for my son, which you may find useful.

This program listens to light events from Synthesia sent to a virtual LoopBe1 midi port and lights the keys on Komplete Kontrol keyboard accordingly.

Install

Pre-requisites

  • Install LoopBe1 virtual midi port driver.

    💡 On Mac, you can use the built in "IAC Driver" - open "Audio midi setup" to create a device named "LoopBe" as explained by D-One

    🆕New: Since January 2023, check out KompleteSynthesia: a MAC native project from @tillt

  • In Synthesia:

    • Go to settings/Music Devices
    • Select "LoopBe Internal MIDI" from "Music Output"
    • In Keylight section of that output, select "Finger-based channel" (the last mode after 'channel 16')

SynthesiaKontrol

Windows

  • Download the Windows package locally on your PC from releases
  • Extract in a new folder
  • Run SynthesiaKontrol

Linux, MAC

Use the Developer method.

Developer

If you want to contribute to the project, you need to setup your Python environment.

⚠ SynthesiaKontrol only works with Python3. One of the symptom when using Python2 is that you will get an error message saying that the keyboard is not supported yet.

SynthesiaKontrol

  • Install Python's module:
pip3 install -r requirements.txt
  • Run the program:
python3 SynthesiaKontrol.py
  • Build executable (Windows)

    • Install cx_Freeze: pip3 install cx_Freeze
    • Run build
      python3 setup.py build
      
    • Result is in build directory.

Status

  • Proof of concept: light keys from Komplete Kontrol MK2 S61
  • Figure out all the possible colors - see color_scan.py
  • Python app to listen to midi events from Synthesia and light keys - see SynthesiaKontrol.py
  • Leverage finger based channel light mode from Synthesia, introduced in r4376 to show left and right hands on KK
  • Address issue where notes are turned off too quickly (Forum post here)
  • Package as simple executable
  • All notes off
  • Customizable note colors
  • Rainbow mode: when playing a note, make a rainbow on that note
  • Simpler / better instructions
  • Support all Komplete Kontrol MK2 keyboard sizes (currently only S61)
  • Support Komplete Kontrol MK1 keyboards
  • Use different colors per channel

Getting help

I prefer GitHub issues. Otherwise, there is a Synthesia forum thread here.

Acknowledgements

Thanks to

  • Nicholas Piegdon for his dedication to Synthesia, and the great help he provides for his user community
  • AnykeyNL to figure out an initial scheme for Komplete Kontrol MK1 USB protocol as well as the structure of an app
  • Jason Bret to have figured out the MK2 version, and the 0x81 endpoint which I use.
  • a1vv for the fork, and figuring out the changes for MK1 - which allowed me to create a version with support of MK1 and MK2
  • Nabume for the S88 MK2 info.
  • KompleteSynthesia: a MAC native project from @tillt

synthesiakontrol's People

Contributors

alopexxx avatar ojacques avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

synthesiakontrol's Issues

Support for MK1

Support for MK1 please? Time schedule? What is required? Can i help?

Light guide is different from actual notes to be played

I'm not sure why this is the case, but when I use my kontrol mk II 88 keyboard with the app, it lights up a key a few notes to the left of the actual key I'm supposed to hit in synthesia. I've tried it several times and have had the same issue repeat itself every time.

Light(s) stay on if same played note (KK S61 MK2, Windows)

Hi,

I'm using Komplete Kontrol S61 MK2 keyboard, OS is Windows 10 Pro 21H1 (64-bit), Synthesia v10.7 (full version, all unlockedl), LoopBe1 v1.6, and your lastest SynthesiaKontrol v1.3.

When I run SynthesiaKontrol, choice 1 (for S1 MK2), I see lights animations so assuming this keyboard is correctly recognized.

But while playing integrated song, related note(s) stay illuminated, even on MIDI Note Off event(s). It's problematic for consecutive identical notes, because by staying on, it's confusing about longer duration note...
Doesn't occur when I'm listing a song without playing, however.

When I press a note, its light turns off (even for a long-duration note).

Also, when I've finish to play the song, some lights may remain turned on, not always (white for left hand and/or green for right), this beaviour occurs randomly.

Any advice?

Thanks in advance.

Dominique.

Guitar Hero mode

Feature Request

It might be useful to pre-empt the notes so that you can play along and prepare your fingers for the next notes.

If a future note starts dim and gets brighter as it comes nearer it could work like Guitar Hero where you can "see ahead down the road".

Also maybe, different colour lights for each finger (assuming Synthesia has finger notation).

MK1 S49 support ?

Hello, I don't know if I do something wrong, but I have some difficulties to make my MK1 S49 Working with the light guide.. I do not see the S49 between the choice when I launch SynthesiaKontrol.exe :(

I am on windows 10, with LoopBe1 installed

OSError: open failed

I'm getting this errors when running SynthesiaKontrol under Windows 10 (Loop be installed and configured in Synthesia 10.4)

D:\SynthesiaKontrol>SynthesiaKontrol.exe
Connecting to Komplete Kontrol Keyboard
Traceback (most recent call last):
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\initscripts_startup_.py", line 14, in run
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
File "SynthesiaKontrol.py", line 98, in
File "SynthesiaKontrol.py", line 19, in init
File "hid.pyx", line 66, in hid.device.open
OSError: open failed

D:\SynthesiaKontrol>

Support for Kontrol MK3

Iam planning to update my trusty Mk1 Keyboard with the MK3 one.

Iam hoping to get Mk3 support for SynthesiaKontrol aswell.

Thanks for your effort!!!

-bash: pip: command not found

Hello,

I'm following the steps and this is as far as i can go.

Mansfields-MacBook-Pro:~ Mansfield$ pip install hidapi
-bash: pip: command not found

Any suggestions to finding a solution?

Thanks
Nathan

module 'hid' has no attribute 'device' (macOS)

I am trying to get this working on macOS, and get this message.
Any suggestions for a solution?

python3 SynthesiaKontrol.py

Select your keyboard (1,2,3,...):
  1-Komplete Kontrol S61 MK2
  2-Komplete Kontrol S88 MK2
  3-Komplete Kontrol S49 MK2
  4-Komplete Kontrol S61 MK1
  5-Komplete Kontrol S88 MK1
  6-Komplete Kontrol S49 MK1
  7-Komplete Kontrol S25 MK1
3
Connecting to Komplete Kontrol Keyboard
Opening Keyboard device...
Traceback (most recent call last):
  File "SynthesiaKontrol.py", line 224, in <module>
    connected = init()
  File "SynthesiaKontrol.py", line 24, in init
    device=hid.device()
AttributeError: module 'hid' has no attribute 'device'

Python errror: 'portName' is not defined

C:\SynthesiaKontrol>SynthesiaKontrol
Connecting to Komplete Kontrol Keyboard
Opening LoopBe input port
Listening to Midi
Traceback (most recent call last):
  File "C:\Users\jacqu\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 14, in run
  File "C:\Users\jacqu\AppData\Local\Programs\Python\Python36-32\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
  File "SynthesiaKontrol.py", line 106, in <module>
NameError: name 'portName' is not defined

When I open SynthesiaKontrol.exe from file explorer, it just closing.

Custom Light Effects

Hey there,

first of all great work 👍 This is not really an issue but I figured I could modify the code to make some custom light effects.
I'm thinking about a fire animation like this one.

I'm not so good with python but I can probably make it. I just don't get which code represents which color
for example: bufferC = [0x00] * 249 makes everything black while bufferC = [0x09] * 249 makes everything orange.

But where can I look up the values, without having to brute force the colors. Can you please help me out :)

Also maybe you have an idea for the algorithm to do this effect. I'm thinking an list of x colors like red, orange, yellow, white and randomly going up or down that list. Each key independently.

Cheers

Komplete Kontrol S88 MK2 Lights showing up wrong

Hello, i cannot seem to get the script working with the S88 MK2
I have synthesia set to ch1 output on LoopBe port and the script running successfully
however when i press the middle c key the light for A1 shows up,
A3 lights up F#2. etc etc none of the keys light up as they should.
I have selected S88 MK2 in the script.
Is it a bug in the script or a user error on my end?.
Running Python3 with the dependencies on Mac OSX High Sierra

Exe file not working on Windows, seems that the paths to dependencies are hardcoded

C:\Users\Hackintosh X99\Documents\SynthesiaKontrol.v1.1\SynthesiaKontrol.v1.1>SynthesiaKontrol.exe
Select your keyboard (*1,2,3,4):
1-Komplete Kontrol S61 MK2
2-Komplete Kontrol S88 MK2
3-Komplete Kontrol S61 MK1
4-Komplete Kontrol S88 MK1
3
Connecting to Komplete Kontrol Keyboard
Opening Keyboard device...
Turn off lights for all notes
Connected to Komplete Kontrol!
Turn off lights for all notes
Opening LoopBe input port
Traceback (most recent call last):
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cx_Freeze\initscripts_startup_.py", line 14, in run
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\cx_Freeze\initscripts\Console.py", line 26, in run
File "SynthesiaKontrol.py", line 206, in
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mido\backends\backend.py", line 169, in get_input_names
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mido\backends\backend.py", line 162, in get_devices
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mido\backends\backend.py", line 42, in module
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mido\backends\backend.py", line 58, in load
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\importlib_init
.py", line 127, in import_module
File "", line 1006, in _gcd_import
File "", line 983, in _find_and_load
File "", line 967, in _find_and_load_unlocked
File "", line 677, in _load_unlocked
File "", line 728, in exec_module
File "", line 219, in call_with_frames_removed
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\mido\backends\rtmidi.py", line 8, in
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python37-32\lib\site-packages\rtmidi_init
.py", line 4, in
ImportError: DLL load failed: No se puede encontrar el módulo especificado.

S88 MK2 Komplete Kontrol

How does one get get my keyboard to display the correct hand colour matching synthesia. seems to stay green and blue.

S88 MK1 Keyboard user here working but with issues

I have it working, kinda, but I have to have Komplete Kontrol open, disable light guide in preferences. Also sometimes the lights do not light up... Well actually alot of the time. Only some notes decide to light up when I am playing a song in synthesia. I'm on a Mac OS MOjave. Any suggestions? It's not very usable as is.

Sorry, keyboard not supported yet!

OS: MacOS Mojave 10.14.4
HARDWARE: Komplete Kontrol S61 MK2

Following error:

MacBook-Pro:SynthesiaKontrol danny$ sudo python SynthesiaKontrol.py
Select your keyboard (1,2,3,...):
1-Komplete Kontrol S61 MK2
2-Komplete Kontrol S88 MK2
3-Komplete Kontrol S49 MK2
4-Komplete Kontrol S61 MK1
5-Komplete Kontrol S88 MK1
6-Komplete Kontrol S49 MK1
7-Komplete Kontrol S25 MK1

( I press "1" for 1-Komplete Kontrol S61 MK2 )----> resulting with:

Sorry, keyboard not supported yet!

Any Ideas???

Komplete Kontrol S88 MK2 not supported on MacOS

Thanks for this script! I was super happy to find this!

But I get the error, that the S88 MK2 (and MK1) is not yet supported. Not sure, whether this is a bug or just a feature which is yet missing? Could you clarify?

S88 MK2 Colours incorrect

How does one get get my keyboard to display the correct hand colour matching synthesia. seems to stay green and blue.

S88 MK2 Lights not operating on Synthesia

First of all, thank you so much for all the hard work! I am having an issue with the S88 MK2, where the lights are not working with synthesia. When I run the SynthesiaKontrol it does the full spectrum light show on the keyboard, however I can not get it to work when using Synthesia. Attached are photos, I am on Windows 10. I look forward to using this set up with my piano students!

image

image

image

image

NameError: name 'quit' is not defined

Trying to get this running, and getting:

C:\Users\temp\Downloads\SynthesiaKontrol.v1.4>python3 --version
Python 3.12.4

C:\Users\temp\Downloads\SynthesiaKontrol.v1.4>SynthesiaKontrol.exe
Select your keyboard (1, 2, 3, ...) and press 'Enter':
1-Komplete Kontrol S61 MK2
2-Komplete Kontrol S88 MK2
3-Komplete Kontrol S49 MK2
4-Komplete Kontrol S61 MK1
5-Komplete Kontrol S88 MK1
6-Komplete Kontrol S49 MK1
7-Komplete Kontrol S25 MK1
2
Connecting to Komplete Kontrol Keyboard
Opening Keyboard device...
Error: open failed
Traceback (most recent call last):
File "SynthesiaKontrol.py", line 26, in init
File "hid.pyx", line 142, in hid.device.open
OSError: open failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python310\Lib\site-packages\cx_Freeze\initscripts_startup_.py", line 130, in run
File "C:\Users\jacqu\AppData\Local\Programs\Python\Python310\Lib\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
File "SynthesiaKontrol.py", line 232, in
File "SynthesiaKontrol.py", line 29, in init
NameError: name 'quit' is not defined

C:\Users\temp\Downloads\SynthesiaKontrol.v1.4>

looks like it's referencing files under jacqu username?

Not working on KK S61 MK1, Windows

Unfortunately this was not working with my KK S61 MK1, on Windows. The S61 was found and the CoolDemoSweep function worked. But after that, the lowest C key would remain dimly lit, and no other keys would light in response to the MIDI events coming from Synthesia. The MIDI events were being written to the command window.

Edit:
After studying the code more and thinking it over, I have a better grasp on the issue.

The main issue is local instances of bufferC being created that hide the global instance. This occurs in both notes_off() and CoolDemoSweep(). Instead of setting the elements of bufferC to 0x00, the code makes an assignment, similar to:
bufferC = [0x00] * NB_KEYS
This assignment creates a local instance of bufferC, it does not update the global instance defined in init().

This causes an issue for my S61 MK1 keyboard because the buffer is too long by one byte. This is caused by the global instance and the local instance in notes_off() being 249 bytes, and being written to the device using:
device.write([0x82] + bufferC)

An additional problem is the color used for the thumb keys. The MK1 ignores the most significant bit of the RGB byte values. This makes 0x80 equivalent to 0x00, and causes any MIDI event using a thumb channel to not light the key.

I have a version that fixes these issues, and I'm working on a fix for a small issue in CoolDemoSweep(). (Caused by calculating the index into bufferC using x*3-2 when the loop index equals 0.) If you'd like, I will update the code so you can test it. I'm new to GitHub, so I'm not sure of the best way to do this.

MacOSX Installation - msvcrt module

MacOS does not have the msvcrt:

$ python3 SynthesiaKontrol.py
Traceback (most recent call last):
File "SynthesiaKontrol.py", line 10, in
from msvcrt import getch
ModuleNotFoundError: No module named 'msvcrt'

I try to fix it changing the "from msvcrt import getch" from SynthesiaKontrol.py to only "import getch"

Keyboard not supported

Hi,

I get the following error, not matter which keyboard I select:
Select your keyboard (*1,2,3,4):
1-Komplete Kontrol S61 MK2
2-Komplete Kontrol S88 MK2
3-Komplete Kontrol S61 MK1
4-Komplete Kontrol S88 MK1
4
Sorry, keyboard not supported yet!

I have a s61mk1, it's in midi mode and everything else is like it hsould be according to your steps so I'm wondering why it doesn't work?

S88 MK Lights dont show with song

I have a KK S88 MK2. And after following the instructions Carefully. It sill won't work

I dont have KK open

When i louch synthesia and your program and select my piano, the lights get turned off. Than when i start a song (any song) the lights dont work.
I read the last persons Issue and i mirrored his settings.

What do i need to do?

No light guide on KK61 mk1

Hi,

I have installed loopbe1 and done the required setup in Synthesia, but no light guide on my KK mk1.
SynthesiaKontrol is running and receiving notes on off message.
What am I missing ?

Thanks for any help.

Question: notes turn off too quickly

Dear Olivier,

I am currently adding midi functionality to my analog upright piano (from 1905) by adding a custom led strip for output and otpical distance sensors under the keys for input. As always, I found about your code and the necessary information regarding Synthesia mid-way through the project as I ran into the same issue you had, when notes/lights were turned off too quickly. In the forum post and in the changelog, you mention that you solved the problem, but I can't seem to find out how :)
My arduino code looks very similar. First, I light up keys based on the channel were the note on message arrived (with the finger based channel mode in synthesia), then I turn them off when receiving the note off message. However, they turn off after a fraction of a second, regardless of their actual duration.

Any hint, what I'm doing wrong? Or what you did to solve that? I could post the code this evening, I don't have access to my laptop at the moment.

Thank you!
Max

LoopBe detection fails (Windows 11)

Running SynthesiaKontrol.v1.4 + LoopBe1 v1.6 + Windows 11.

LoopBe detection fails:

Connecting to Komplete Kontrol Keyboard
Opening Keyboard device...
Turn off lights for all notes
Connected to Komplete Kontrol!
Turn off lights for all notes
Opening LoopBe input port
Error: can't find 'LoopBe' midi port. Please install LoopBe1 from http://www.nerds.de/en/download.html (Windows) or name your IAC midi device 'LoopBe' (on Mac).
Traceback (most recent call last):
  File "C:\Users\jacqu\AppData\Local\Programs\Python\Python310\Lib\site-packages\cx_Freeze\initscripts\__startup__.py", line 130, in run
  File "C:\Users\jacqu\AppData\Local\Programs\Python\Python310\Lib\site-packages\cx_Freeze\initscripts\console.py", line 16, in run
  File "SynthesiaKontrol.py", line 245, in <module>
NameError: name 'exit' is not defined

Does not seem to find any ports as there is no "Found MIDI port" outputs. LoopBe1 is visible in both Device Manager and Synthesia settings. "Run as administrator" does not help either.

What to check? Should SynthesiaKontrol work on Windows 11?

Additionally, "exit(1)" in "SynthesiaKontrol.py", line 245 fails with the traceback seen above.

Novation SL MK III

Hi Jacques!

Do you think that it would be possible to make it work for the Novation SL MK III ?
I'd be willing to help if you think that porting the script is feasible ?

Eric

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.