So far so good.
My progress so far:
Moonsound sample Replayer
nice
I've started with the FM part now.
I wanna convert 1 instrument at a time, starting with the Acoustic Grand Piano
In the Linux driver I see this:
static const struct opl4_region regions_00[] = { /* Acoustic Grand Piano */ {0x14, 0x27, {0x12c,7474,100, 0,0,0x00,0xc8,0x20,0xf2,0x13,0x08,0x0}}, {0x28, 0x2d, {0x12d,6816,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x2e, 0x33, {0x12e,5899,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x34, 0x39, {0x12f,5290,100, 0,0,0x00,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x3a, 0x3f, {0x130,4260,100, 0,0,0x0a,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x40, 0x45, {0x131,3625,100, 0,0,0x0a,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x46, 0x4b, {0x132,3116,100, 0,0,0x04,0xc8,0x20,0xf2,0x14,0x08,0x0}}, {0x4c, 0x52, {0x133,2081,100, 0,0,0x03,0xc8,0x20,0xf2,0x14,0x18,0x0}}, {0x53, 0x58, {0x134,1444,100, 0,0,0x07,0xc8,0x20,0xf3,0x14,0x18,0x0}}, {0x59, 0x6d, {0x135,1915,100, 0,0,0x00,0xc8,0x20,0xf4,0x15,0x08,0x0}} };
So the first 2 bytes are the range, then comes the instrument number
So for range: 0x14, 0x27 it's best to use instrument 12c.
But my question is.. How do I translate this range into notes ?
0x14, 0x27 these are 19 notes.
Is this: C1 - F#2 ???
or is 0x00 C1 ?
Are you sure you're talking FM now? Sounds like you're talking ROM-samples.
FM-voices typically don't have a range like that, they're just full-range instruments by nature.
This table is indeed about the wavetable. The ranges mentioned are MIDI note numbers
Oh yeah, indeed I was looking at the Rom -samples.
The whole FM part is a completely different thing... I'm reading about it now.
static const struct opl4_region regions_0a[] = { /* Music Box */ {0x15, 0x6c, {0x0f3,3362,100, 0,0,0x00,0xb6,0x20,0xa6,0x25,0x25,0x0}}, {0x15, 0x6c, {0x101,4773,100, 0,0,0x00,0xaa,0x20,0xd4,0x14,0x16,0x0}} };
I don't really understand how this works.
This instrument, music box uses 2 samples.
The first sample ($f3) is an A#3 note and should be played from range 0x15, 0x6c
the second sample ($101) is a B2 note and should be played ALSO ?? from range 0x15, 0x6c
??
Can anyone elaborate on this ? I don't really understand when I should use which sample.
And is there anywhere some more documentation about the ROM-samples ?
Using the same part of a region for two different notes is not that strange (it's a range right?)
However indeed there are some samples that use parts of the region -at the same time- to create the sound. In the MIDI player of RoboPlay i use for example this part of code (based on the linux sequencer implementation) to determine the range(s):
uint8_t voices = 0; uint8_t i = 0; while(region[i].key_min != 0xFF) { if(note >= region[i].key_min && note <= region[i].key_max) { wave_data[voices] = ®ion[i].wave_data; if(++voices >= 2) break; } i++; }
Where 0xFF indicates the last line of every region, wave_data is the pointer the part after key min and max. Based on this up to 2 voices play based on a single note.
Alright.
So I have made a .wav file out of all the internal rom samples of the Moonsound cartridge.
325 samples in total.
Then I changed ALL these samples (with a pitch shifter) to their nearest C note.
From this point on I am able to use all these samplers in my DAW (I use Cubase, but as I mentioned earlier any DAW or Tracker is usable).
In a sense this is now a VST, usable in any DAW to make music with for the Moonsound's internal ROM samples.
Pretty cool, huh !?
At this point we can just start making songs in midi using these samples.
The midi file gets played back on the MSX.
I also took a few midi files online and tried playing them with the replayer.
After I opened the midi files in my DAW I first had to make a few small changes in the midi files.
One of those changes are replacing the instruments that the midi file uses with the instruments from the Moonsound's internal ROM.
Here are some midi files that I play back after I assign instruments to each track:
Aleste 2:https://www.youtube.com/watch?v=keUgGwfNdhI
Dragon Slayer 4:https://www.youtube.com/watch?v=LoA1aJysm9A
Spacemanbow:https://www.youtube.com/watch?v=jO07LCRdLXQ