Category Archives: Research

Game Controller Comparison For SuperCollider

SuperCollider’s HID class lets users connect many types of game controllers without additional software installations. While establishing a connection between a human input device and SuperCollider is easy, decoding the mapping system requires time and effort. A user needs to press a button in the controller, monitor the ID number assigned to the specific button, and then document the result for further use. The good news is that once a user figures out and shares the mapping structure of a device, there is no need to repeat the discovery procedure until the next major OS update.

The chart below shows the control surface-to-SuperCollider mapping of four game controllers: DualShock 4 for PlayStation 4, DualSense for PlayStation 5, Logitech FS310, and Xbox Wireless Controller. It lists elements (ID numbers corresponding to a specific control surface in a device) and their value range for HIDFunc.element command. With the element numbers and ranges below, one can map the incoming data from a controller to various parameters available in SuperCollider.

Element Numbers and Range of Game Controllers

Sony DualShock (PS4)Sony DualSense (PS5)Logitech FA310 Mode DMicrosoft Xbox
BluetoothBluetoothUSBBluetooth
ID (1356, 2508)ID (1356, 3302)ID (1133,49686)ID (1118, 765)
Control Surface [sony | xbox]Element#, (value)Element#, (value)Element#, (value)Element#, (value)
Square | X0, (0 or 1)0, (0 or 1)0, (0 or 1)13, (0 or 1)
X | A1, (0 or 1)1, (0 or 1)1, (0 or 1)10, (0 or 1)
O | B2, (0 or 1)2, (0 or 1)2, (0 or 1)11, (0 or 1)
Triangle | Y3, (0 or 1)3, (0 or 1)3, (0 or 1)14, (0 or 1)
L1 | LB4, (0 or 1)4, (0 or 1)4, (0 or 1)16, (0 or 1)
R1 | RB5, (0 or 1)5, (0 or 1)5, (0 or 1)17, (0 or 1)
L2 | LT button6, (0 or 1)6, (0 or 1)6, (0 or 1)not found yet
R2 | RT button7, (0 or 1)7, (0 or 1)7, (0 or 1)not found yet
Share | Back8, (0 or 1)8, (0 or 1)8, (0 or 1)25, (0 or 1)
Options | Start9, (0 or 1)9, (0 or 1)9, (0 or 1)21, (0 or 1)
L3 | LSB button10, (0 or 1)10, (0 or 1)10, (0 or 1)not found yet
R3 | RSB button11, (0 or 1)11, (0 or 1)11, (0 or 1)not found yet
Logo12, (0 or 1)12, (0 or 1)not found yetnot found yet
Trackpad button13, (0 or 1)13, (0 or 1)N/AN/A
L3 | LSB x-axis14, (0 to 255)14, (0 to 255)13, (0 to 255)0, (0-65535)
L3 | LSB y-axis15, (0 to 255)15, (0 to 255)14, (0 to 255)1, (0-65535)
R3 | RSB x-axis16, (0 to 255)16, (0 to 255)15, (0 to 255)2, (0-65535)
R3 | RSB y-axis17, (0 to 255)17, (0 to 255)16, (0 to 255)3, (0-65535)
L2 | LT continuous19, (0 to 255)19, (0 to 255)not found yet26, (0-1023)
R2 | RT continuous20, (0 to 255)20, (0 to 255)not found yet27, (0-1023)
up18, (0)18, (0)17, (0)28, (1)
up+right18, (1)18, (1)17, (1)28, (2)
right18, (2)18, (2)17, (2)28, (3)
right+down18, (3)18, (3)17, (3)28, (4)
down18, (4)18, (4)17, (4)28, (5)
down+left18, (5)18, (5)17, (5)28, (6)
left18, (6)18, (6)17, (6)28, (7)
left+up18, (7)18, (7)17, (7)28, (8)
release18, (8)18, (8)17, (8)28, (0)

Link to Google Sheets version

Analysis of Element Numbers and Range

The number of available control surfaces, as well as their ranges, varies between the brands. However, all game controllers have three types of input methods. 

  • Button: sends 1 when pressed and 0 when released.
  • Directional Pad: assigns eight integers for eight directions and one integer for the release/unpressed state. The release state is mapped to value 8 in the Sony and Logitech controllers, while it is assigned to 0 in the Xbox controller.
  • Continuous Control: sends a range of numbers like a slider or a knob in a MIDI controller. All but the Xbox controller sends data ranging from 0-255. The Xbox controller has two types of ranges (0-65535 and 0-1023).

