including Vortex Tracker Files in Pasmo projects

On the creation of AY or Beeper music, including the packages used to do so.
Post Reply
El_P4g
Drutt
Posts: 3
Joined: Fri Nov 12, 2021 9:40 am

including Vortex Tracker Files in Pasmo projects

Post by El_P4g »

Hello,

Recently started learning assembly for the Speccy. I’m running simple experiments, getting stuck into Jonathan Caldwell’s book and watching various tutorials on YouTube etc. Great fun. I feel kinda spoiled with all the cool cross-platform tools available.

I’ve been using Pasmo to compile tap files that I can play back on an emulator and test my assembled code. On the side, I’ve compiled a few short tunes in Vortex Tracker 2.5 and have PT3 files for these.

My question is, how do I include the music in my pasmo projects?

My understanding is I will require a sound-driver for my emulated 128k to play them back, and Vortex Tracker can provide one (which might not be best optimised, but one step at a time for me). From looking at the exports available in Vortex Tracker it can spit out TAP files (and thus seem kind of stand-alone and thus not quite what I’m looking for here) and AY files, amongst others.

I’ve tried exporting an AY file (at $C000) and including it, but it just crashes the system:

Code: Select all

INCBIN cheesy_mod.ay

org $8000

MAIN:
    CALL INIT
    CALL PLAY
    EI
LOOP:
    HALT
    CALL PLAY+5
    JR LOOP

INIT: 
    call $C000
PLAY: 
    call $C005
MUTE:
    call $C008

end $8000
Does anyone have an example of a Pasmo ASM file where a Vortex Tracker AY is included, or any idea how I can include the AY files produced by Vortex Tracker. Any tutorials or guidance? I’m really quite lost.

Many Thanks for any help :D

Pag
Alone Coder
Manic Miner
Posts: 401
Joined: Fri Jan 03, 2020 10:00 am

Re: including Vortex Tracker Files in Pasmo projects

Post by Alone Coder »

Vortex Tracker player (a.k.a. Pro Tracker 3 player) plays *.pt3 files, not *.ay files.
El_P4g
Drutt
Posts: 3
Joined: Fri Nov 12, 2021 9:40 am

Re: including Vortex Tracker Files in Pasmo projects

Post by El_P4g »

Thanks for replying Alone Coder. I understand PT3 is the format for the tracker, I was wondering how to get it exported to play on an actual (or emulated) Speccy.

I've managed to get this (sort of) working. But it's a bit complicated at the moment:
  • I got Vortex to export my files as a TAP with origin at $C000
  • Inserting the TAP into the emulator, and in 128 basic, I ran LOAD ""CODE twice, loading "bytes" and "ptplayer" into memory.
  • I swapped out the virtual tape for a pasmo tape I created (as below) and did LOAD ""CODE once more.
  • Typed RANDOMIZE USR 32768 and got my tune. Incredible

Code: Select all

;main.z80
org $8000

main:
    ld de, $C86E
    call $C000
    ei
loop:
    halt
    call $C005
    jr loop

end $8000

; Export as:
; pasmo --tapbas main.z80 main.tap
Extremely gratifying. I can't stop grinning. Next question is how to get this onto a single TAP and running start to end, maybe with some actual game logic on top.

Cheers,

Alan

Cheers,

Alan
andydansby
Microbot
Posts: 148
Joined: Fri Nov 24, 2017 5:09 pm
Location: Syracuse, NY, USA
Contact:

Re: including Vortex Tracker Files in Pasmo projects

Post by andydansby »

[mention]El_P4g[/mention]

I've been playing a bit with the Vortex tracker code, and have created a couple of projects for testing.

Not using PASMO just yet, but here's some other assemblers.

Using SJASM
https://github.com/andydansby/Vortex2_Player_SJASM
https://github.com/andydansby/Vortex2_P ... 2_compress
https://github.com/andydansby/Vortex2_P ... ress_index

Using Z80ASM (via Z88dk)
https://github.com/andydansby/Vortex2_P ... M_compress
https://github.com/andydansby/Vortex2_P ... ress_index

