Welcome, Guest. Please login or register.


Author Topic: Music and Sound ingame on Enterprise (Read 172 times)

Offline Keith56

  • Newbie
  • Posts: 4
  • Country: jp
  • Z80FTW!
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 55.0 Firefox 55.0
    • View Profile
    • ChibiAkumas
Music and Sound ingame on Enterprise
« on: 2018.February.12. 10:10:41 »
I've recently started researching the Enterprise 128 - with the end goal of converting my CPC game to it.

it seems the Graphics, File and Key input will not be a problem for me, but one thing I'm unclear about is what my options for Sound and Music in game are on the Enterprise

On the CPC I use ArkosTracker (V1 not the new V2) and it's player for all sound and music, and just call it on the interrupts to handle the updating of sound - which is great!

Of course I understand the Enterprise has a different sound chip, and I think it's going to be beyond my understanding (of music and sound concepts at least!) to convert ArkosPlayer to the enterprise sound chip.

I'm wondering if there is a similar opensource player/tracker that I can use in my game for my sound needs? of course it would need to be minimal CPU utilization as my game is graphics heavy!

Any advice would be much appreciated!
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
Beginners guide to Mulltiplatform Z80 Assembly Programming...http://www.chibiakumas.com/z80

Offline geco

  • EP addict
  • *
  • Posts: 4636
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 52.0 Firefox 52.0
    • View Profile
Re: Music and Sound ingame on Enterprise
« Reply #1 on: 2018.February.12. 10:46:11 »
IstvánV wrote a good AY amulator routine for EP, there are problems only when noise and tone sounds on the same channel, and if the music uses high rate envelopes then envelope emulation should be placed into 1KHz interrupt, if you interested in this solution i will search this for you, otherwise we do not have so nice tool like ARKOS tracker on PC Music Box on EP description only in Hungarian, or other possibility to make the music in midi and convert it with midi conv utility to EP, I think the easies way to use AY emulation.

Offline Zozosoft

  • EP addict
  • *
  • Posts: 12714
  • Country: hu
  • OS:
  • Windows XP Windows XP
  • Browser:
  • Firefox 52.0 Firefox 52.0
    • View Profile
    • http://enterprise.iko.hu/
Re: Music and Sound ingame on Enterprise
« Reply #2 on: 2018.February.12. 10:52:34 »
The Dave similar to the AY, but not same. CPC and Spectrum 128 conversions usualy using AY conversion routine injected to the player code, which is converting AY register writes to Dave. IstvanV made the best conversion routine.
Because the Dave can't made all thing what the AY can, some musics are good some not too good :oops: And at the other side not all Dave capatibilities used.

Currently the best Dave musics: IstvanV made a MIDI conversion utility and player for the converted musics. Then you can use Midi editor on the PC. Also possible set up the ep128emu as midi output device, then you can hear on the fly the edited music with Dave sound. Szipucsu are the master of creating midi musics to the EP.
IstvanV and Szipucsu made a collection of envelopes (Dave instruments) which are really sounds good on Dave!

Offline Keith56

  • Newbie
  • Posts: 4
  • Country: jp
  • Z80FTW!
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 55.0 Firefox 55.0
    • View Profile
    • ChibiAkumas
Re: Music and Sound ingame on Enterprise
« Reply #3 on: 2018.February.12. 12:48:47 »
IstvánV wrote a good AY amulator routine for EP, there are problems only when noise and tone sounds on the same channel, and if the music uses high rate envelopes then envelope emulation should be placed into 1KHz interrupt, if you interested in this solution i will search this for you

If you could let me know some links to this - I'll give it a try, if it turns out not to be good enough I'll try something else, but I'd be interested to give it a go!
Chibi Akuma(s) Comedy-Horror 8-bit Bullet Hell shooter for CPC - http://www.chibiakumas.com
Beginners guide to Mulltiplatform Z80 Assembly Programming...http://www.chibiakumas.com/z80

