Author Topic: Bad Apple SE  (Read 29900 times)

0 Members and 1 Guest are viewing this topic.

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Bad Apple SE
« Reply #30 on: January 01, 2014, 07:59:38 pm »
The previous version simply stored what note was playing at each frame, and updated the audio channels accordingly. Because notes did not land exactly on the boundaries of 1/60th of a second intervals, the timing for everything was slightly off. This version, I implemented a proper tracker, which runs on its own timer eight times per beat, providing perfect precision for 1/32 notes, and the notes are stored by length instead of once every frame, reducing the size of the data. Now, the downside to this is it is no longer perfectly synchronized with the video, and since I am using Wabbitemu, I can't tell what is my fault and what is the audio delay present in Wabbitemu. Also, I can now go back to 30Hz progressive frames, but I'll save that for tomorrow.
« Last Edit: January 01, 2014, 08:01:53 pm by fb39ca4 »

Offline Lunar Fire

  • LV3 Member (Next: 100)
  • ***
  • Posts: 66
  • Rating: +7/-1
  • I'll be watching you from the shadows
    • View Profile
    • My Tumblr
Re: Bad Apple SE
« Reply #31 on: January 01, 2014, 11:14:07 pm »
Can you try to calculate what is the lag between audio and video? It might simply be an imprecision problem that causes audio to slowly get out of sync with the video.

You could always try to resync the audio with the video every second or half second, but I think this might cause audio glitches that will be really bothering to some.

Good luck, keep up the good work. (Because of you I really got hooked on that Bad Apple song :P)
Your drill is the drill that will pierce the heavens!

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Bad Apple SE
« Reply #32 on: January 02, 2014, 01:15:24 am »
The desynchronization is because I need to have the video running on a timer at 60Hz, and the music running on a timer of 18.4Hz, but I can't set the timers to fire at exactly those rates. I should be able to get it fairly close in the end, but to do that, I need a real calculator, as the audio delay in Wabbitemu makes it hard to tell what is in sync and what is not.

EDIT: Going back to 30Hz non-interlaced was easier than I thought it would be. Latest version is attached:
« Last Edit: January 02, 2014, 02:31:54 am by fb39ca4 »

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Bad Apple SE
« Reply #33 on: January 02, 2014, 04:56:41 pm »
Just FYI, from what I rememeber wabbit doesn't playback sound properly (the pitch is off i think). Will check out on hardware ina bit. :)
« Last Edit: January 02, 2014, 04:57:04 pm by Art_of_camelot »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bad Apple SE
« Reply #34 on: January 02, 2014, 07:55:28 pm »
I just listened to this and it sounds much better now :)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Bad Apple SE
« Reply #35 on: January 03, 2014, 10:22:28 pm »
Two things in this update. The first is behind the scenes - I replaced the RLE compression I was using previously, which stored runs of individual pixels, with one that stores runs of bytes. The former was slow to decode because the bytes sent to the screen needed to be reconstructed bit by bit. The method I am using now, which is the similar to the one used for the Pokemon Mini version, is much faster to decode, and also takes up less space. The second is I am trying something new for synchronization. The video is supposed to run at 30Hz, and the audio updater is supposed to run at 18.4Hz, a 1/46:1/75 ratio. I now have a single timer controlling both firing at 1380Hz (well, as close to 1380Hz as I could get it), and the video gets updated every 46th time it fires while the audio gets updated every 75th time. Hopefully, this results in better synchronization. It would be great if someone could run the app on a real calculator and let me know about how many seconds the music is off - use the original video for reference.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bad Apple SE
« Reply #36 on: January 04, 2014, 12:27:13 am »
Very nice. At one point I need to find my adapter again to try this. I hope it fits in my 84+ link port. (I had troubles fitting it in the CSE one)

By the way, would this method allow a smaller version of the Zelda: Dark Link Quest video at the end of the game if it was converted to it (of course there would be no sound)? http://youtu.be/vapwcynbgvs?t=1m18s (The original is made of code, images and some drawing commands/libs, not just entire video frames, so it would most likely need to be converted from a GIF or video)
« Last Edit: January 04, 2014, 12:30:47 am by DJ Omnimaga »
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Bad Apple SE
« Reply #37 on: January 04, 2014, 01:44:50 am »
The compression I am using would not be very helpful, as it is meant for large areas of solid color. You could try looking into Pucrunch or Apack, which are more general purpose algorithms, which is what I believe Iambian was using in his YABVA.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bad Apple SE
« Reply #38 on: January 04, 2014, 01:49:00 am »
Ok thanks anyway :)
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Bad Apple SE
« Reply #39 on: January 04, 2014, 07:49:18 am »
Ok, so I can't find my adapter at the moment. I'm sure it's hidden somewhere in the bowels of my room. I'll look again after I clean up today.

Offline Hooloovoo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 225
  • Rating: +22/-0
    • View Profile
Re: Bad Apple SE
« Reply #40 on: January 05, 2014, 11:19:25 pm »
It's hard to tell how well the audio is synchronized, so I'll have to do some more tests. It appears to be the correct length as the video, so that's promising. One issue I see is that the video often won't start, and sometimes the audio won't play. It didn't happen in tilem, so I don't know what could be causing it. I also have a feature request: a key to instantly escape, since the only way out is to pull a battery.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale." -tr1p1ea
Spoiler For some of the calcs I own:



(actually I have quite a few more than this, but I don't feel like making bars for them all.)

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Bad Apple SE
« Reply #41 on: January 06, 2014, 12:32:43 am »
You could always keep the length as the number of pixels, then draw the screen in bytes as soon as the location is aligned, until the number of pixels remaining drops below 8.
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: Bad Apple SE
« Reply #42 on: January 10, 2014, 08:16:32 pm »
Alright, finally got to test this on hardware. Here's my feedback. I tried 3 different headsets and could not get this to produce sound. However, when I plugged it into my pc speakers, viola! Sound! It did crash after running though, and now it doesn't seem to want to run again. These are the results of my initial tests. Test was done on a TI-84+SE.

*edit* Oh, and because it's relevant: I have had sound work in other calc apps with just headphones. I may try on more calcs and see if there is any difference.

*edit 2:* A few battery pulls later it is working again and I am getting sound through headphones as well. So, it works sometimes, but looks like you might have a few bugs.

*edit*3: It's hard to sychronize the original vid and the calc vid playing together, but I think the tempo of the calc version might be a bit slower. It  seems to end a second or two later.
« Last Edit: January 10, 2014, 08:55:42 pm by Art_of_camelot »

Offline fb39ca4

  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1749
  • Rating: +60/-3
    • View Profile
Re: Bad Apple SE
« Reply #43 on: January 10, 2014, 10:26:38 pm »
I think I have fixed the crashing problem, so the latest version is attached. By crash, did the app exit, and then did the homescreen cursor appear and freeze? By the way, what program did you use to transfer the app? It fails 3/4 of the way through with TI-Connect, and I haven't been able to get TILP to detect the calculator at all.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55942
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Bad Apple SE
« Reply #44 on: January 11, 2014, 12:12:11 am »
Do you use a serial link cable? I noticed most large apps fail halway through with it in TI-Connect, while with direct USB it works fine. I didn't try silverlink, though.
Now active at https://discord.gg/cuZcfcF (CodeWalrus server)