Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Joined: Jun 2001
Posts: 465
O
Senior Member
Offline
Senior Member
O
Joined: Jun 2001
Posts: 465
Oh yeah, the compression format is not trivial at all. DAC dumps would help a lot. Do you know if the 551 has a test mode, like yamaha synths do?

Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7
Yeah, I wrote about it a bit in the driver comments:

Code
	To access the test mode (not mentioned in the service manual):
	Hold the "Start/Stop" and keypad 0 buttons together when turning on the keyboard.
	Afterwards, press one of these buttons:
	- Tone: LCD test (press repeatedly)
	- Keypad 0: switch test (press all front panel buttons in a specific order, generally left to right)
	- Keypad 1 or Rhythm: pedal and key test
	- Keypad 2: ROM test
	- Keypad 4/5/6: sound volume test
	- Keypad 7/8: stereo test
	- Keypad 9: MIDI loopback test
	- Keypad + or Song Bank: power source test
	- Keypad -: pitch wheel test
	- FFWD: exit test mode
	- Stop: power off

I can post DAC captures of the test tone(s) and some other simple ones (i.e. the synth leads) along with the actual ROM data a little later.

Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7
https://revenant1.net/casio/5notetest.flac

Direct PCM bitstream captures of four instruments at A4 (Piano 1, E.Organ1, SynLead1, SynLead3) and the bass drum, all at maximum volume and velocity. The two synth leads have some built-in vibrato but are otherwise pretty basic waveforms. The output is clearly very oversampled (144.6 kHz, give or take a bit due to the crappy ceramic oscillator in this thing).

Initial register writes for each note:

Piano 1:
Code
[:maincpu:gt_sound] voice 0 sample start 0x079df0
[:maincpu:gt_sound] voice 0 sample end   0x07eabc
[:maincpu:gt_sound] voice 0 sample loop  0x07d3c4
[:maincpu:gt_sound] voice 0 cmd 0x200a (data = 08)
[:maincpu:gt_sound] voice 0 pitch 0x3fb5b0
[:maincpu:gt_sound] voice 0 cmd 0x6006 (data = 3e)
[:maincpu:gt_sound] voice 0 volume 120 rate 255

E.Organ1:
Code
[:maincpu:gt_sound] voice 0 sample start 0x08acec
[:maincpu:gt_sound] voice 0 sample end   0x08adac
[:maincpu:gt_sound] voice 0 sample loop  0x08acec
[:maincpu:gt_sound] voice 0 cmd 0x200a (data = 0b)
[:maincpu:gt_sound] voice 0 pitch 0x95e4bc
[:maincpu:gt_sound] voice 0 cmd 0x6006 (data = 3e)
[:maincpu:gt_sound] voice 0 volume 102 rate 255

SynLead1:
Code
[:maincpu:gt_sound] voice 0 sample start 0x0aa10a
[:maincpu:gt_sound] voice 0 sample end   0x0aa368
[:maincpu:gt_sound] voice 0 sample loop  0x0aa34a
[:maincpu:gt_sound] voice 0 cmd 0x200a (data = 0e)
[:maincpu:gt_sound] voice 0 pitch 0x2ed792
[:maincpu:gt_sound] voice 0 cmd 0x6006 (data = 1f)
[:maincpu:gt_sound] voice 0 volume 108 rate 68

SynLead3:
Code
[:maincpu:gt_sound] voice 0 sample start 0x0aa3ec
[:maincpu:gt_sound] voice 0 sample end   0x0aa50c
[:maincpu:gt_sound] voice 0 sample loop  0x0aa4dc
[:maincpu:gt_sound] voice 0 cmd 0x200a (data = 0e)
[:maincpu:gt_sound] voice 0 pitch 0x4af25e
[:maincpu:gt_sound] voice 0 cmd 0x6006 (data = 3e)
[:maincpu:gt_sound] voice 0 volume 104 rate 131

Bass drum:
Code
[:maincpu:gt_sound] voice 0 sample start 0x0aa6fc
[:maincpu:gt_sound] voice 0 sample end   0x0ab610
[:maincpu:gt_sound] voice 0 sample loop  0x0ab610
[:maincpu:gt_sound] voice 0 cmd 0x200a (data = 0c)
[:maincpu:gt_sound] voice 0 pitch 0x400000
[:maincpu:gt_sound] voice 0 cmd 0x6006 (data = 11)
[:maincpu:gt_sound] voice 0 volume 126 rate 255


