Turning Nintendo Switch Joy-Con into a Musical Instrument via Python

Category:Tech BlogTags:
#Python#Max/MSP#Bluetooth#Open Sound Control
Published: 2020 - 1 - 26

I participated in the development of joycon-python, a Python library that retrieves information from a Bluetooth-connected Joy-Con via hid. Using joycon-python, I created a script called joycon-osc to send signals via OSC (Open Sound Control), and then received the transmitted information in Max to generate sound.

Here is what it looks like.

People are often surprised when I say this, but I don't own a Nintendo Switch, yet I have Joy-Cons, the controllers for the Nintendo Switch. That's because I only bought (or was made to buy) the Joy-Cons.

So, when I was thinking about connecting the Joy-Cons to my Mac to play around with them, I found an article titled Qiita: Connecting to Joy-Con via Bluetooth from Python to get 6-axis sensor and input information. I immediately visited the repository published by the author, forked it, packaged it, and submitted a PR (and was moved by the very polite code review I received). That is the repository below.

It is now published on PyPi and can be used with pip install joycon-python.

Next, I created a script that monitors the state of the Joy-Con and sends OSC. That is also published as the repository below.

Once you are ready to send OSC, all you have to do is receive it in Max and turn it into sound.

Read more articles