More expensive controllers have more features, such as motion sensors and microphone input, but the HID class does not detect them. The number of game controller features available for HID seems to depend on the hosting OS’s version. In 2018, HID received DualShock’s motion sensor and trackpad data when connected to a Macintosh with a USB cable (source). After a few OSX updates, I could not replicate the result in 2025. It is possible that additional input methods could be detected if an external app or extension is installed. I did not test the possibility as my goal is to avoid additional technical steps. 

Demo SuperCollider Patches

Readers can test, study, and modify the controller mapping structure with the .scd files provided in the link above. All four files, one for each model of the controller, have the same parts: 1. Controller initialization 2. Connection tester 3. Controller-to-sound example. The coding style is based on the example section of the HIDFunc manual.   

The Controller initialization section consists of arrays and functions that connect and monitor signals from the game controller. The most important commands in this section are HID.findAvailable, HID.open, and HIDFunc.element. These commands detect the available devices, connect the specific device with the device’s unique ID number, and determine what SuperCollider should do when a control surface is triggered. The rest are functions built to use those three commands efficiently. The users must evaluate the codes inside the first parenthesis labeled //1. Controller Initializations to make the second section of the codes work.

After the initialization, evaluate the codes inside the second parenthesis labeled //2. Test the Controller. It is important to evaluate one line of code at a time for better testing. When a ~whichsurface(element #) function is evaluated, an array containing an element number, control surface name, and value will appear on the post screen. For example, after establishing a connection with a DualSene controller using HID_DualSense_Demo.scd, evaluate the line ~whichsurface.(3). It will activate the triangle button of the controller. Pressing the triangle button will post [ 0, Triangle, 1 ], and releasing the button will post [ 3, Trianle, 0 ] on the Post window. Press command+period or select Menu-> Language-> Stop to stop receiving the messages from the controller. 

Note that arguments (|…args|) inside the HIDFunc element receive an array of numbers from the connected controller. The first number in the array, args[0], receives normalized data ranging from 0.0 to 1.0 as a float. The second number, args[1], receives raw data ranging from 0 to any number as an integer. The demo files use the integer, but users can use the float argument interchangeably. 

The last group of commands under //3. Audio Example maps the controller to a SynthDef’s parameter. The codes inside HIDFunc.element maps a button to change the volume of white noise and a continuous controller to change the panning. Modify the numbers inside the brackets [ ] at the end of the HIDFunc.element( ) to map different buttons and continuous controllers. Note that the method .linlin is used to map the range of 0 to 255 or 65535 to -1.0 to 1.0 in this example code.  

Summary and Application 

I share the mapping of four controllers so that others do not have to repeat the procedure and move faster to the creative phase. My previous sharing of the game controller mapping was in 2018, and it is available as a published document in The Journal Emille. The article is now outdated and only applicable to DualShock.  The current findings discussed here also have limitations: the mappings were tested in SuperCollider 13.0 running in Mac OSX Sequoia only. I was not successful in connecting the controllers to SuperCollider on Windows. I also did not figure out the mappings for Max or other programs.

Once connected via HID in SuperCollider, a game controller becomes an expressive instrument for laptop performance despite the above limitations. Performers can incorporate years, if not decades, of gaming muscle memories to play music. For demonstration, the links below are my two compositions for a game controller quartet. Interested music technologists can download SuperCollider patches and scores from the links below to play the music using the game controllers analyzed in this article. Previous experience in SuperCollider is not needed to play the piece.

PS Quartet No. 1

PS Quartet No. 2

Four Hit Combo (2024)

In Four Hit Combo, each laptop ensemble member uses four audio files to create twenty-six flavors. Musical patterns arise from repetitions (loops), and different combinations mark forms in music. The laptop ensemble members prepare their own samples before the performance, and they control loop start points and duration according to the score and the conductor’s cue. Because there are no specific audio files attached to the piece, each performance could give a unique sonic experience.

Instrument Needed

  1. Laptop: each performer needs a computer with SuperCollider installed
  2. Amp: connect the laptop to a sound reinforcement system. If the performance space is small, it is possible to use the laptop’s built-in speaker.