One thing I noticed is that the looped portion of SynLead3 somewhat resembles a delta-encoded square wave (notice the two runs of zero-bytes):

Code
00 53 00 07 00 03 00 03 00 07 00 03 00 00 00 00 00 00 00 02 00 02 82 02 01 B3 01 FF 00 03 00 03 01 FF 00 03 00 00 00 00 00 00 00 02 00 02 7E 02

I'm not sure if all sounds have the same encoding/bit depth though (see the two unknown commands/registers in the log output for each note).

Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7
After doing some digging, I've found what I believe is the Casio patent describing the GT913 sample format:
JPH08101690A - Waveform reading device

Two compact floating-point DPCM formats are described in the patent; I believe the relevant one here is the second one, where a 16-bit word contains a 2-bit exponent delta and two 7-bit sample deltas (see figure 13), and the least significant bit of a sample address apparently addresses one of the individual sample deltas.

Figure 15 shows an additional 12-byte structure located at each sample's end address, containing five 16-bit sample values and five 3-bit exponent values. When a sample loops, the current output sample and exponent value are reloaded from one of the five respective values. This structure also exists at the end of each sample in the CTK-551 ROM (i.e. between the end of each sample and the start of the following sample).

I believe the lower 3 bits of the 0x200a command's parameter (see the debug logs in the last post) are also supposed to be the initial exponent value.

(Part of the description of both formats in this patent is also dedicated to describing a linear interpolation method for the decoded samples, but I'm not really concerned about that right now)

Possibly related: JPH07199996A - Device and method fo...ng and decoding device for waveform data, which appears to describe the process for actually encoding the same 16-bit packed format. (Google doesn't have the diagrams for this one for some reason, Espacenet and Global Dossier both do.)

Parsing the CTK-551 samples in this format seems to produce reasonable-looking delta values, but I'm having trouble trying to turn them back into uncompressed samples, and trying to grasp the correct behavior through Google's dodgy automatic translation is a bit of a pain in the ass.

Hopefully I'm on the right track here, though. I'd love to make some more progress on emulating this, but clearly I'm still missing something.

Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7
Also, for reference, a table of CTK-551 sample addresses and other info (incomplete instrument names, possible initial exponent value, etc): https://revenant1.net/casio/551samples.ods

Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7
Alright, problem solved! Time to start getting this driver to make some noise, I guess.

[Linked Image from i.imgur.com]

I think the older models with the OKI CPUs might use the 8-bit version of the format from these patents, but I don't really have a way to verify that right now. Still haven't looked any more into how the CTK-2100 does audio yet either.

2 members like this: R. Belmont, =CO=Windler
Joined: Jan 2021
Posts: 69
=
Member
Offline
Member
=
Joined: Jan 2021
Posts: 69
Do you need 4bit/8bit Casio rom dumps? Those Casios had various curves and sine waves in their roms, those may be lookup tables for envelopes and FM synth variants. The sample parts of 16bit ROMs (MT-540 etc.) has strange pops/glitches within samples, those likely control envelopes or such. According to patents, Casio used daisychained envelope structures with any numbers of section (not only ADSR/ADR or such) like a linked list, and was very proud of seamless interpolation between samples to avoid aliasing noise (seen in SK-1 patents).


MAY THE SOFTWARE BE WITH YOU!

{weltenschule.de}
Joined: Mar 2006
Posts: 1,060
Likes: 1
L
Very Senior Member
Offline
Very Senior Member
L
Joined: Mar 2006
Posts: 1,060
Likes: 1
I work under the assumption that the answer to "do you need xyz rom dumps" is always going to be "yes please".

LN


"When life gives you zombies... *CHA-CHIK!* ...you make zombie-ade!"
Joined: Jan 2021
Posts: 13
Likes: 7
R
Member
Offline
Member
R
Joined: Jan 2021
Posts: 13
Likes: 7


Volume envelopes are still kind of rough, but the rest is coming along. I'll probably clean it up a bit more after Thanksgiving.

4 members like this: Stiletto, R. Belmont, Duke, pmackinlay
Page 2 of 2 1 2

Link Copied to Clipboard
Who's Online Now
1 members (Pernod), 25 guests, and 3 robots.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,993
Posts118,154
Members5,005
Most Online890
Jan 17th, 2020
Forum Host
These forums are hosted by www.retrogamesformac.com
Forum hosted by www.retrogamesformac.com