GEMS YouTube video

Talk about anything else you want

Moderator: BigEvilCorporation

Post Reply
M-374 LX
Very interested
Posts: 61
Joined: Mon Aug 11, 2008 10:15 pm
Contact:

GEMS YouTube video

Post by M-374 LX » Wed Oct 15, 2014 2:15 am

I have just found an interesting video on YouTube. It shows the editor of GEMS, the sound engine used in some Genesis games.

http://www.youtube.com/watch?v=lMPzDfvcM7o

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Wed Oct 15, 2014 4:16 am

GEMS is actually still usable on modern machines with a little work. I don't have the hardware side of the kit, but I have used it to make tunes. You just need a way of getting MIDI into it. You can do this with a physical cable to another machine with an MPU401, but I use dosemu on linux to pipe midi from a sequencer into it and then tweak it up with patches and samples.

Here's an example, a little tune I put together in GEMS for a game I'm working on. Not finished (needs polish) but it gets the point across. I made the recording in Fusion. The actual tune was tracked in Renoise (the same tracker I use to make non-Genesis music!) and the midi was piped into dosemu via Linux ALSA's internal virtual midi device which is connected to a pipe in dosemu.

https://app.box.com/s/986rsvuvew8isr7i7liw

Since I don't have the Genesis part of the kit, patches and volume are a trial and error thing. I copy values from DefleMask's instrument editor into GEMS' editor and it works fine. The work flow is a little weird, and would probably be weird even if I had the hardware. You save a .MOD file that is a module that is sort of like a makefile for all the stuff you're putting together, encompassing sequences, modulators, patches, and digital sound. You then "compile" these 4 things into assembly files with dc.b statements for the data for the GEMS engine to use. It's clunky creaky old DOS software and is kind of fussy about what you do with it but you get used to it and it honestly works pretty well once you are familiar with it.

GEMS is a pretty good sound engine overall--it has good features, I do kind of wish it did better with pitchbends and modulation, but it is very functional and has the HUGE advantage of letting the composer use what he's familiar with without having to worry about budgeting hardware channels or anything excessively technical. I suspect this is why it was so popular, that and it's pretty easy to drop into your code. It is a complete hardware and software solution, ready to go and at the time it had support from Sega/Technopop/Nu Romantic and so on. I think some GEMS games sound bad maybe because of less technical musicians, or maybe even just laziness. But bad composition isn't the fault of a sound engine... it's likely the lower "barrier to entry" led to some bad sounding games. Just think about how much worse they could have sounded without GEMS, though...

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Oct 15, 2014 6:04 am

powerofrecall wrote:I do kind of wish it did better with pitchbends and modulation
What do you mean?
Also, I hope you don't mixing up my own gems toolkit with official software. In official software you have to type all commands in sequence yourself. Or, may be I wrong?

May be you have an idea how to make it more straightforward? (making music with GEMS)

Oh god! Your track is awesome. :shock:
Image

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Wed Oct 15, 2014 2:03 pm

r57shell wrote: What do you mean?
To clarify: Pitchbends and modulation work fine, but inputting them is more difficult. From what I can tell, GEMS doesn't seem to understand MIDI pitch bend (the documentation also suggests this) and that is why the modulator bank exists--to create pre-programmed bend envelopes that can be inserted manually into the opcode editor. This is obviously less ideal than being able to move the pitchbend myself and have it handled automatically, as notes are. My understanding is that the data for a MIDI pitchbend is too large and inefficient to directly translate into the GEMS driver and that's why the modulator bank exists. I believe there are specific MIDI CC's to select a specific modulator from the bank and insert the modulator opcode, but I haven't tried that yet. In any case, it's not hard to create modulator envelopes for general pitch bend cases (Envelopes for -2, -5, -7, -12, +2, +5, +7, +12 being good general cases.)

Also, unless I'm mistaken, GEMS doesn't support MIDI velocity. Volume opcodes have to be inserted manually, unless there is something I'm missing.
r57shell wrote:Also, I hope you don't mixing up my own gems toolkit with official software. In official software you have to type all commands in sequence yourself. Or, may be I wrong?

May be you have an idea how to make it more straightforward? (making music with GEMS)
I have your utilities and I specifically like the split and merge tools you made. What I really wish I had was a patch converter that converted to whatever the hell an "Artec FM" patch is--what the GEMS documentation says it loads--or .PAT files, what GEMS itself saves. Annoyingly I don't think the GEMS driver native patch format is the same as the patches the editor loads.

