First steps with MSX-Music

Página 1/3
| 2 | 3

Por Metalion

Paragon (1628)

Imagen del Metalion

09-08-2020, 18:48

OK, I'd like to make a sort of "Hello world" with MSX-Music, but without using MSX-Music BASIC. So I can switch to assembler when I understood how it works. I opened in the emulator an MSX2 and inserted a FM-PAC cartridge.

I made this small program :

10 CALL MUSIC (0,0,1,1,1,1,1,1,1,1,1)
20 AD=&h7FF4:DAT=&h7FF5
30 POKEAD,&h30:POKEDAT,&h2F:' Instrument 2, volume 15
40 POKEAD,&h10:POKEDAT,216:' F-number LSB = 216
50 POKEAD,&h20:POKEDAT,&b00001000:' Octave = 4, F-number MSB = 0
60 POKEAD,&h20:POKEDAT,&b00011000:' +Key on

This produces no sound at all ...
I've tried before that using the I/O ports &h7C/&h7D but the result was the same.
I thought that either I/O or POKE would work, since the FM-PAC is inserted ...

What am I missing ?

Thanks.

Login sesión o register para postear comentarios

Por Metalion

Paragon (1628)

Imagen del Metalion

09-08-2020, 23:15

No one ?

I just need a snippet of code showing me how to make a simple music note with MSX-Music. I know about the detection procedure, but I'm more interested about what happens after.

Por Grauw

Ascended (10820)

Imagen del Grauw

10-08-2020, 00:21

The volume and level values on Yamaha FM chips are actually attenuation amounts. Where 15 means max attenuation (almost silent) while 0 means no attenuation (max volume).

p.s. There is no need to set key-on separately from f-num/block .

Por Parn

Paladin (854)

Imagen del Parn

10-08-2020, 03:25

I'd suggest using _AUDREG instead of poking &H7FF4 and &H7FF5. Don't these mean that these addresses must be visible on the FM-PAC slot? It would be impossible to use them from BASIC. You could use OUT instead, but _AUDREG is cleaner.

Por Metalion

Paragon (1628)

Imagen del Metalion

10-08-2020, 10:28

Thanks to both your comments, this program did the job :

10 _MUSIC (0,0,1,1,1,1,1,1,1,1,1)
20 _AUDREG (16,216)
30 _AUDREG (48,&h20)
40 _AUDREG (32,&b00011000)

And it worked also using I/O ports.

Thanks !

Por Grauw

Ascended (10820)

Imagen del Grauw

10-08-2020, 11:05

p.s. The memory-mapped I/O at 7FF4H and 7FF5H is only available on the original FM-PAC, the MSX-MUSIC standard and FM-PAC clone cartridges do not support it (a little unfortunately).

Por DarkSchneider

Paragon (1030)

Imagen del DarkSchneider

10-08-2020, 11:09

When moving to ASM, remember that there is not only detection but initialization requirements.

Por Metalion

Paragon (1628)

Imagen del Metalion

10-08-2020, 18:32

DarkSchneider wrote:

When moving to ASM, remember that there is not only detection but initialization requirements.

What do you mean specifically?

Por Grauw

Ascended (10820)

Imagen del Grauw

10-08-2020, 20:17

If you detect an FM-PAC, you need to set bit 0 of address #7FF6 to enable the I/O ports (disabled by default to allow multiple FM-PACs). Further explanation here here. Example code including detection following the MSX Datapack advice here.

Por Briqunullus

Paladin (762)

Imagen del Briqunullus

11-08-2020, 09:28

Funny. I had always assumed FM-PAC cartridges would be I/O only, just like the Philips Music Module. However, that memory mapped I/O on the original FM-PAC is very clever indeed.

Just wondering. Because of that detection routine, even clones wouldn't work in an I/O only slot, would they?

Por Grauw

Ascended (10820)

Imagen del Grauw

11-08-2020, 09:56

That’s correct.

Página 1/3
| 2 | 3