I feel like this is a bit of an unusual request so I'm having a hard time figuring out how to research it. My question is: is there some way that I can use an Arduino to programmatically generate a signal that very closely resembles the voltage generated when you hit a piezo? Here's some background as to why I want to be able to do that:
As a fun project while I have some time off I decided to try to connect my Alesis electronic drum kit to the video game Rock Band. There is an official solution for connecting a MIDI drum kit to the game, but unfortunately I'm playing on XBox One, where you need an adapter that was produced in extremely small quantities and is now ridiculously expensive. So then I started looking into how I might modify the stock drum controller to get an unofficial solution to the problem.
The drum triggers on the controller are extremely simple. It's just a piezo where the two wires coming off of it are connected directly to the main circuit board with a JST connector. Because there's already a connector there, that's the easiest point for me to connect my homebrew adapter. What I'd like to do is connect an Arduino to each of the JST connectors on the main controller board to allow me to trigger each drum pad programmatically. This would ultimately allow me to convert the MIDI signal from the e-kit into drum hits in-game.
The problem is, the spiky analog signal that's generated when you hit the piezo is very different from the clean digital output of an Arduino pin. The stock drum triggers have two wires: white and colored. As an initial test I tried just connecting the white wire from the JST connector on the controller board to ground on the Arduino and the colored wire to one of the digital outputs. I wrote a quick program that pulls that pin high for a few milliseconds and then pulls it low again, and to my amazement that actually worked to trigger a drum hit in the game!
I tried increasing the frequency of the hits though and quickly ran into a problem. The game is applying some kind of filtering to the signal that causes it to treat a very quick double pulse as a single hit. I can get up to about 10 hits/second with just a dumb 5v square wave, but trying to go faster than that causes it to drop hits like crazy. This makes sense because the piezo will generate a series of diminishing pulses when you hit it a single time so it has to filter that out somehow, but many songs in the game require faster hits than the ~10hz speed limit of my current solution. The stock drum pad has no problem registering hits faster than that so I know there's nothing wrong with the controller board itself. Because I don't have any way to identify the method of filtering they're using my best idea for how to proceed is just to try to reproduce the input signal generated by the piezo as closely as possible. I'm happy to acquire other electrical components but I don't have any ideas for what would let me generate the same kind of high-impedance alternating voltage that you get out of a piezo.
I took a picture of the piezo from the Rock Band stock kit. There are no identifying marks on it that I can see so I can't say exactly what type it is, other than it's one suitable for use as a vibration sensor.