Go Down

Topic: MIDI synth - noise on serial reception? (Read 2 times) previous topic - next topic

jman

Thanks Sciguy.

It turns out that I'm a bit of a muppet, in that my "noise" was all software/sketch related.

I'm running the sketch on a mega which has multiple com ports.  I updated the sketch to use com1 for midi, so I could then use com0 for debug info (via serial monitor).  I then output everin min i/o event to the debug port for review...  which highlighted the issue almost immediately.

The sketch monitoring incoming midi "ticks" and updating two internal variables: currentTick and lastTick.  Elsewhere in the program, I was testing these two variables for a difference between them (as a crude form of event detection) and then triggering the corresponding midi "note on" command accordingly.  The trouble was that my SerialReceive() function was the only thing that updated the lastTick variable.  The Loop() function cycled many times between the ticks, and consequently the event was triggered multiple times, creating a brief buzz sound at the start of each note (doh!).  I changed the sketch to update the lastTick variable as soon as the current tick was processed (in addition to Serial.Receive) and all is now well and good :D

This explains why the midi buffer on my sound module got so full so quick!  Obvious in hindsight.  But unfortunately this does not help you with the noise issues that you have with your synth!  I almost feel bad now for poluting your thread with my problem ;)

Best of luck with your synth.  Be sure to upload some samples when it nears completion!

sciguy

I've already uploaded samples, the noise is only an issue when using pitchbend or control messages, or low velocity notes.  On notes with higher velocity, the click isn't noticeable.

Check out my soundcloud, link in my signature, for some samples, and also some songs I've made with the previous version of the synth.
Soundcloud page: http://soundcloud.com/beefinator-2
Youtube channel: http://www.youtube.com/user/beefinator14
Old soundcloud page (ran out o

sciguy

So the noise has nothing to do with the DAC chip.  I put 2 10k resistors in a divider arrangement, giving 2.5v, the same as the output of the DAC when no notes are playing.  Then connected the output jack to the divider, bypassing the DAC, and I still get the noise with MIDI message reception.

I'm stuck...     :~

Tomorrow I'll try making my own MIDI input circuit on a breadboard, to see if the sparkfun board's an issue.
Soundcloud page: http://soundcloud.com/beefinator-2
Youtube channel: http://www.youtube.com/user/beefinator14
Old soundcloud page (ran out o

sciguy

Alright, so I fixed the problem!  There's ZERO audible noise of any sort now, even when I turn up the gain on my mizer to far past comfortable levels!

The solution I found on ladyada's page for the waveshield:
http://www.ladyada.net/make/waveshield/design.html

Turns out (and it makes sense) that you need a very low lowpass filter inputting the Vref pins on the DAC.  I had it originally connected directly to 5v, which was a very noisy power line.  E.g. the optoisolator was drawing current when MIDI messages were received, so the voltage fluctuated.
The waveshield uses a 15Hz cutoff filter; I got much better results with a 0.033Hz filter.   :smiley-eek:   It might take a second or two to ramp up to full voltage on startup of the synth, but I don't care, I have a little splash-screen anyway that appears.
Soundcloud page: http://soundcloud.com/beefinator-2
Youtube channel: http://www.youtube.com/user/beefinator14
Old soundcloud page (ran out o

Go Up