Author Topic: Why is the sound getting disrupted on button press?  (Read 6542 times)

0 Members and 1 Guest are viewing this topic.

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Why is the sound getting disrupted on button press?
« on: November 07, 2011, 07:09:22 pm »
can somebody explain me why the sound gets distorted?
Here's the code:

Code: [Select]
:..MUSIC INCLUDE  //prgmMUSEINC
:Data(2100r,1990r,1870r,1770r,1670r,1580r,1490r,1400r,1320r,1250r,1180r,1110r,1050r,996r,940r,887r,837r,790r,746r,704r,665r,627r,592r,559r,527r,498r,470r,444r,419r,395r,373r,352r,332r,314r,296r,279r,264r,249r,235r,222r,209r,198r,186r,176r,166r,157r,148r,140r,132r,124r,117r,111r,105r,99r,93r,88r,83r,78r,74r,70r,66r,62r,59r,55r,52r,49r,47r,44r,42r,39r,37r,35r,33r,31r,29r,28r,26r,25r,23r,22r,21r,20r,19r,18r,17r,16r,15r,14r,13r,12r,11r,10r,10r,9r,9r,8r,8r,7r,7r)→GDB0
:0→oCN
:2→oCS
:4→oDN
:6→oDS
:8→oEN
:10→oFN
:12→oFS
:14→oGN
:16→oGS
:18→oAN
:20→oAS
:22→oBN
:Data(8192r,16384r,32796r,65535r)→GDB1
:0→oTS
:2→oSX
:4→oET
:6→oQR


