|
Post by sega16 on Sept 19, 2011 17:23:13 GMT -5
I found it, It is called ESEII Sound Importer and can be found info.sonicretro.org/Sonic_Hacking_Utilities under sound editors Then load the .bin as source check mark sound file for both then change the offset to zero select sonic 2 beta (yes it kinda works) and just pick one for sound id it should not matter.
|
|
|
Post by theelf on Oct 11, 2011 5:10:31 GMT -5
Hello! i really miss the part of how to play PCM samples
I convert a wav to 8bits 22khz PCM
Add it to PCM_TABLE.ASM & PCMSAMPS.ASM
and....
how to play in BEX?
thanxs!!
|
|
|
Post by sega16 on Oct 11, 2011 17:53:19 GMT -5
You use it in a smps song.
|
|
|
Post by theelf on Oct 11, 2011 18:02:37 GMT -5
If you have time, can explain this a little more?
For example, i have a song/sound in snd format, how i can use it in a smps? i need to convert? how?
|
|
|
Post by sega16 on Oct 13, 2011 17:17:27 GMT -5
Do you just want to play a sample and nothing else?If so than I would recommend using a z80 driver to play pcm for example here is a relay good compressed pcm player which I would highly recommend.The z80 driver is not my work I just put together a bex example LINK FOR FILES: depositfiles.com/files/81tqkx3fcStep 1: go to were all the bex files are stored and in the root directory create a folder called "pcm" Step 2: extract all the files in the attached zip file into the new folder Step 3: converting a song to tadpcm. To add a song you must first convert it to tadpcm so save anything you want as a headerless wav MUST BE 16-BIT MONO in your audio editing program (.snd in goldwave or .raw in alot of programs) or you could always just save as wave and hex edit out header.Now to convert the uncompressed file to tadpcm you must right click on compress.bat and replace what is in the double quotes to what you are converting you way get something like this: pcm2tadpcm "input.snd" "output.snd" Now run the batch file and you will get the compressed music file Step 4: adding the asm code for song. Now that you converted the song you must add the song to pcm_player.asm so first of all below cmpi.b #$02,d0 beq.w Playsong2
add cmpi.b #$03,d0 beq.w Playsong3
not the value by cmpi.b is a hex-decimal value and now find Playsong2: jsr PCMDriverLoad move.w #$100,($A11100).l ;Stop the Z80 WaitZ80_02: btst #0,($A11100).l bne.s WaitZ80_02 ;Wait for z80 to stop move.b #(((song2)&$FF0000)>>16),($a00042).l ;location high byte move.b #(((song2)&$FF00)>>8),($a00041).l ;location mid byte move.b #((song2)&$FF),($a00040).l ;location low byte move.b #(((song3-song2)&$FF0000)>>16),($a00045).l ;length high byte move.b #(((song3-song2)&$FF00)>>8),($a00044).l ;length mid byte move.b #((song3-song2)&$FF),($a00043).l ;length low byte move.b #$C0,($a0004d).l ;pan center move.b #$FF,($a0004e).l ;play how many times move.b #$00,($a0004f).l ;pause = 0 move.b #$01,($a00050).l ;sample rate (NEW!);0D=11khz 04=16KHZ 22KHZ=01 8khz=15 7khz=1A 6khz=20 5khz=28 move.w #$0,($A11100).l ;Start the Z80 goback: rts
copy paste all this and paste it below: goback: rts
you will have 2 labels that say goback: remove 1 of them once you did that on the new copy change: Playsong2: jsr PCMDriverLoad move.w #$100,($A11100).l ;Stop the Z80 WaitZ80_02: btst #0,($A11100).l bne.s WaitZ80_02 ;Wait for z80 to stop
to Playsong3: jsr PCMDriverLoad move.w #$100,($A11100).l ;Stop the Z80 WaitZ80_03: btst #0,($A11100).l bne.s WaitZ80_03 ;Wait for z80 to stop
(I replaced the labels that say 2 and changed them to 3) now change: move.b #(((song2)&$FF0000)>>16),($a00042).l ;location high byte move.b #(((song2)&$FF00)>>8),($a00041).l ;location mid byte move.b #((song2)&$FF),($a00040).l ;location low byte move.b #(((song3-song2)&$FF0000)>>16),($a00045).l ;length high byte move.b #(((song3-song2)&$FF00)>>8),($a00044).l ;length mid byte move.b #((song3-song2)&$FF),($a00043).l ;length low byte
to: move.b #(((song3)&$FF0000)>>16),($a00042).l ;location high byte move.b #(((song3)&$FF00)>>8),($a00041).l ;location mid byte move.b #((song3)&$FF),($a00040).l ;location low byte move.b #(((song4-song3)&$FF0000)>>16),($a00045).l ;length high byte move.b #(((song4-song3)&$FF00)>>8),($a00044).l ;length mid byte move.b #((song4-song3)&$FF),($a00043).l ;length low byte
(changed song2 to song3 and changed song3 to song4) also you can change the sample rate based on the song by changing this: move.b #$01,($a00050).l ;sample rate (NEW!);0D=11khz 04=16KHZ 22KHZ=01 8khz=15 7khz=1A 6khz=20 5khz=28
now find: song2: incbin "pcm\The Brentwoods - Billy Maysc.snd" align 2 song3:
and change it to song2: incbin "pcm\The Brentwoods - Billy Maysc.snd" align 2 song3: incbin "pcm\Lights_out_rick_astleyc.snd" align 2 song4:
step 5:playing the sample now to add tadpcm to your project just add that code below to the bottom of your project: asm include "pcm\pcm_player.asm" end asm
and to play a song just simply put asm move.b #$01,d0 jsr Playtadpcm end asm
or if you want to play song 2 do asm move.b #$02,d0 jsr Playtadpcm end asm
|
|
kramlat
Moldy Popcorn
got slack?
Posts: 42
|
Post by kramlat on Apr 6, 2012 1:29:31 GMT -5
I would say writing a smps core purely in basic using pokes and peeks as well as on...gosub should be possible and I want to try it, the documentation on the ym2612 and sn67489 are out there and the smps system is rather simple in design.
anyone know of a good pcm core to use for DAC samples. Edit, sega16 just posted one the format is rather simple: the first two bytes are the address to the voice bank which can have up to 256 25 byte voices the next byte is number of FM channels plus the dac channel, if it is 0, then nothing is there, if it is 7, then no DAC channel, just 6 fm channels the next byte is the number of PSG channels then you have the tempo divide time as the next byte and the tempo itself as the next one after that followed by a word storing the location of the track containing DAC instructions then you have 2 reserved bytes after that you have a word storing the location of the first FM track, followed by the channel key in a byte and the volume in another, this repeats for all your fm channels after that you have a word that points to the first PSG track, followed by the channel key in a byte, the volume attenuation in another byte, a reserved byte, and the selected psg tone or noise sample. this repeats for all psg channels and optionally if it is a 32x game you might find 4 pwm tracks which have pointers like those used for psg minus the last two bytes
next we look at the channels themselves: 0 - 7F = note length, 0 is actually a length of 128, not a null note 80 - DF = notes themselves, 80 is a rest E0 - FF = coordinance flags, no smps core out there uses exactly the same ones for the same things. Use those fordoing things that key on and key off events cannot do, such as cross fades.
The dac samples are mapped to notes just as midi channel 10 is, but it is very common for the first to be a kick, the next one to be a snare, then a timpani followed by what other samples are useful in your game.
as for how the notes are placed, works like this: E0 01 02 81 83 83 25 85 30 4F lets assume the first flag sets the fm voice to the second one, well the next byte sets the duration to 2 and plays what aver note was last used, then we see an 81 byte, that sets the note to C1 and plays it with a duration of 2, then we have a 83 byte, so it plays D1 at the same duration as the last one was at, the next byte was the same so it repeats exactly as it did last, then we have a 25 byte, so it plays D1 with a duration of 25h, then we have an 85 byte, so it plays E1 with a duration of 25h, then we have a 30 byte, so it plays the E1 note with a duration of 30h, then we have a 4F byte, so it plays E1 with a duration of 4Fh I am sure you get the idea how this thing works.
|
|
|
Post by sega16 on Apr 6, 2012 12:42:32 GMT -5
Why not just use the asm based smps or are you trying to make your own format?
|
|
|
Post by markin on Dec 12, 2017 22:02:00 GMT -5
Hi Sega16! You have already downloaded the package you made available on depositfile, and used it successfully. But after some unused time, my file has become corrupted, and the download is no longer available.
Could you please make this file available again?
It can be in googledrive, 4shared, or if you want, you can even send it to my email: markin.exe@gmail.com
I am very grateful, and await your response. Hug.
This text was written in English, and translated by google translate. I hope that's understandable.
texto original:
Oi Sega16! Já havia baixado o pacote disponibilizado por você no depositfile, e usado com sucesso. Mas depois de um tempo sem usar, meu arquivo ficou corrompido, e o download não está mais disponível.
Por favor, você poderia disponibilizar novamente este arquivo?
Pode ser no googledrive, 4shared, ou se quiser, pode até enviar para meu e-mail: markin.exe@gmail.com
Fico muitíssimo grato, e vou aguardar sua resposta. Abraço.
|
|
|
Post by sega16 on Dec 15, 2017 6:29:03 GMT -5
I uploaded a new link. I improved the example by adding more songs to it and I added a missing folder S1DRV.
Also I changed the tutorial to use OpenMPT, if you have problems use the Compatibility export.
|
|
|
Post by markin on Dec 22, 2017 23:08:45 GMT -5
Perfect!!
I'm back in the game, though, having run out of use for a long time, I forgot how difficult it is to do a conversion. I'd like to thank you for showing me some songs that I'm converting, but it's a bit difficult. However, I wanted to say that I have a preference for this format, due to the ability to insert effects into the game, using instrument sounds rather than DAC samples.
I would also ask, (if it's not too much bother), if you would not point me to an ASM tutorial to facilitate my learning. I understood some things, but wanted to delete some songs from the file that comes included, (smps_every_song), but you can not do this without causing errors. wanted to put just what to use.
I have some songs that I'm rewriting from the arcades, which are not available on the internet.
I am very happy to be back with SMPS, and thank you again for that.
translated by google translate
Perfeito!!
Estou novamente no jogo, embora, por ter ficado sem usar por um longo tempo, esqueci quanto difícil é fazer uma conversão. Gostaria de te agradecer mostrando algumas músicas que estou convertendo, mas está um pouco difícil. Contudo, queria dizer que tenho preferência por este formato, devido a capacidade de inserir efeitos no jogo, usando os sons dos instrumentos, ao invés de amostras DAC.
Gostaria de pedir também, (se não for muito incômodo), se você não me indicaria um tutorial de ASM para facilitar meu aprendizado. Entendi algumas coisas, mas queria eliminar algumas músicas do arquivo que vem incluso, (smps_every_song), porém não estu conseguindo fazer isso sem causar erros. queria colocar apenas o que fosse usar.
Tenho algumas músicas que estou reescrevendo dos arcades, e que não estão disponíveis na internet.
Estou muito feliz de estar de volta com o SMPS, e te agradeço novamente por isso.
|
|