Playing Megatizer music with GFABASIC: Difference between revisions

From AtariForumWiki
Jump to navigation Jump to search
>Simonsunnyboy
(New page: .Whaddaya do if you want to call a -Megatizer- music in GfA-Basic ??? 'Peek at this... 'Coded by Jedi of Sector One from The Heavy Killers ' FILESELECT "\*.thk","",file$ ! Choose a f...)
 
>Simonsunnyboy
No edit summary
Line 1: Line 1:
  .Whaddaya do if you want to call a -Megatizer- music in GfA-Basic ???
  'Whaddaya do if you want to call a -Megatizer- music in GfA-Basic ???
  'Peek at this...
  'Peek at this...
  'Coded by Jedi of Sector One from The Heavy Killers
  'Coded by Jedi of Sector One from The Heavy Killers
Line 26: Line 26:
  ~MFREE(music%)                ! There's no use anymore
  ~MFREE(music%)                ! There's no use anymore
  EDIT                          ! Back to the editor or desktop
  EDIT                          ! Back to the editor or desktop
(Editor's note: the calling interface looks similar to Madmax tunes. You probably can play all MAdmax tunes which do not use timer effects with the same method.)

Revision as of 07:18, 19 October 2008

'Whaddaya do if you want to call a -Megatizer- music in GfA-Basic ???
'Peek at this...
'Coded by Jedi of Sector One from The Heavy Killers
'
FILESELECT "\*.thk","",file$  ! Choose a file
IF EXIST(file$)=0             ! Does it exist ???
  EDIT                        ! No => Back to the editor
ENDIF
'
OPEN "i",#1,file$             ! Open the file
len%=LOF(#1)                  ! Length of that file
RESERVE FRE(0)-len%           ! Reserve a part of the memory
music%=MALLOC(len%)           ! Define a buffer ( to put the music )
BGET #1,music%,len%           ! Transfer the datas into the buffer
CLOSE #1                      ! Close the file
'
~XBIOS(&H26,L:music%)         ! Initialize the music
SLPOKE &H4D2,music%+8         ! Play it at each VBL
'
KEYGET zzz%                   ! Wait for a key
'
SLPOKE &H4D2,0                ! Stop playing
~XBIOS(&H26,L:music%+4)       ! Switch off all voices and set back interrupts
SPOKE &H484,15                ! Enable this fuckin' 'Bip' of the keyboard
'
~MFREE(music%)                ! There's no use anymore
EDIT                          ! Back to the editor or desktop

(Editor's note: the calling interface looks similar to Madmax tunes. You probably can play all MAdmax tunes which do not use timer effects with the same method.)