Using MAX/MSP for a digital instrument

OAGr's icon

Hi,
I'm working on a project using a glove device to make digital music.
Recently I was persuaded to try MAX MSP as a medium to convert an Arduino Output into musical notes. While so far it's been simple to get musical outputs, the sound doesn't end. Each pin is connected to a message so that when it is pressed, a note is played. The problem is that when the pin is stopped, the note doesn't end.

I've spent hours trying to get this to work, because this is a pretty critical feature. The only things I've found that seem to be for this (sustain, for example), are made for MIDI which we aren't using. What can I do?

Thanks,
Ozzie

brendan mccloskey's icon

You need to ensure that it is Max, and not the Arduino code that's causing this. You should have a continuous flow of data from the Arduino program, and somehow ensure that when the sensor(s) acheive a certain threshold, then Max is translating that into either a 'note-start' or 'note-stop' event. I can't be more specific than this until you post your Max patch here, and describe your sensor data-mapping in more detail.

Chris Muir's icon

Without seeing your patch, it's impossible to say for sure.

the_man361's icon

send a message in max to stop playing the sound when the pin is up? should be an easy thing to do, are you sending information from arduino about releases as well as pushes?

OAGr's icon

Here is the file.
I'm using Maxuino, so it's able to tell when a note/LED is being "held down".

I think I just solved the holding problem (by switching from dac~ to ezdac~ , and also adding a logic mechanism (in this sketch both are there, even though only one has to be).
However, I've then run into two other problems.

1) Bad sound quality upon beginning/ending. There's a scratch sound you'll notice when turning on/off sounds quickly.
2) A very difficult time playing multiple notes at once. This is because while I'm finding it very easy to keep a note pressed, it is more difficult to turn off that note when it's eventually released (even though other notes may be pressed).

I've been trying to find examples of similar things online, but have had little luck doing so. Do you think that MAX is really the right program for this?

291.aa_sample_MSP.maxpat
Max Patch
Léopold Frey's icon

Hello,

The ezdac~ object is meant to start and stop the sound processing in a global way,
it is definitively not a good way to do what you want.
Also, if you want to play several notes simultaneously, you have to have several cycles running simultaneously

Max Patch
Copy patch and select New From Clipboard in Max.

see example below

You should read the tutorials before going further.

Léo