Create and synthesize sounds using the Max/MSP and ChucK programming languages with the Wekinator software application. 

This article will teach how to control sounds made through ChucK using sliders in the Max/MSP software as input values. 

When using the three sliders from the Max/MSP program, the values will change when configured by the user. Those values will then be sent to the Wekinator application through OSC communication inputs. 

The Wekinator will then analyze these inputs and send the output information to ChucK, where the sound pitch will be modified. 

If unfamiliar with the Wekinator software platform, check out our introductory, How to Get Started with Wekinator article.

Max/MSP Instructions

The sketch for sending the input to the Wekinator software is available on the official Wekinator website

From the Wekinator website, download and run the 'simple on-screen sliders' file from under the Max/MSP (audio) category. 

Max_MSP_chucK_synthesizer2.jpg

Max/MSP program window with instructions on using sliders. 

ChucK Program Instructions

ChucK is a programming language used for real-time sound synthesis and producing music. 

It presents a unique, time-based programming model with dynamic control rates and the ability to easily add and modify code.

The sketch for the ChucK program titled, 'FM Synthesis' is also available on the Wekinator website, under the ChucK (audio) category. 

Note: Make sure to download the file for your specific operating system.

Now, you'll want to launch the ChucK terminal, navigate to the directory where the ChucK file is located and input the following: 

chuck FMSynth_5ContinousOutputs.ck 

Max_MSP_chucK_synthesizer6.jpg

Command Prompt window with output instructions shown. 

The ChucK program should monitor for the output information sent by the Wekinator program. 

Once it receives the input, it will modify the sound pitch accordingly. 

Wekinator Instructions

Launch the Wekinator software program and copy the setting shown below. 

  • Set the input values to 3. 
  • Set the output values to 5. 
  • Leave all other settings as default. 

The Wekinator will send 5 different outputs to the ChucK program, which will respond by producing different sounds according to the Wekinator output. 

Max_MSP_chucK_synthesizer4.jpg

The 'Create new project' window in Wekinator application. 

Select the 'Next' button to display a window like the one shown below. 

Max_MSP_chucK_synthesizer1.jpg

The 'New Project' window in Wekinator application. 

Note: Max/MSP won't continuously send input data to the Wekinator. It will only send output information when you move the sliders. 

To start recording samples, click on the 'randomize' button in the Wekinator window to select a random sound. 

Then select the 'start recording' button and drag the first slider in the Max/MSP program to the top. 

Max_MSP_chucK_synthesizer3.jpg

Image detailing instructions on controlling the first slider in Max/MSP and recording sound in Wekinator application. 

Follow a similar step for the second slider. Click on the 'randomize' button again, then select 'start the recording' and drag the second slider in the Max/MSP window to the top. 

Max_MSP_chucK_synthesizer5.jpg

Image detailing instructions for programming second slider in Max/MSP and recording sound using the Wekinator application. 

The last step is to follow the instructions for the third slider to record the last, random, sound. 

Max_MSP_chucK_synthesizer7.jpg

Image detailing instructions for programming third slider in Max/MSP and recording sound using the Wekinator application. 

After recording the samples, go ahead and select the 'train' button to execute the Wekinator application according to the samples. 

Now when you adjust the sliders in the Max/MSP program, ChucK will change the sound pitch according to the Wekinator output data. 

For similar projects using Wekinator, take a look at the following articles: 

For a visual learner, see our video tutorial of this project below.

Muhammad Aqib
I am an embedded programmer with the expertise in Arduino, Raspberry pi, ESP8266, IOT and OpenCV.