|
Post by picachu on Jul 5, 2018 9:02:51 GMT
Testing Sound FX from Dk Tronic.
I am testing Sound FX from Dk Tronic and the program is very good, and easy to use, but I have a question. When saving a sound, how can I specify the memory address, because the default sound is recorded in the address 30000.
Greetings and thanks!!!!!
|
|
|
Post by alessandro on Jul 5, 2018 13:05:32 GMT
Hi Picachu, I used that program myself to generate some sound effects for my projects. These effects are in fact short machine code routines, around 40 bytes long. It's very good but saves the effects from address 30000 on in fact. To relocate them, you'd have to disassemble the routine, paste it in a text editor like Notepad, rearrange the calling and jumping instructions' addresses accordingly and rebuild them as BIN files with an assembler like Pasmo. This is an example: LD D, 71 LD E, 205 LD B, 74 L_7536: PUSH BC LD A, (23624) SRL A SRL A SRL A SET 4, A OUT (254), A LD B, D L_7545: NOP NOP NOP DJNZ L_7545 RES 4, A OUT (254), A LD B, E L_754F: NOP NOP NOP DJNZ L_754F INC E NOP NOP DEC D POP BC DJNZ L_7536 RET This sound code has been edited so that it now starts from any address in the usable RAM rather than at a fixed one. All the DJNZ instructions have been modified accordingly. Just saving the code at address 30000 and reloading it at another address won't work, because the DJNZ instructions will jump to the addresses already present in the code when it was first saved. By replacing them with labels in the source code, it can be compiled at a different address, . If all of this sounds too difficult for you, you could employ BeepFX as an alternative, it will let you choose the code compiling address. I don't use it because it usually creates large files for my likings, but you might find it useful. Download it from its author's page. Apart from this, you should remember how to insert small routines in your code. From BASIC, you can call them with a RANDOMIZE USR [start address] command.
|
|
|
Post by picachu on Jul 5, 2018 20:14:14 GMT
good alejandro, thanks for your advice. But I think I've already found a method to work for music in my game. The only thing I need now, is to know how to convert a music file for example * .pt3 to * .bin With this, I will have the audio theme resolved. Or at least I hope so jejejje. If someone knows something about how to convert it, please comment me.
|
|
|
Post by lukebord1 on Jul 6, 2018 8:27:14 GMT
...the default sound is recorded in the address 30000. The DkTronics SoundFX utility generates relocatable code for the sound effects. So, if you export address 30000 length 50 (100 for two sounds, 150 for three sounds etc), you can import the bin file in any other memory address you like. For example, let's say you have the file "sound.bin" which was exported at 30000,100; you can re-import at the memory location 50000 and it will work calling through RANDOMIZE USR 50000 and 50050 (for the second sound).
|
|
|
Post by alessandro on Jul 9, 2018 10:34:33 GMT
good alejandro, thanks for your advice. But I think I've already found a method to work for music in my game. The only thing I need now, is to know how to convert a music file for example * .pt3 to * .bin With this, I will have the audio theme resolved. Or at least I hope so jejejje. If someone knows something about how to convert it, please comment me. Unfortunately you cannot do that so easily. While sound effects generated by programs like Sound FX are simple Z80 Assembly routines that can be run on every Spectrum, .PT3 files are Pro Tracker 3 AY sequencer files and cannot be stored in a binary format unless you export them with player data from an application like, for instance, Vortex Tracker. I attached the latest version of Vortex Tracker ( VortexTracker2.5.zip (841.14 KB)) to this post for you. Unfortunately it comes without documentation, so you will have to download the older 1.0 beta 19 version compressed file to get it. The DkTronics SoundFX utility generates relocatable code for the sound effects. Pah! Didn't notice that. Thanks for pointing that out, lukebord - that saves a considerable amount of work. I would only like to add that being a program designed for the 16K Spectrum, Sound FX stores the generated sound effects in contended memory, i.e. under address 32768. This means that if you store them from that address on, they will sound different due to being played at a faster speed.
|
|