Well, for 8V you definitely need an external amplifier. If the microtones are evenly spaced, you are looking at 31*8 = 248 distinct values, so 8 bits should be (just about) sufficient.
anyere What does samplerate mean in the context of pwm? Like how fast the pwm signal can settle on a new value?
How often you can change the output value, where by output value I mean the "analog" signal obtained by filtering the PWM output. That would be twice the maximum frequency you can represent
However, have just done a quick simulation in Matlab: you'd need a very steep filter (and/or a very low cutoff) to get rid of "enough" ripple in the output to be usable as a pitch control, so I would discard this idea as well.
Fs = 44100;
nbits = 8;
Fspwm = Fs/2^nbits;
analogValue = 0.3; % between 0 and 1
filterOrders = [1 5 10];
cutoff = 0.5 * Fspwm; % cutoff in Hz
x = mod((1:4000)', 2^nbits) > 2^nbits*(1-analogValue);
[B A] = butter(1, cutoff/(Fs/2));
t = (0:length(x)-1) / Fs;
for f = 1 : length(filterOrders)
filterOrder = filterOrders(f);
y = x;
for n = 1 : filterOrder
y = filter(B, A, y); % apply the filter several times instead of using a higher order filter for stability
end
subplot(2, length(filterOrders), f)
plot(t, x)
hold on
plot(t, y, 'linewidth', 2)
hold off
axis tight
title(sprintf('Filter order: %d', filterOrder))
xlabel('Time (s)')
ylabel('Amplitude')
legend('PWM', 'filtered out')
end
Another possibility is to look at the hardware PWM peripheral on the board. Those have much higher bitclocks, so they require much simpler filtering. I have some notes about it at the bottom of this file, but it's probably outdated.