Pre-Performance Preparation

  1. Determine a conductor and at least three performers. If there are more than three performers, parts can be doubled
  2. Each performer prepares three audio files (wav, aif, or mp3). The first file should contain a voice. The second file should contain a pitched instrument sound. The third file should contain a percussion sound. All files should not be too short (less than a second) or too long (more than a minute). The [voice], [instrument], and [percussion] files should be different for all performers.
  3. While the voice, instrument, and percussion files are different for all performers, they should share one common sound file. This file will be used in the [finale].  
  4. The conductor prepares one audio about 10-30 seconds long. It could be any sound with noticeable changes. For example, a musical passage would work well, while an unchanged white noise would not. 
  5. Download FourHitCombo_Score.pdf, FourHitCombo_Performer.scd, and FourHitCombo_Conductor.scd from www.joowonpark.net/fourhitcombo
  6. Open the .scd files in SuperCollider. Follow the instructions on the.scd file to load the GUI screen.

Score Interpretation

  1. Proceed to the next measure only at the conductor’s cue. The conductor should give a cue to move on to the next measure every 10-20 seconds.
  2. In [voice], [instrument], [percussion], and [finale] rectangle, the performers drag-and-drop the audio file accordingly.
  3. In [random] square, performers press the random button in the GUI.
  4. In the square with a dot, quickly move the cursor in the 2D slider to the notated location.
  5. In the square with a dot and arrow, slowly move the cursor from the beginning point to the end point of the arrow. It is OK to finish moving the cursor before the conductor’s cue.
  6. In a measure with no symbol, leave the sound as is. Do not silence the sound.
  7. In measure 27, all performers freely improvise. Use any sounds except the commonly shared sound reserved for [finale]. 

Large Intestine 2013 vs 2024 – Brief Analysis

I am at the age where I can make a “How It Started vs. How It’s Going” analysis of my music. Comparing performance practice change over a decade or so is valuable for my growth, especially when the piece involves improvisation and no score. I can see where I came from, where I am now, and where I should go next. Large Intestine for no-input mixer and computer premiered in 2013, and I still present it in concerts. Watching the August 2013 version and the recent June 2024 version in sequence gives me a chance to contemplate my electronic performance practice. Did the technology and style change over 11 years? 

Technology

I took the “if it ain’t broke, don’t fix it” approach for Large Intestine in terms of the hardware and the software. The SuperCollider patch I coded 11 years ago is almost identical to the 2024 version. There were maintenance updates, such as replacing a deprecated UGen with a current one, but the signal-processing algorithm is untouched.  The hardware signal flow is also unchanged, although I upgraded the mixer for increased possibility and flexibility. 

I perform the piece by changing the mixer settings and SuperCollider patch. The SuperCollider patch consists of eight effect processors, and I turn on and off those effects in different combinations. It is much like playing a guitar with a pedal board. Over the past 11 years, I have bought a “new guitar” but am using the “same pedal.” The sonic possibilities remain the same, but how I play the instrument, the style in other words, has changed.  

Download and run the SuerColider patch for Large Intestine as a reference. You can test it using a mic or any other instrument.

Style

I observed the following differences in the 2013 and 2024 versions of Large Intestine

20132024
Mostly slow and gradual parameter changes Mostly fast and abrupt parameter changes
I discover things on stageI present previously experienced sounds
The mixer supports computer soundsThe computer supports mixer sounds
Long duration (10+ minutes)Short duration (less than 8 minutes)

When I was a no-input beginner, I could not make quick transitions and variations. In the 2013 version, I treated the mixer as one of many sound sources that could pass through signal processors. Like its umbrella project, 100 Strange Sounds, Large Intestine featured my SuperCollider capacity. The 2024 version shows that I reduced the dependency on the computer part. I also learned to say more within less time.

Gained confidence also changed the performance goal. I make a one-sentence goal when I am improvising solo. My goal for Large Intestine used to be “Let me figure out what no-input mixer can do on stage,” as it delighted me to discover the mixer’s unique sound and its augmentation by the computer. 11 years later, there are much less delightful discoveries in the piece. But I can now expect the sound I can create. The current  motto is, “Let me show you my favorite no-input mixer moments I learned previously on stage.” 

Evaluation

I am my work’s biggest supporter and critic, but that does not help my career development. The audience ultimately decides the longevity of the work. Large Intestine was fortunate to be liked by the audience on many occasions. It received some honors, such as being included in the SEAMUS CD series (2015), a peer-reviewed annual album released by the Society for Electroacoustic Music in the United States. There were multiple invitations to perform at different venues, and it became an integral part of my solo performance practice. The positive feedback from presentations motivated me to delve further into the no-input mixer world. I composed the following pieces based on the learnings from Large Intestine.