I think all the opcodes have MIDI CC, check the end of GEMS.DOC. I'm a bit puzzled because it implies standard pitch bend works. Maybe I'm wrong? I'll have to look into that. Anyway, I can program them directly in my sequencer (Renoise uses the old-school tracker layout, so programming these effects is clean and logical). As far as making music with GEMS straightforward I'd suggest using some kind of MIDI tracker and taking advantage of CC's.
r57shell wrote:Oh god! Your track is awesome. :shock:
Thanks! I have moved my workflow over to the TX81Z, using TXConvert to convert Genesis patches into a form usable by the synth. This way I can get a better idea of the sound while I am working. This might also streamline it a bit, since I can just copy the patch values over to GEMS. Also, since I am using a tracker, it is trivial to load the drum PCM samples as an instrument in the tracker and create a "close enough" representation of the PSG as well with square waves.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Wed Oct 15, 2014 4:03 pm

powerofrecall wrote:Also, unless I'm mistaken, GEMS doesn't support MIDI velocity. Volume opcodes have to be inserted manually, unless there is something I'm missing.
I just don't get it. Do you sending MIDI events somewhere? May be in DOS application? If yes, say "Yes I'm sending MIDI events in DOS application GEMS". Because I thought it's completely useless without special hardware.

About velocity and pitchbend: you may apply it for whole channel in GEMS, and it works same except that fact that it applies to whole channel at once. For example: you can't pitch chord in different "dirrections", if all notes in same channel.
powerofrecall wrote:Annoyingly I don't think the GEMS driver native patch format is the same as the patches the editor loads.
If you talk about DOS GEMS editor patch format, I can check it. But I'm not sure about adding support for conversion into all formats.
powerofrecall wrote:As far as making music with GEMS straightforward I'd suggest using some kind of MIDI tracker and taking advantage of CC's.
I had only one idea: make GEMS targeted MIDI tracker, but requires so much effort. :?

I don't understand what you said about your track, but nevermind :D
Image

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Wed Oct 15, 2014 5:21 pm

r57shell wrote: I just don't get it. Do you sending MIDI events somewhere? May be in DOS application? If yes, say "Yes I'm sending MIDI events in DOS application GEMS". Because I thought it's completely useless without special hardware.
The MIDI side works without the Genesis hardware if you start up with the -ng flag.

To elaborate: I am using dosemu, a DOS virtual machine that happens to support a virtual MPU401 that I can send MIDI messages to through a loopback. I can send MIDI data from my sequencer to be recorded in GEMS. So, yes, I am sending MIDI events to the DOS application GEMS.EXE. :) The special hardware isn't needed to do this, only to play sequences from the editor and to hear patch editing. I think this is all the hardware does.
r57shell wrote:If you talk about DOS GEMS editor patch format, I can check it. But I'm not sure about adding support for conversion into all formats.
Yes, no patch converter supports the GEMS editor patch format. I have been converting them by hand, editing in DefleMask editor and then copying values to GEMS editor.
r57shell wrote: I had only one idea: make GEMS targeted MIDI tracker, but requires so much effort. :?
Fortunately there are many trackers that support MIDI:
OpenMPT has MIDI output in its instrument options and is free
MIDI Tracker is exactly what it says it is but it is not free and it is kind of junk
I think Schism Tracker does also
As does Renoise but it is a commercial software.

neologix
Very interested
Posts: 122
Joined: Mon May 07, 2007 5:19 pm
Location: New York, NY, USA
Contact:

Post by neologix » Thu Oct 16, 2014 3:06 am

powerofrecall or r57shell - If either of you can provide or otherwise point me to either the spec or reliable example preset files of this "Artec FM" and/or GEMS PAT format, I can add YM2612-to-GEMS preset dumping to VGM2Pre :D

A VGM made using a given preset file would also be appreciated so I can compare register values and such.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Thu Oct 16, 2014 1:52 pm

powerofrecall wrote:So, yes, I am sending MIDI events to the DOS application GEMS.EXE. :)
So you listening in Renoise, then feeding MIDI in GEMS.EXE channel by channel, after that, copy-paste patches from DefleMask: saving banks, and split them - to make song like directory? After that combining songs with my combiner? Or something like that?
powerofrecall wrote:Yes, no patch converter supports the GEMS editor patch format.
Ok, I'll look into it. But you can split, combine, and replace patches with converted from DefleMask patches. But I don't remember does my converter support latest DefleMask patches or not. But you may use VGM Maker instead of DefleMask for making instruments. My converter supports vgi (VGM Maker Instrument).
powerofrecall wrote:Fortunately there are many trackers that support MIDI:
You didn't understand me. There are many specific features in GEMS that is not MIDI compatible. For example: there is no LOOP command in MIDI, also there is no IF commands in MIDI, and so on.

