1

Hi, I'm going to need your help. Again.

I look today for sound effects and music.

As I understand, wav files (after conversion) can be placed in the m1 Rom for adpcm A and B. But we can not read music (at least in loop), it's only sound effects ..
For music we must use the YM2610. In v1 rom.
I tried the démos by Freem, the sound going well but we can not play a looped melody. correct.

I tried with mvstracker (music and sound effects) but I have problems. I use sound.h, music and effects are played, but some times I have to repeat the command to play music and effects become less strong or null.

Can I use mvstracker with Datlib/Neobitz? Can I use midi files to create music ?

2

Tonma (./1) :
As I understand, wav files (after conversion) can be placed in the m1 Rom for adpcm A and B. But we can not read music (at least in loop), it's only sound effects ..For music we must use the YM2610. In v1 rom.
The two seem backwards here; sounds (ADPCM-A, ADPCM-B) go in the .v* roms, YM2610 driver control/Z80 code in the .m1 rom.
Tonma (./1) :
I tried the démos by Freem, the sound going well but we can not play a looped melody. correct.
The YM2610 only has native loop support for ADPCM-B; any ADPCM-A looping has to be done in software/Z80 code. (This is typically achieved by having loop point data somewhere in the M1 file, then watching Status 1 (Port 06) for the relevant channel to end playback, and finally set the new playback/ending points from the loop data in ROM.)
Tonma (./1) :
I tried with mvstracker (music and sound effects) but I have problems. I use sound.h, music and effects are played, but some times I have to repeat the command to play music and effects become less strong or null.
MVSTracker's ADPCM-A conversion is known to be flawed, which might explain why the sounds act odd.
I'm not fully sure as to why the music wouldn't work, but the MVSTracker driver doesn't work properly on real hardware (it's missing the required waits between address and data writes).
Tonma (./1) :
Can I use mvstracker with Datlib/Neobitz? Can I use midi files to create music ?
I believe one of the versions of Frog Feast (don't recall if it was the cart or CD version) used the MVSTracker library with the NeoBitz kit.

For MIDI, you would have to use a module tracker that allows importing MIDI files (such as OpenMPT), then convert to MOD and import that MOD in MVSTracker. However, only the first four channels will be used, and you will have to re-assign instruments.

Music creation for the Neo-Geo is in a pretty sad state at the moment, as to take full advantage of the YM2610, a new sound driver and tracker (or converter) would have to be created. I did start work on a music driver, but it's nowhere near complete, and a lot of things are going over my head (in terms of understanding things).
avatar

3

The YM2610 only has native loop support for ADPCM-B; any ADPCM-A looping has to be done in software/Z80 code. (This is typically achieved by having loop point data somewhere in the M1 file, then watching Status 1 (Port 06) for the relevant channel to end playback, and finally set the new playback/ending points from the loop data in ROM.)

Ok, I'll try your z80 code in your m1-rom. Maybe I use a bad version of mvs tracker.
For MIDI, you would have to use a module tracker that allows importing MIDI files (such as OpenMPT), then convert to MOD and import that MOD in MVSTracker. However, only the first four channels will be used, and you will have to re-assign instruments.

I success in converting mid to mod with openMPT but can't transfert instrument. Do I need to create my Instrument from openMPT ?

http://www.servimg.com/view/18896864/53[img][/img]

4

When converting the MIDI to MOD, the instrument data itself is not kept, since MOD is a sample-based format (typically). You would have to reassign the instruments in MVSTracker (load one of the instruments it comes with and hope it sounds okay).
avatar

5

I had the luck to acquire a license of the Neobitz "Neo Sound Builder" from Jeff Kurtz a few years ago.
The software allows to import 16bit mono .wav files and generate ADPCM-A sound files out of it.
After that you can export them into V1 and V2 roms + M1 driver rom + sound.h (contains ADPCM Sample commands).

https://www.facebook.com/media/set/?set=a.415692581788967.103107.221161891242038&type=3

6

Yeah, it's a shame that program isn't available to the public yet. From what little I've seen of it (I don't have it myself), it seems nice.

