Editing Microcontroller polyphony

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 7: Line 7:
 
... ''circuit drawing goes here'' ...
 
... ''circuit drawing goes here'' ...
  
== polyphony the "standard" DAC way ==
+
== polyphony the "standard" ADC way ==
  
 
... ''circuit drawing goes here'' ...
 
... ''circuit drawing goes here'' ...
Line 15: Line 15:
 
* (c) If you have 7 sound sources (i.e., you want to simulate playing a chord of 6 notes on a piano, and also a flute), get 7 numbers.
 
* (c) If you have 7 sound sources (i.e., you want to simulate playing a chord of 6 notes on a piano, and also a flute), get 7 numbers.
 
* (d) add the numbers together to get a total.
 
* (d) add the numbers together to get a total.
* (e) send the total out to the DAC
+
* (e) send the total out to the ADC
* (f) Use op-amps to buffer the DAC output voltage, do low-pass filtering to eliminate ultrasonics, and send it to the speaker.
+
* (f) Use op-amps to buffer the ADC output voltage, do low-pass filtering to eliminate ultrasonics, and send it to the speaker.
 
* (g) In the background (perhaps in the main loop, or a lower-priority interrupt), when the time comes to finish the chord, turn off some or all of the sounds. (One of many ways to "turn off" a sound source is to set its delta to zero, and then set its phase accumulator to zero).
 
* (g) In the background (perhaps in the main loop, or a lower-priority interrupt), when the time comes to finish the chord, turn off some or all of the sounds. (One of many ways to "turn off" a sound source is to set its delta to zero, and then set its phase accumulator to zero).
 
* (h) When the time comes to start playing another note (perhaps in addition to the notes already playing), set the "delta" number for the corresponding sources to produce the appropriate frequency.
 
* (h) When the time comes to start playing another note (perhaps in addition to the notes already playing), set the "delta" number for the corresponding sources to produce the appropriate frequency.
  
In practice, to reduce jitter, the interrupt first (at high priority) sends the total out to the DAC (e), and then (at low priority) calculates a total (b-d) that won't be used until the next sound interrupt.
+
In practice, to reduce jitter, the interrupt first (at high priority) sends the total out to the ADC (e), and then (at low priority) calculates a total (b-d) that won't be used until the next sound interrupt.
  
 
You've seen a sound-board mixer, right?
 
You've seen a sound-board mixer, right?

Please note that all contributions to OpenCircuits may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see OpenCircuits:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)