Code: [Select]
:..ROUTINE //prgmMUSERT
:Lbl PM
:Freq({24*r2+r1+GDB0}r,{r3+GDB1}r
:Return

prgmYSPRITE1 and prgmYRPGSPR4 is a sprite and tilemap datas.

Code: [Select]
:.ASTEST
:prgmYSPRITE1
:prgmYRPGSPR4
:prgmMUSEINC
:Data(8,3,2,0,3,2,18,2,2,8,3,2,0,3,2,18,2,2,8,3,2,18,2,2,10,3,2,0,3,2,18,2,2,10,3,2,0,3,2,18,2,2,8,3,2,0,3,2,4,3,2,22,2,2,14,2,2,4,3,2,22,2,2,14,2,2,4,3,2,14,2,2,8,3,2,0,3,2,14,2,2,8,3,2,0,3,2,14,2,2,8,3,2,4,3,2)→Pic1M//Music Data
:32→T
:Data(0,0,9,10,0,9,10,0,9,10,0,0,0,0,5,5,10,4,4,9,5,5,0,0,0,0,5,5,5,5,5,5,5,5,0,0,0,0,5,5,5,5,5,5,5,5,0,7,0,0,0,0,0,0,0,0,0,0,0,0,25,25,25,25,25,0,0,25,25,25,25,25,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)→Str9//Tilemap Data
:ClrDraw
:0→C
:For(B,0,7                                       //Creates Tilemap and store into
:For(A,0,11                                     //L3
:{Str9+C}→D
:Pt-Off(8*A,8*B,8*D+Pic001
:C+1→C
:End:End
:Copy(L6,L3,768
:40→X→Y
:0→Z→P
:Repeat getKey(15)       //Main Loop
:ClrDraw
:Copy(L3,L6,768
:Pt-Off(X,Y,8*P+Str100
:DispGraph
:If getKey(2)
:X-8→X
:2→P
:End
:If getKey(3)
:X+8→X
:3→P
:End
:If getKey(1)
:Y+8→Y
:0→P
:End
:If getKey(4)
:Y-8→Y
:1→P
:End
:PM({3*Z+Pic1M},{3*Z+1+Pic1M},{3*Z+2+Pic1M}  //This plays sound
:Z+1→Z
:Z=32?0→Z   //Makes sound loop
:End
:prgmMUSERT
is it problem with getKey? is there a way to fix it?
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #1 on: November 07, 2011, 07:14:40 pm »
Could you post the source and executable files so we can try it out for ourselves?  What kind of distortion are you talking about?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #2 on: November 07, 2011, 07:15:35 pm »
source is already posted :P
Executable file:
http://www.omnimaga.org/index.php?action=dlattach;topic=4837.0;attach=10241
EDIT: the notes sounds weird whenever I press the buttons.
« Last Edit: November 07, 2011, 07:16:24 pm by TBO_Yeong »
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #3 on: November 07, 2011, 07:16:17 pm »
Yes but it would be a real pain to type that in if we wanted to make changes while we tested x.x

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #4 on: November 07, 2011, 07:17:34 pm »
Yes but it would be a real pain to type that in if we wanted to make changes while we tested x.x
D:
I don't have a link access with me right now so I'll post the on-calc source later (around 8:30)
but you can try the executable. :D
« Last Edit: November 07, 2011, 07:17:47 pm by TBO_Yeong »
Sig wipe!

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #5 on: November 07, 2011, 07:20:46 pm »
Yeah I can see what you mean, it sounds like the entire program slows down when you press keys.  I am completely unsure of what might be causing this, it sounds really strange o.O We might need some help from Runer or Quigibo since they have a better understanding of how the sound routines work.
« Last Edit: November 07, 2011, 07:30:34 pm by Builderboy »

Offline epic7

  • Chopin!
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2200
  • Rating: +135/-8
  • I like robots
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #6 on: November 07, 2011, 07:30:12 pm »
The Runer of Quibigo?

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #7 on: November 07, 2011, 07:30:51 pm »
Problem solved! XD
It was just MOS being idiotic.
Putting FnOff at first solved it XD
Thanks for ppl who were in IRC XD
« Last Edit: November 07, 2011, 07:31:50 pm by TBO_Yeong »
Sig wipe!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Why is the sound getting disrupted on button press?
« Reply #8 on: November 07, 2011, 08:08:25 pm »
The Runer of Quibigo?
Lol that actually sounds like an idea for a RPG name O.O

Problem solved! XD
It was just MOS being idiotic.
Putting FnOff at first solved it XD
Thanks for ppl who were in IRC XD
What does FnOff do btw? Did it just remove the busy indicator? Because I remember in TI-BASIC, when pressing keys it slowed things down by about 1% and I saw it happen in some ASM games too (especially in MirageOS games that didn't disable MirageOS interrupts)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #9 on: November 07, 2011, 08:22:48 pm »
Apparently, FnOff turns off the interrupt mode :D
so it turns off MirageOS's silly interrupt, making sound output better.
Sig wipe!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Why is the sound getting disrupted on button press?
« Reply #10 on: November 07, 2011, 08:33:48 pm »
Ah that explains it then. Don,t use L2, though, because it messes Mirage OS up IIRC. Those interrupts areNt really useful unless you want to slow the game down or quit in the middle of it (I think ON+MODE or something, but it was not always stable)

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #11 on: November 07, 2011, 08:34:58 pm »
how do I slow the game down with MOS?
Sig wipe!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Why is the sound getting disrupted on button press?
« Reply #12 on: November 07, 2011, 08:37:09 pm »
It doesn't work in every game but it did in some, like Galaxian: You need to hold down ON then press the F keys (IIRC, F1 is the slowest and F5 the fastest), but sometimes I think the opposite effect occured or every key gave the same slow down

Offline Iambian

  • Coder Of Tomorrow
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 739
  • Rating: +216/-3
  • Cherry Flavoured Nommer of Fishies
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #13 on: November 07, 2011, 08:37:26 pm »
ON+Y= for the slowest, ON+Graph for the fastest, ON+Zoom for normal speed. These settings seem to be somewhat broken on the TI-84+(SE) calcs, tho.

EDIT: Ninja'd. Oh, well. As DJ said, sometimes these things don't work at all. That usually happens when the game decides to turn interrupts off or they set up their own interrupts.
« Last Edit: November 07, 2011, 08:39:20 pm by Iambian »
A Cherry-Flavored Iambian draws near... what do you do? ...

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: Why is the sound getting disrupted on button press?
« Reply #14 on: November 07, 2011, 08:39:06 pm »
ah. :D
I don't need MirageOS interrupts then <_<
Sig wipe!