I can convert MIDI one channel into GEMS one channel, but it is headache convert channel by channel, and change instruments in different software, and then, mixing up all this together, and feeding it into Genesis emulator or hardware to hear how it sounds.

neologix, I don't have sample PAT files, you may look into that yourself if you want. Also, did you know that I made vgmjuice and instrument converter?
Image

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Thu Oct 16, 2014 2:53 pm

r57shell wrote: So you listening in Renoise, then feeding MIDI in GEMS.EXE channel by channel, after that, copy-paste patches from DefleMask: saving banks, and split them - to make song like directory? After that combining songs with my combiner? Or something like that?
Not exactly that complex. Make song in Renoise, send MIDI to GEMS all at once--GEMS separates automatically by MIDI channel and you can send up to all 16 MIDI channels simultaneously. I thought at first that it was one at a time as well. In fact if you try to send one channel at a time it'll split them into separate sequences. So I press record on GEMS and play on Renoise and wait until song is done. Copy patches from DefleMask. Go into GEMS opcode editor and set patches, tempo and loop points manually. I can then "Compile" from GEMS the pbank/mbank/sbank/dbank.asm to assemble into my program.

I haven't had a need for it yet but your splitter/combiner does work well to put multiple GEMS songs together, but the GEMS .MOD format is intended to hold all samples & sequences for an entire production. All songs, patches and digital sounds. So I try to work the same way (put all music and sound into one MOD file).
r57shell wrote: Ok, I'll look into it. But you can split, combine, and replace patches with converted from DefleMask patches. But I don't remember does my converter support latest DefleMask patches or not. But you may use VGM Maker instead of DefleMask for making instruments. My converter supports vgi (VGM Maker Instrument).
I will try this. I have also had luck using your vgmjuice to make a GEMS native patch and then copying the hex directly into pbank.asm. The only disadvantage is these changes don't persist to the GEMS editor.
r57shell wrote: You didn't understand me. There are many specific features in GEMS that is not MIDI compatible. For example: there is no LOOP command in MIDI, also there is no IF commands in MIDI, and so on.
Here is a list of GEMS MIDI CC's from GEMS.DOC. The IF statement isn't there, but most of the others are:
  • Opcode: Note On
    Fields: Note number (60=middle C=C4); duration
    MIDI equivalent: Standard note-on/note-off pair
    Library routine: gemsnoteon/gemsnoteoff
    Notes:

    Opcode: Program Change
    Fields: Patch #
    MIDI equivalent: Standard program change
    Library routine: gemsprogchange
    Notes:

    Opcode: Modulator Change
    Fields: Modulator #
    MIDI equivalent: MIDI Controller #80 = Modulator #
    Library routine: gemssetenv
    Notes: Also triggers it if appropriate

    Opcode: Modulator Trigger
    Fields: Modulator Selection/Note On
    MIDI equivalent: MIDI Controller #68 = Env Sel(127)
    or Note On(0)
    Library routine: gemsretrigenv
    Notes: Default is Env Sel

    Opcode: Loop Start
    Fields: 1-126/Endless Reps
    MIDI equivalent: MIDI Controller #81 = Reps
    Library routine:
    Notes:

    Opcode: Loop End
    Fields: - none -
    MIDI equivalent: MIDI Controller #81 = 0
    Library routine:
    Notes:

    Opcode: Sustain Switch
    Fields: On/Off
    MIDI equivalent: MIDI Controller #64 = on(127), off(0)
    Library routine: gemssustain
    Notes: Default is off

    Opcode: Tempo
    Fields: 40-167 BPM
    MIDI equivalent: MIDI Controller #16 = Tempo-40
    Library routine: gemssettempo
    Notes:

    Opcode: Mute/Unmute Channel
    Fields: Channel 0-15
    MIDI equivalent: MIDI Controller #18 = channel #(+16 for
    unmute)
    Library routine: gemsmute
    Notes: Channel in this sequence

    Opcode: Priority
    Fields: 0-127
    MIDI equivalent: MIDI Controller #19 = priority
    Library routine: gemspriority
    Notes: Default is 0

    Opcode: Pitch Bend
    Fields: +/-x.xx semi-tones
    MIDI equivalent: Standard pitch bend
    Library routine: gemspitchbend
    Notes:

    Opcode: SFX Tempo
    Fields: - none -
    MIDI equivalent: MIDI Controller #70 = 0
    Library routine:
    Notes: Channel switches to 150 bpm

    Opcode: Start Sequence
    Fields: 0-127
    MIDI equivalent: MIDI Controller #82 = Sequence #
    Library routine: gemsstartsong
    Notes:

    Opcode: Sample Playback Rate
    Fields: Default/10.4/8.7/7.3/6.5/5.8/5.2
    MIDI equivalent: MIDI Controller #71 = 4/5/6/7/8/9/10
    Library routine:
    Notes: Reset to default by program change