There are also clear limits to Large Intestine and my solo electroacoustic improvisation. I don’t expect other performers to play Large Intestine as it lacks score or instruction. The experience and joy I had with the piece are not transferable to other performers. This bothered me. I tackled this issue by teaching others how to play no-input mixers. I currently enjoy organizing no-input mixer workshops and no-input ensemble sessions. The mixer is a great introductory instrument for electronic music performance.

Dot Zip

https://joowonpark.net/dotzip/

Dot Zip consists of 22 short electronic compositions. The tracks feature a synthesis technique or a compositional structure best realizable with code-based audio programs. They are examples of what one does after learning an audio coding programs like MaxMSP and SuperCollider.

Dot Zip is a pedagogical project. Each track is an unedited render of a SuperCollider file. Download and try the .scd files from the link below.

A tutorial video on how to operate the SuperCollider files is also available:

More about each piece’s inspiration, techniques, and applications are on the way. Stay tuned!

Motivation Quadrants for Musicians

What motivates me to write or practice a piece? As I grow older with less time and energy, I must strategize what to do for the next research or creative activity. The decision-making process is multidimensional, but a simplified guideline helps me. I ask two questions before I commit to a project.

  • Do I want to do it?
  • Do I know how to do it?

Answers to these two questions yield four degrees of motivation plotted as four quadrants in a graph. My goal is to identify in which quadrant I start the project so that I can identify the level of motivation and amount of work. I also find that the answers to the above questions change at the end of the project, sometimes.  

I am most eager to work on a project that starts in Quadrant IV and ends in Quadrant I. Changing the “I don’t know” axis to the “I know” axis takes time and energy, but that process is what being a researcher, artist, and student is all about. Learning SuperCollider was an IV-I move. Going to graduate school to be a teacher was IV-I. Improvising on a no-input mixer was IV-I. Spending a few months of the COVID quarantine time to learn Mark Applebaum’s Aphasia was IV-I. 

Quadrant IV is also a fandom area. While some pieces move from VI to I, like Aphasia or Alvin Lucier’s Music on a Long Thin Wire, I don’t mind Jeff Mills’ Exhibitionist Mix 3 and Bach’s music staying in Quadrant IV. Discovering and admiring awe-inspiring pieces is what being a researcher, artist, and student is all about.  The permanent Quadrant IV pieces become motivations for new pieces as well. Cobalt Vase is my homage to Exhibitionist, and 847 Twins is my Bach fan art.  

Ideally, all projects should end up being in Quadrant I, where I am happy to do the work with the skills I know. Realistically, many works fall into quadrants II and III. Dismissing them is not always possible, especially when the projects involve benefits like money, graduation, future opportunities, etc. Some projects in Quadrant III move into Quadrant I through education and repeated experience. Many dance and sound installations were my III-I projects because I learned more about the benefits of collaboration as I got more experience and studied more. Witnessing students doing the III-I move is equally exciting as students doing the IV-I move in my music technology classes. 

In contrast to the III-I or IV-I move, II-I moves are much rarer. Projects in Quadrant II often stay in Quadrant II, and they involve extra motivational factors, like deadlines or funding, to accept and finish the project. Some projects move from Quadrant I to II due to burnout or changed interest. Such regression, however, was not always bad, as it pointed me to new artistic/aesthetic directions. I am currently not focusing on further developing free improvisation skills as I feel the plateau or burnout. This condition led me to make notated electronic music less dependent on an individual’s improvisation skills. My notated electronic pieces gain more performance opportunities nowdays, and I am happy to present both improvisational and no-improvisational pieces in a show. Music career is cumulative

Evaluating the need to start a project by asking two simple questions with four possible answers clarified my thoughts.  Perhaps I could extend this to plot listener reactions. I want the audience, colleagues, or commissioners to feel Quadrant I when they listen to my piece  (I want to play it, and I think I figured out the technology!). The audience feeling Quadrant IV could be good (I don’t know how he’s making that sound, but I want to try!), especially if they are scholars or performers. Learning opportunities and capable institutions abound for the audience in Quadrant IV. I hope my pieces do not fall into Quadrants II and III.