Can I have a routine(just like calcmod) of it so I can learn from it?
I want to do something with outputting 2 notes at once(not 4, though. I want to figure that out on my own when I get a routine for 2.)
Thank you in advance! Very Happy
As I suggested in the chat, take a look at QuadPlayer - there's a routine in Source/Source/Quad.asm, but more usefully there's a rough explanation of how it works in the documentation under the heading "How it works".
yeong, do you understand the concepts of outputting one note at once? If not, let me explain it. Basically, a note in music has a wavelength. A standard A note, for example, is 440Hz, which means that there are 440 cycles per second in the note, periods of a sinusoidal wave. Indeed, if you think about the shape of a sinusoid, that means the wave crosses the X axis 880 times per second. Since we have only two states for the calculator link port, off and on, we approximate notes with something called PWM; in this case, we would turn the link port line high 440 times per second and low 440 times per second, switching it every 1/880th of a second.

If you want to do two notes at once, all you need to do is keep two timers, one for each of the channels, so you know when to change the state of one or the other link line. The hardest part about this is doing proper clock cycle counting, to make sure that the timing comes out right.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement