Author Topic: Sound for calculators with bad ram  (Read 35614 times)

0 Members and 1 Guest are viewing this topic.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Sound for calculators with bad ram
« on: July 24, 2010, 08:37:09 pm »
So I caddy during the summer, which meant that today I had 4+ hours of just thinking. And here is the result.

I have made a program that will play sound on the 84+'s with the bad ram. I just started it a few hours ago, so I'm still working on it. But I have gotten near perfect sound quality from my calculator. It uses pulse width modulation (turning the link port on and off really fast) to get the amount of voltage it needs to play a note. I currently have it set up for 44.1khz, because I wanted to keep this on off above the human level of hearing. But then shortly after I made it I realized that it is playing a 44khz note and not a 22khz note. So I'll be working on 22khz because 44kb/s really eats up calculator memory.

I also have proven to myself that my speed program was right when it said my calculator runs at 15.8 mhz and not 14.9 mhz like the first speed test program said. I figured this out because I have the song set to play at 15.5 mhz and on my calculator and it runs too fast.

I'll put a video on youtube once I get 22khz working. If you are going to test this, don't use wabbitemu. Your sound card doesn't know what to do with a 44khz note and it will sound awful. So make sure you test it on a real calculator. It is currently set up in an app and a program, the app is the music, and the program is the program. This is so I don't have to resend it every time I change it.

If you want to make your own song. You have to put it in 44,100 hz, mono, 8bit. Then use a hex editor to cut off the header, replace all zeros with ones, and put a zero at the end. (Song starts 4 bytes after "DATA"). Then you have to find a way to convert it to an app and send it to your calculator. I used brandonW's new binTo8xk and then used wappsign.

I have also included the little demo I made for myself. It's only 5 seconds long but it's 340,000 bytes on calculator. Oh, and someone please laugh at the source, the technique I used has max sound quality at the cost of the programmer. (255 subroutines each 1 t-state different from each other.
« Last Edit: July 24, 2010, 08:49:31 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: Sound with bad ram
« Reply #1 on: July 24, 2010, 08:43:49 pm »
This looks nice! ;)

Sadly, I can't try this program since I don't have an 84. :( :(


Offline alberthrocks

  • Moderator
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 876
  • Rating: +103/-10
    • View Profile
Re: Sound with bad ram
« Reply #2 on: July 24, 2010, 08:45:50 pm »
That's awesome! :D

I need to either: 1) Find my cable converter 2) Buy another one :P
Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/


Proud member of ClrHome!

Miss my old signature? Here it is!
Spoiler For Signature:
Alternate "New" IRC post notification bot (Newy) down? Go here to reset it! http://withg.org/albert/cpuhero/

Withgusto Networks Founder and Administrator
Main Server Status: http://withg.org/status/
Backup Server Status: Not available
Backup 2/MC Server Status: http://mc.withg.org/status/

Activity remains limited due to busyness from school et al. Sorry! :( Feel free to PM, email, or if you know me well enough, FB me if you have a question/concern. :)

Don't expect me to be online 24/7 until summer. Contact me via FB if you feel it's urgent.


Proud member of ClrHome!

Spoiler For "My Projects! :D":
Projects:

Computer/Web/IRC Projects:
C______c: 0% done (Doing planning and trying to not forget it :P)
A_____m: 40% done (Need to develop a sophisticated process queue, and a pretty web GUI)
AtomBot v3.0: 0% done (Planning stage, may do a litmus test of developer wants in the future)
IdeaFrenzy: 0% done (Planning and trying to not forget it :P)
wxWabbitemu: 40% done (NEED MOAR FEATURES :P)