When GEMS receives these CC over MIDI, it inserts the opcode selected. But you are right about IF statements and Mailboxes, there isn't a way to do this from MIDI. But I don't think this is needed just to make a normal song.
r57shell wrote: I can convert MIDI one channel into GEMS one channel, but it is headache convert channel by channel, and change instruments in different software, and then, mixing up all this together, and feeding it into Genesis emulator or hardware to hear how it sounds.
You could still send the MIDI data, all channels simultaneously, to GEMS.EXE which takes away most of the headache. It is still a headache editing patches to sound good in the song. I still have to change patch, save bank, export assembly, then rebuild my ROM to hear changes. What I mentioned in my first post is now I am using my TX81Z Yamaha synthesizer (YM2414, mostly compatible with 2612) to make patches and edit them while I work on the song so I only have to export patches one time. It has a "performance mode" which provides 8 channels multitimbral--you can make a whole song this way with up to 8 different sounds. I hear this is the way EA and Accolade, developers without official devkits, made music for Genesis. There is a tool, TXConvert, which loads VOPM *.OPM files and can convert them to the synthesizer's patch format, so I can use ripped Genesis patches from VGMs etc.

I also had the thought that if DefleMask had MIDI out, that would be good as well, but there is nothing you or I can do about that.
neologix wrote:If either of you can provide or otherwise point me to either the spec or reliable example preset files of this "Artec FM" and/or GEMS PAT format, I can add YM2612-to-GEMS preset dumping to VGM2Pre
This could be useful. I don't have any details on those formats, but it is what is referenced in the GEMS documentation. If you can get a hold of drx's original release of the GEMS kit (2.5 I think) there are .FM patch files included. If you need, I can take some time to take a "known" patch format and recreate it in the GEMS editor and save it, so you can compare differences.

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Thu Oct 16, 2014 6:06 pm

powerofrecall wrote:In fact if you try to send one channel at a time it'll split them into separate sequences.
How did they make songs then? I don't think that there was devices that was able to record and playback 16 channels MIDI, to send it into PC with DOS. May be they was using TWO PC?) One for sequencer, and second with GEMS.EXE running?

Honestly, It's very good news, that actually all things that you want can do GEMS.EXE
powerofrecall wrote:So I try to work the same way (put all music and sound into one MOD file).
My combiner looks for equal samples/patches and its result does not have duplicates. It was intended to work in this way, to make songs independable, and easy mixable.
powerofrecall wrote:I have also had luck using your vgmjuice to make a GEMS native patch and then copying the hex directly into pbank.asm.
My .gems files indeed internal binary format of patches.
powerofrecall wrote:I still have to change patch, save bank, export assembly, then rebuild my ROM to hear changes.
I have idea to make ROM where patch bank will be placed in SRAM, and you may change it with Patch Editor and hear differece.
powerofrecall wrote:I also had the thought that if DefleMask had MIDI out, that would be good as well, but there is nothing you or I can do about that.
Actually I can make DMF->MIDI or may be there is already such converter. I did MIDI->DMF... but there is again trouble with patches, you need to input them over and over again.
Image

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Thu Oct 16, 2014 7:49 pm

r57shell wrote: How did they make songs then? I don't think that there was devices that was able to record and playback 16 channels MIDI, to send it into PC with DOS. May be they was using TWO PC?) One for sequencer, and second with GEMS.EXE running?
Likely. In the early to mid 90s they may have either been using a DOS PC with a sequencer, or something like an Atari ST (well known for good MIDI support) or even a standalone sequencer or built-in sequencer some keyboards had. I know Yamaha was building standalone MIDI sequencers at the time, and "MIDI computers" (8 bit MSX computers designed for MIDI) but those were rare and mostly Japanese. Either way, they would have had something plugged into a standalone PC running GEMS.EXE
r57shell wrote: Honestly, It's very good news, that actually all things that you want can do GEMS.EXE
It's amazing that I can still use the software today. It is not the most convenient but it's a testament to GEMS that this is probably still the easiest way to make Genesis music even now.
r57shell wrote:I have idea to make ROM where patch bank will be placed in SRAM, and you may change it with Patch Editor and hear differece.
This is a good idea. I thought it would be interesting if the GEMS cartridge/parallel port hardware could be supported in an emulator. Dosemu has the ability to pipe parallel port data in and out of it just like it does MIDI as far as I can tell--it would be interesting to see if an emulator could be modified to work with this data and emulate the GEMS ROM and hardware.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Oct 16, 2014 10:04 pm

I've seen a number of schematics for a MIDI interface for the Atari 8-bit and C64. Cables could be bought from a number of places. Same for the Amiga, with even better software support. The ST had MIDI built in, so that was even bigger in the computer MIDI field. Many PC sound cards of that time could send/receive MIDI through the joystick port (all SoundBlaster Pro and better can do that) - you simply got a splitter cable that gave you a MIDI connector along with the joystick pass-through. And as mentioned, there were several companies making MIDI devices/keyboards.

So there was no shortage of ways to get MIDI at the time. It's probably harder NOW than then what with MIDI being kinda obsolete these days. Most mixing software these days go straight to uncompressed 24bit PCM or even floating point audio, with options for various compression schemes.

MintyTheCat
Very interested
Posts: 484
Joined: Sat Mar 05, 2011 11:11 pm
Location: Berlin, Germany

Post by MintyTheCat » Fri Oct 17, 2014 9:01 am

Chilly Willy wrote:I've seen a number of schematics for a MIDI interface for the Atari 8-bit and C64. Cables could be bought from a number of places. Same for the Amiga, with even better software support. The ST had MIDI built in, so that was even bigger in the computer MIDI field. Many PC sound cards of that time could send/receive MIDI through the joystick port (all SoundBlaster Pro and better can do that) - you simply got a splitter cable that gave you a MIDI connector along with the joystick pass-through. And as mentioned, there were several companies making MIDI devices/keyboards.

So there was no shortage of ways to get MIDI at the time. It's probably harder NOW than then what with MIDI being kinda obsolete these days. Most mixing software these days go straight to uncompressed 24bit PCM or even floating point audio, with options for various compression schemes.
True but it will not go obsolete as there as far too many musicians out there using older music equipment. The usual approach these days is to get a MIDI to USB cable. I use both standard MIDI cables and the USB converter and they work fine.

I even use an old Amiga MIDI box with my DX7 :)
UMDK Fanboy

powerofrecall
Very interested
Posts: 237
Joined: Fri Apr 17, 2009 7:35 pm
Location: USA

Post by powerofrecall » Fri Oct 17, 2014 2:30 pm

MIDI will never really die as long as there are electronic musicians and vintage synth enthusiasts out there. Like Minty said it's changed form a little--most MIDI these days is internal to a PC, or being sent over USB interfaces, but it's so widespread you'll never really be rid of it. :)

r57shell
Very interested
Posts: 478
Joined: Sun Dec 23, 2012 1:30 pm
Location: Russia
Contact:

Post by r57shell » Fri Oct 17, 2014 5:03 pm

I checked .PAT files...
Export some FM .PAT, then use some HexEditor, open my .gems file, and COPY whole .gems file EXCEPT FIRST BYTE, and overwrite (NOT INSERT) in .PAT from offset 1E, save it. You converted .gems yourself.
I'm lazy now, to make program for it.

To summarize format:
00: word - type of instrument (little endian)
02: name (looks like null terminated string)
19: unk (zero)
1E: instruement data (from offset 1 in .gems)
after instrument data until end of file - unknown (zeroes)
total size 0x50

I tried to check some things about GEMS.EXE, and I found it works glitchy in DOSBox. I don't know why, but TL, SL ... all inputs in Patch editor in lower part - is not visible until you click at it with mouse. It will start flickering, so you can actually see it, but when you focus on other things (with mouse) it will hide again. Also, I don't understand what is "initial download", and I didn't try MIDI or Serial port yet. To make it work, we need to find out how genesis must responsed to packets. I don't wanna look inside GEMS ROM now, may be later.
Image
Image

Post Reply