I was just wondering, how exactly do you do this (the theory, I do not want specific source code. I will try to make my own.)

Specifically, I know that the link port has a high and a low for the ring and tip of the port. And I know the ring corresponds to a certain side of the headphones, same with the tip. But I want to know, which is which? And what is the difference between high and low to the headphones? Also, I remember someone saying that they swapped between high and low really quickly in order to gain enough voltage or something similar, why is that?
_player1537 wrote:
I was just wondering, how exactly do you do this (the theory, I do not want specific source code. I will try to make my own.)

Specifically, I know that the link port has a high and a low for the ring and tip of the port. And I know the ring corresponds to a certain side of the headphones, same with the tip. But I want to know, which is which? And what is the difference between high and low to the headphones? Also, I remember someone saying that they swapped between high and low really quickly in order to gain enough voltage or something similar, why is that?
So as you correctly noted, the ring and the tip each correspond to one ear of classic headphones. Recall from your basic physics or music class that sound is vibrations of the air. In headphones, vibrations are created by a paper or plastic diaphragm moving back and forth. The faster it vibrates, the higher the note; the slower, the lower. The bigger the amplitude of the vibration (how far it moves from neutral), the louder the note. TI sound is based on the fact that at logical high, the linkport output is 0v; at logical low, the linkport output is 5v. By quickly switching between 0v and 5v, you can make the diaphragms in the headphones vibrate and create sound. Of course, because you only have two voltages to work with, you therefore cannot change the volume of the music (well, you could do a PWM scheme, but it would sound really awkward), only the frequency. Careful cycle counting, or use of interrupts, will allow you to switch the state of the link port at a set speed and produce a desired frequency.

Makes sense? If that all sunk in, I'll next discuss monophonic, stereo (biphonic), and quadraphonic music.
It mostly makes sense, I'll try to write a quick program to test this out.
_player1537 wrote:
It mostly makes sense, I'll try to write a quick program to test this out.
Sounds good, let me know how it goes, and post up some (working or buggy) code.
I tried my first attempt at it (really simple code, so not posting) but I was wondering, if you do ld a, 3 \ out (0), A. Will it keep the lines low until you set both lines high again? Also, will setting both lines high (out (0), 0) twice in a row do anything wierd? Or should it be fine?
_player1537 wrote:
I tried my first attempt at it (really simple code, so not posting) but I was wondering, if you do ld a, 3 \ out (0), A. Will it keep the lines low until you set both lines high again? Also, will setting both lines high (out (0), 0) twice in a row do anything wierd? Or should it be fine?
Yes, the lines will stay where you left them. No, setting the same thing twice will do nothing bad.
  
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