All of those projects includes all files and a simple compile scenario. Just run compile.bat or zcompile.bat (in the case of Z80asm).

The buffer versions requires a bit of tweaking of the buffer size.

enjoy
andy
El_P4g
Drutt
Posts: 3
Joined: Fri Nov 12, 2021 9:40 am

Re: including Vortex Tracker Files in Pasmo projects

Post by El_P4g »

Hi Andy,

Amazing stuff. This looks really helpful, I appreciate you sharing.

Cheers,

Pag
andydansby
Microbot
Posts: 148
Joined: Fri Nov 24, 2017 5:09 pm
Location: Syracuse, NY, USA
Contact:

Re: including Vortex Tracker Files in Pasmo projects

Post by andydansby »

As for PASMO itself, I was not able to accomplish the same. For some reason I could not figure out why incbin did not set up a reference. So PASMO tripped me up.

Code: Select all

START
	ORG #8000	
    LD A,2	
    LD (START+10),A
	ld hl, song1
	
    CALL START+3	
    EI

_LP:
	HALT
	
	CALL START+5	
	XOR A	;test keyboard	
	IN A,(#FE)	
	CPL	
	AND 15	
	JR Z, _LP
	
	JP START+8	
ret
END		;note 1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
START		;note 2
	ORG #c000
	include "P_PTZX.asm"; the actual player
	
	; *** Song ***
	song1 equ 	INCBIN "Displace.pt3"

END
If I compile using this, I get an error "ERROR: Symbol 'song1' is undefined". If I remove START and END (note 1 and note 2), I get "ERROR: Invalid definition, previously defined as EQU or label". The problem is my lack of knowledge of using PASMO. It would be interesting to find out what to do with PASMO as I could not find other projects with multiple ORG's. I'm guessing that you may have to compile them separately and include a symbol file.

Z80ASM was my original goal as it is my pathway to include the Protracker player to work with Z88dk.

Andy
AndyC
Dynamite Dan
Posts: 1420
Joined: Mon Nov 13, 2017 5:12 am

Re: including Vortex Tracker Files in Pasmo projects

Post by AndyC »

Equ is for defining constant values, but you aren't providing a value. What you really want here is a label, so I'd imagine something like:

song
INCBIN "music.pt3"

Should be correct
andydansby
Microbot
Posts: 148
Joined: Fri Nov 24, 2017 5:09 pm
Location: Syracuse, NY, USA
Contact:

Re: including Vortex Tracker Files in Pasmo projects

Post by andydansby »

AndyC wrote: Sat Nov 13, 2021 1:30 pm Equ is for defining constant values, but you aren't providing a value. What you really want here is a label, so I'd imagine something like:

song
INCBIN "music.pt3"

Should be correct
Good catch. I still get errors using PASMO, but mainly due to my inexperience at it.

When I perform multiple ORG's within PASMO, it causes this:

Image

and also this

Image

Code: Select all

START
CALL_PLAYER
	ORG #8000
    LD A,2	
    LD (START+10),A
	ld hl, song1
    CALL START+3	
    EI

_LP:
	HALT
	
	CALL START+5	
	XOR A	;test keyboard	
	IN A,(#FE)	
	CPL	
	AND 15	
	JR Z, _LP
	JP START+8	
ret
;;;;;;;;;;;;;;;;;;;;;;;;;;;;
	ORG #c000
	include "P_PTZX.asm"
; *** Song ***
	song1 INCBIN "Displace.pt3"
END
Of course the idea is to have to player caller at $8000 and the player itself at $C000. Instead I get the player call at $8000 and $C000. With SJASM and Z80ASM, I'm not getting this, which is strange to me. I'm sure others have do it, I just haven't found a good example of it.
User avatar
Einar Saukas
Bugaboo
Posts: 3167
Joined: Wed Nov 15, 2017 2:48 pm

Re: including Vortex Tracker Files in Pasmo projects

Post by Einar Saukas »

Example of source code using Pasmo with AY:

https://spectrumcomputing.co.uk/entry/3 ... OMPLICA_DX
Post Reply