Offline geco

  • EP addict
  • *
  • Posts: 4636
  • Country: hu
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 52.0 Firefox 52.0
    • View Profile
Re: Music and Sound ingame on Enterprise
« Reply #4 on: 2018.February.12. 14:37:05 »
Source code of Cybernoid loader contains this routine, and some more which can be useful, therefore I did not copied the AY rutin only.

The rutin starts here
"ENABLE_STEREO           equ     1"
envelopeInterrupt is the rutin which has to be inserted into interrupt if the music uses AY envelopes, if it has low rate envelopes then it is enough to call from 50Hz interrupt, if not  then a 1Khz Dave interrupt should be activate also beside of 50Hz video interrupt and this rutin should be called in this interrupt.
ayReset resets the AY emulator to it's initial phase, good to use before new song starts.
ayRegisterRead for reading AY register, in: A register contains number of AY register, out: value in A register
ayRegisterWrite for writing AY register, in: A register contains number of AY register, C is data to be written to AY.
ayRegisterWriteAllI writes all AY register from 0-13, DE contains the AY table
ayRegisterWriteAllD writes all AY register from 13-0, DE contains the AY table
setToneAndNoiseMode by this rutin you can check which mode sounds the best if there is sound and noise on the same channel in the music.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4377
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 57.0 Firefox 57.0
    • View Profile
Re: Music and Sound ingame on Enterprise
« Reply #5 on: 2018.February.12. 15:21:22 »
Source code of Cybernoid loader contains this routine, and some more which can be useful, therefore I did not copied the AY rutin only.

The version of the routine in Cybernoid is a bit old, I also recommend checking other CPC ports like Boulder Dash (bouldash.s).

Online szipucsu

  • EP addict
  • *
  • Posts: 6781
  • Country: hu
  • OS:
  • Windows NT 10.0 Windows NT 10.0
  • Browser:
  • Chrome 63.0.3239.132 Chrome 63.0.3239.132
    • View Profile
    • Webnyelv.hu - Tanuljunk nyelveket!
Re: Music and Sound ingame on Enterprise
« Reply #6 on: 2018.February.12. 17:35:28 »
I suggest using midiplay and midiconv to create Enterprise music. You have to create the song in midi format first, then convert it into Enterprise format. However converting songs from the CPC is different.

Offline IstvanV

  • EP addict
  • *
  • Posts: 4377
  • OS:
  • Linux Linux
  • Browser:
  • Firefox 57.0 Firefox 57.0
    • View Profile
Re: Music and Sound ingame on Enterprise
« Reply #7 on: 2018.February.12. 18:11:28 »
or other possibility to make the music in midi and convert it with midi conv utility to EP, I think the easies way to use AY emulation.

It depends on whether the goal is to compose new music specifically for the Enterprise, or to convert existing music from the CPC. For the latter, AY emulation is the easiest. Creating new music on the CPC first with familiar tools and then converting it is also a good approach, although the AY emulation routines have some limitations.

Composing native DAVE music takes full advantage of the capabilities of the chip, but there is some learning curve. For tips on how to make the best use of the various effects, it is best to ask Szipucsu. There is also a "davetest" program in the downloads for quick experimenting. The tools available for creating EP music are somewhat limited, but you can use:

- BASIC programs, these are easy to write for simple tunes, but become inconvenient when editing more complex polyphonic music
- a MIDI sequencer on PC combined with midiplay and midiconv, the advantage is being able to edit music interactively with full featured PC software, even use a keyboard if you have one, however, it requires more work to set everything up at first
- native editors, the only one I know is Music Box, unlike the above options, this has a player routine for efficient playback in assembly programs

BASIC or MIDI music is expensive to play in its original form. Therefore, games using it like Exorcist and Xorgame play a DAVE register dump of the tune (which midiconv can create with the -render option) that is stored in a compressed format. This method has some limitations, but it can work reasonably well. For both games, the converter program and player routine are available with the source code, the version in Exorcist is newer and more efficient.