At some point I was working on a program similar to Neo Sound Builder, but I have too many projects as it stands; I never got around to finishing it.
avatar

7

a license of the Neobitz "Neo Sound Builder" from Jeff Kurtz
So Lucky.

I try to save the instrument in openMPT and reload in mvstracker without success. I have data but no sound.

But I use your demo code with your driver (adpcma_test) and seems to work. I need now to create V Rom, change length of sample in the z80 drivers and try the loop. wink

8

Day's news.

I could create a Music/sound Rom with your ADPCM-A encoder tool and svrom.lua (thanks freem). I test and have good results.

Now I need to add the adpcm-b to my rom for the looping flag and test the Sound off.

I read some doc
https://wiki.neogeodev.org/index.php?title=YM2610_ASM_defines
https://wiki.neogeodev.org/index.php?title=YM2610_registers
and SOUND_STOP equ $D00046 ;byte

I think I don't try to change your z80 code but use the flag in adpcm-B for looping. Something like send 0x02 to PB_FLAG.

9

Hi to everyone here

about the sound on neo, if you want that to change things, it's up to you to decide - guys, please vote, to increase the counter neogeo concerning Deflemask
//when I read the last posts, I realize I'm not the only one to use Hoot...

Please vote here.
(http://www.delek.com.ar/forum/deflemask/next-system-to-be-added/)
remember, You must be registered

Neo Geo 4 (7.5 % ) <<<<<<<<<<< NOT ENOUGHT after 2 months , since 06/2015
OPL3 10 (18.9 % )
Atari POKEY 2 (3.8% )
SNES 17 (32.1% )
YM2151 18 (34% )
Amiga (.mod) 2 (3.8 % )
Total Voters: 53

>SpoonyBard: (talk about Yamaha YM2610 sound chip )

'The funny thing about this chip that I've learned from Hoot Player and scanning through the data of the Neo Geo roms with Audacity is that
the ADPCM-A channels can't play at variable pitches, so they creators would have to use multiple samples of the same instrument recorded in
different pitches. For example...
In most SNK fighters, 3 ADPCM channels are used. One for drums, one for hihats and cymbals and one typically for guitar, while the ADPCM-B
plays the melody along with the FM channels. The remaining ADPCM-A channels were used for sound effects.
In Waku Waku 7, there are typically repeated patterns recorded by musicians playing the song, which would then be looped over the other instruments.
In Pulstar, apparently they used entirely pre-arranged songs and recorded them as a sample in the game, so while the ADPCM-B song plays it at
a low frequency to save space, all other channels are used for sound effects.'


bye , Fred/FRONT I return to work ! ...

10

Thanks for the info.

I voted and now we are at Neo Geo - 5 (9.3% )

Come on guys, vote vote vote

11

@Front : I have found the encoder you use for adpcm-B. Thanks to you and ValleyBell.
I encoded music and to test I decoded music. Seems to work but I can't do it in Neo Geo.

@freem : I use your z80 code in "adpcma_v3 / adpcma_v2" to read sound. I have 4 adpcmaA sound effect and one apdcmB music Inside my v rom as you can see below.

I read adpcmA with a simple command :
move.b #0x10,0x320000
But how can I play adpcmb ? The music file the NG play is very bad.
Do your z80 code (in adpcma) play adpcmb. I saw this commande : write to port B and ;ADPCM-B PB_CTRL: EQU $10, in your code and définitions.
; [ADPCM-A Samples] samples_PCMA: word 0x0000,0x04C2 ; Sample #1 (howard.pcma) word 0x04C3,0x04D2 ; Sample #2 (bass2.pcma) word 0x04D3,0x04F9 ; Sample #3 (snare.pcma) word 0x04FA,0x0524 ; Sample #4 (openhh2.pcma) ; [ADPCM-B Samples] samples_PCMB: word 0x0525,0x0623 ; Sample #1 (actionpoint.bin, 44100Hz) ; [ADPCM-B Sample Rates] rates_PCMB: word 0xCB6A ; Sample #1 (actionpoint.bin, 44100Hz)

12

Tonma (./11) :
@freem : I use your z80 code in "adpcma_v3 / adpcma_v2" to read sound. I have 4 adpcmaA sound effect and one apdcmB music Inside my v rom as you can see below.

I read adpcmA with a simple command :
move.b #0x10,0x320000
But how can I play adpcmb ? The music file the NG play is very bad.
  • The 68K part of the Neo-Geo knows nothing about ADPCM-A or ADPCM-B; it just sends commands to and receives replies from the Z80. The M1/.Z80 file handles the ADPCM-A vs. ADPCM-B playback, typically using a table where each sound code has a specified type (e.g. 0=unused; I forget the rest of the ones SNK defined off the top of my head.)
  • ADPCM-A and ADPCM-B require different playback methods; if you try loading one sound type into another's registers, it won't end up very well.
Tonma (./11) :
Do your z80 code (in adpcma) play adpcmb. I saw this commande : write to port B and ;ADPCM-B PB_CTRL: EQU $10, in your code and définitions.

The ADPCM-A test demo I wrote (assuming that's what you're referring to) shouldn't have PCM-B playback... maybe it was left over from some other demo? I don't know if you've grabbed my ADPCM-B playback demo from my page or not, though I know the first two versions were broken (v3 should work properly... hopefully).
avatar

13

freem:
The YM2610 only has native loop support for ADPCM-B; any ADPCM-A looping has to be done in software/Z80 code. (This is typically achieved by having loop point data somewhere in the M1 file, then watching Status 1 (Port 06) for the relevant channel to end playback, and finally set the new playback/ending points from the loop data in ROM.)

please, can you post some example code how to do this, my z80-knowledge is a bit rusty. sad

14

I agree. I've tried to mix your driver (adpcma et adpmb) without success.

Your adpcm-a works great but need a loop and stop (for music or change screen. I'm really beginner in z80). Maybe adding adpcm-b in the same driver with a choice from the 68k. happy

15

Currently trying to work on such a demo, but having a hell of a time trying to get vlink to play ball with my continued use of .org directives...

linkscript.ld:
/* quick dumb Z80 linker script; no banking, currently untested */

MEMORY
{
	rom : ORIGIN = 0x0000, LENGTH = 0xF800
	ram : ORIGIN = 0xF800, LENGTH = 0x0800
}

SECTIONS
{
	.code : { *(code) } > rom
	.bss (NOLOAD) : { *(bss) } > ram
	.data : { *(data) } > ram AT> rom
}

output upon assembling and trying to link:
>vasmz80 -Fvobj -nosym -DTARGET_CART -o out-z80.vobj src_z80/main.asm

vasm 1.7c (c) in 2002-2015 Volker Barthelmann
vasm 8080/gbz80/z80/z180/rcmX000 cpu backend 0.2g (c) 2007,2009 Dominic Morris
vasm oldstyle syntax module 0.12c (c) 2002-2015 Frank Wille
vasm vobj output module 0.7c (c) 2002-2014 Volker Barthelmann

bss(acrwx1):             280 bytes
code(acrwx1):              4 bytes
seg18(acrwx1):             3 bytes
seg20(acrwx1):             3 bytes
seg28(acrwx1):             6 bytes
seg38(acrwx1):             4 bytes
seg66(acrwx1):           396 bytes

> vlink -brawbin1 -T src_z80/nobanking.ld -o _roms/snddemo-m1.m1 out-z80.vobj

Warning 64: Section out-z80.vobj(seg20) was not recognized by target linker script.
Warning 64: Section out-z80.vobj(seg28) was not recognized by target linker script.
Warning 64: Section out-z80.vobj(seg38) was not recognized by target linker script.
Warning 64: Section out-z80.vobj(seg66) was not recognized by target linker script.

Naïvely adding the sections after .code doesn't space out the routines properly (and I would like to avoid using hardcoded amounts for fills). (Oh, and trying to use the program counter symbol in expressions doesn't work; go figure.)
avatar

16

If you need me for testing ( I not know the z80 but I can do research on the compilation errors )

I have found this page http://www.harmlesslion.com/HLsup/viewtopic.php?f=12&t=1089 (talk about the same warning).