0 Members and 1 Guest are viewing this topic.
Untested, but based on the source code provided, it looks like it's 47·n + 59 clock cycles per iteration (or on the 84+, 47·n + 61 in RAM, 55·n + 70 in a Flash app.) Each iteration is only half a cycle of your square wave, though. So if you wanted to play a tone of 440 Hz, you'd want the frequency parameter to be ((6,000,000 / 880) - 59) / 47 = 144.For the time parameter, figure each tick is about 47/6 = 7.8333 microseconds, so a second would be 128,000 ticks. This will vary depending on the frequency parameter, though. (If you want to play notes longer than 65536, I think it would work so long as you ensure that the time parameter is a multiple of twice the frequency parameter. Or maybe 1 less.)
.for a low A sharpFreq(^A,1.for a high B flatFreq(vB,5.for a central CFreq(-C,3
HoMM: [==--------] Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :PtiDE: [----------] Explored and understood the main part of the code: just started writing a Tokenizer.
perhaps frequency could be overloaded with another parameter type? because it we have not so many tones we can access right now, and i think we just only use the Freq( command to play music with normal tones.
So question: How does my computer play chords when I'm listening to music? Is it possible to do something similar on-calc?Another question: Is it possible to control volume on the calculator?
I'm not sure what the actual tones correspond to, but I have been using the wavelength column of this table which seems to give pretty good results.
Yeah, with assembly all we are doing is sending value through the link port in a certain way -- the port isn't built with a way to recieve or handle volume requests EDIT: oh and the chords sound decent, but not perfect -- kinda spasmism if you listen closely, but otherwise acceptable