# Pure Data MIDI Trigger Help

**URL:** <https://forum.arduino.cc/t/pure-data-midi-trigger-help/166700>\
**Category:** Interfacing w/ Software on the Computer\
**Created:** [June 6, 2013, 7:15pm UTC](https://forum.arduino.cc/t/pure-data-midi-trigger-help/166700 "2013-06-06T19:15:43Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [June 6, 2013, 7:15pm UTC](https://forum.arduino.cc/t/pure-data-midi-trigger-help/166700/1 "2013-06-06T19:15:43Z")

</div>

I'm new to Arduino and far from an expert with PD, but I'm trying to make a simple piezo drum trigger which seems to be a simple task yet I am struggling a little.

I'm using the "Knock" example sketch with the Serial.println line modified to read "Serial.println(sensorReading);" rather than "Serial.println("Knock!");" .

This seems to work nicely, with values of 0-1023 appearing in the serial monitor. However, when I open PD and open the serial connection (using the comport object) the values in Arduino's serial monitor change to values I don't understand. Below is the serial monitor reading, the "à"s start when I open the serial connection in PD and continue along the same horizontal line each time I hit the piezo, never progressing to the line below.

```cpp
344
696
283
210
963
250
288
224
1023
107
361
àààà

```

And it's a similar situation with the unmodified knock sketch

```cpp
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
Knock!
àààààààààààà

```

I'm using an Arduino Mega 2560, the piezo is connected to pin A0 and GND with a 1MOhm resistor wired in parallel.  
Any advice would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/arduino/user_avatar/forum.arduino.cc/system/32/1140315_2.png) [@system](https://forum.arduino.cc/u/system)\
**Post date:** [May 6, 2021, 11:27am UTC](https://forum.arduino.cc/t/pure-data-midi-trigger-help/166700/2 "2021-05-06T11:27:59Z")

</div>


