Instead of having buttons why not use a linear touch sensor like this for each string.
I used it to make a MIDI guitar
Feeding it into a MIDI sound module made it also sound like a Guitar. The square pad was for strumming.
Free to download PDF of both parts of my article. This used a PICO RP2040, you can programme it on an Arduino, but this was programmed in Python.
You could even program chord changes into it so all you had to do apart from strum was to hit a next chord button when the time was right, to play a song.
You sure can do ADSR on Arduino. See, for example, Arduino as Waveform Synthesizer for Music, Arduino Synthesizer With FM, and Wavetable Melody Generator (this one runs on an ATtiny85). You can run 8-bit PWM at 62.5kHz (with a 16MHz clock), which is fast enough and big enough sample depth for decent audio; it's not CD quality, but you can get good quality with an audio sample rate of say 16–24kHz. With a low-pass filter at 20kHz the PWM pulses are fairly effectively filtered out (you can't hear the high-frequency pulses anyway, but they might cause intermodulation distortion with some amps/speakers). Or instead of PWM you could go with a simple R-2R ladder DAC on 8 pins (with hand-matched resistors to ensure monotonicity).
I've done real-time speech synthesis on both the ATmega328p and ATtiny85 which does something not too dissimilar to ADSR (it varies the amplitudes of several waveforms over time), and I'm currently working on a little Arduino music project with ADSR too. It helps that the ATmega328p has 1-cycle (or is it 2-cycle?) multiplication instructions for calculating envelopes, but even without those (the ATtiny85 doesn't have them) it can be done in other ways.
And the Uno has plenty of program space for a decent set of violin sound patches—you can store just the attack part plus a small number of cycles of the sustained part of an instrument, which adds up to only a tiny fraction of a second (so you can store multiple sound patches, one patch for a small range of notes).
Depending on how sophisticated you make it, it could sound reasonably close to a real violin.
Sure! They are just 12 ints stored in an array. Or calculate the frequency, if you are afraid that the arrays take too much memory. If you read the buttons on the A4 string and you find that button 4 is pressed (#4 is C5, while #0 is A4 which is 440 Hz), the frequency is: freq = 440. * pow(2., 4./12.);
The decimal point at each number makes sure everything is floating point numbers. Someone correct me on that.
That circuit is fine if you only want to push one button down at any one time. Push more that one and you will get phantom buttons registering. For example push two buttons on different rows and you will read as if four buttons have been pushed.
To remedy this then you need a diode in series with every push button connecting columns and rows.