Calculator Projects:
M__ C_____ (an A____ _____ clone): 0% done (Need to figure out physics and Axe)
C2I: 0% done (planning, checking the demand for it, and dreaming :P)

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #3 on: July 24, 2010, 09:20:51 pm »
Nice, the demo sounds awesome. (Your recording, I don't have a converter)
Too bad for the complete lack of compression (That won't fit on on 83+ and not an 84+ either IIRC)
Interesting to see where you'll take this. Good luck! :)
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Sound for calculators with bad ram
« Reply #4 on: July 24, 2010, 09:50:04 pm »
that's epic.  Someone should convert a rickroll.  :P

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #5 on: July 24, 2010, 09:54:03 pm »
but right now you could only do 25 seconds...
That's more than enough, actually... :P
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Sound for calculators with bad ram
« Reply #6 on: July 24, 2010, 09:58:13 pm »
Those 25 seconds take 15 minutes to send to calc. But I guess that makes it even more funny if someone does it.

Oh well, 22khz coming soon. I just did the preliminary copying and pasting for my routines. The source is over 8,000 lines long now.
« Last Edit: July 24, 2010, 09:58:35 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Sound for calculators with bad ram
« Reply #7 on: July 24, 2010, 10:01:55 pm »
When your done, I think you could have a POTY in the bag.  ;)

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #8 on: July 24, 2010, 10:18:22 pm »
oh, wow x.x
But yes, it'd be totally worth it ;D
I agree, this'd deserve a POTY award, especially if you get some compression in there.
« Last Edit: July 24, 2010, 10:18:41 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Sound for calculators with bad ram
« Reply #9 on: July 24, 2010, 10:25:46 pm »
Idk about poty because I am doing almost the exact same thing that realSound does. That is where I got the idea.

But I realized that when I'm doing 22khz, I actually burn 82 t-states per byte. I'll have to look into compression because that would be awesome. I have 4 more hours coming up tomorrow. So I'll probably figure it out.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #10 on: July 24, 2010, 10:32:06 pm »
cool, can't wait to see what you come up with! :D
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline yunhua98

  • You won't this read sentence right.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2718
  • Rating: +214/-12
  • Go take a dive in the River Lethe.
    • View Profile
Re: Sound for calculators with bad ram
« Reply #11 on: July 24, 2010, 10:34:42 pm »
Idk about poty because I am doing almost the exact same thing that realSound does. That is where I got the idea.

But I realized that when I'm doing 22khz, I actually burn 82 t-states per byte. I'll have to look into compression because that would be awesome. I have 4 more hours coming up tomorrow. So I'll probably figure it out.

Yeah, but RealSound was already epic, yours though, hopefully, yours will work for all SE's.  (Wait...  Will this work for 83SE?)
« Last Edit: July 24, 2010, 10:35:01 pm by yunhua98 »

Spoiler For =====My Projects=====:
Minor setback due to code messing up.  On hold for Contest.
<hr>
On hold for Contest.


Spoiler For ===Staff Memberships===:






Have you seen any good news-worthy programs/events?  If so, PM me with an article to be included in the next issue of CGPN!
The Game is only a demo, the code that allows one to win hasn't been done.
To paraphrase Oedipus, Hamlet, Lear, and all those guys, "I wish I had known this some time ago."
Signature Last Updated: 12/26/11
<hr>

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #12 on: July 24, 2010, 10:39:35 pm »
It should work for the 83+SE AFAICT.
Unless he gets compression, though, any song more than a few seconds will be SE-only due to the storage space required.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: Sound for calculators with bad ram
« Reply #13 on: July 24, 2010, 10:57:49 pm »
It would definitely work for the 83+ SE. The only problem with compression is that I'm out of ram and out of pages. Flash is swapped into $4000 and that's where I read from. $8000 is ram $83 has a subroutine every 64 bytes. And $C000 has page $81 and is where I am executing from.

The options for compression I see are: a form of reading the data from flash that gains more space, this would basically be a look up table type thing. Or saying screw it to user ram and using page $81 for buffering with LZ77.

But the best, and scariest way I see to do it, store sector 0 to the swap sector and use page 0 as my executing space. This would let me save user ram as well as give me both page $80 and $81 to use as storage.
« Last Edit: July 24, 2010, 11:03:20 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Sound for calculators with bad ram
« Reply #14 on: July 24, 2010, 11:52:08 pm »
That'd give you access to all 64KB of address space, but it might not be worth it.
You'd have to do two or three erases every time you wanted to play a file, which makes it slow to start up and puts wear and tear on the flash.
But if you must, I suggest you make it optional ;D
Ignore my skepticism and continue. :P Keep up the good work!
Edit: 700th post!
« Last Edit: July 24, 2010, 11:52:44 pm by calcdude84se »
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.