Page 2 of 3

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sat Mar 31, 2018 7:47 pm
by Sonus
Rasputin wrote:Did you do that via the MT jack decoder tool, or actually decode the SysEx?
By decoding sysex with a combination of command-line tools:

•sfk partcopy: extract the 128 sample data blocks
•copy /b command: merge blocks into 32k file
•denibblize tool: from 32k to 16k file
•sox: raw sample data to wav

All-in-one it takes 15 sec.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sat Mar 31, 2018 8:17 pm
by Rasputin
Sonus wrote:By decoding sysex with a combination of command-line tools:

•sfk partcopy: extract the 128 sample data blocks
•copy /b command: merge blocks into 32k file
•denibblize tool: from 32k to 16k file
•sox: raw sample data to wav

All-in-one it takes 15 sec.
That's genius. Would you be willing to share your batch file here? Also, think you can reverse that process by a similar manner?

If so, if someone can create a MIDI-OX script to automate the capture handshake then I think that would pretty much be a total win.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sun Apr 01, 2018 11:12 am
by Sonus
Rasputin wrote:Would you be willing to share your batch file here?
Please check PM for tools.
Rasputin wrote:Also, think you can reverse that process by a similar manner?
Could you test this file?
https://ufile.io/8ve44

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sun Apr 01, 2018 5:41 pm
by Rasputin
Sonus wrote:
Rasputin wrote:Also, think you can reverse that process by a similar manner?
Could you test this file?
Sad to report that it did not work.

The transfer worked fine--it did not end prematurely--but the resulting sample pads are empty. I know that the RZ-1 nulls out the sample memory if it detects something invalid**, so there may be a special byte needed at the end. I will look into this to see if it is applicable to the non-loading issue at hand.

** for the curious minded, there are also certain checks at boot to see if there are invalid data such as out-of-range tempo, etc. and the RZ-1 will reinitialize all battery backed RAM space if this is found to be the case

Here is how to calculate the needed byte. It's important to note that this byte replaces what would be the last sample byte entirely, and is not just tacked onto the end of the wave data.

Last byte in sample RAM (before turning into high/low nibble bytes) -- these would be the final two bytes directly before F7 when in SysEx form:

bit 0~4 = unused; all must be 0 or sample RAM will reinitialize on boot -- if bit 0, 1, 2, 3, or 4 are set then configuration is corrupt
bit 5 = SAMPLE 1~4 linked (must be exclusively set); hexcode of $20
bit 6 = SAMPLE 3+4 linked (can be mutually set w/ bit 7); hexcode of $40
bit 7 = SAMPLE 1+2 linked (can be mutually set w/ bit 6); hexcode of $80

SAMPLE 1+2 paired and SAMPLE 3+4 paired = hexcode of $C0
SAMPLE 1, 2, 3 and 4 are not linked (each pad independent) = hexcode of $00

Odd technical minutiae regarding the RZ-1 sampling feature:

Sample pads 1, 2, and 3 all hold the same amount of sample data. Sample pad 4 actually holds slightly less than any of the other pads, so it ends up being imperceptibly shorter than the rest -- about 2 samples fewer. The last couple bytes of sample RAM are used to hold general data instead of sample points.

Edit: This was indeed the issue. Changed both bytes before the F7 to $00 (re-nibbilizes to $00), enabling all sample pads to sound separately.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sat Apr 07, 2018 9:21 am
by Sonus
Cool! Last byte in sample RAM, 50μs:

Image

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 19, 2018 8:50 pm
by Rasputin
Just stayed up for about 20 hours straight working on this...

https://mega.nz/#!HRcFiCKD!bEY45fINIa22 ... MN-iaH2hqk

These utilities are for converting back-and-forth between Casio RZ-1 MIDI SysEx sample dumps and wave files. Now you can sideload samples without the MT port and without tons of manual hacking. Yay!

Huge thanks to Sonus for giving me a leg up, cluing me in, and helping to test! :thumbsup:
And yes, I stole and hacked up some of his code, so hopefully it's all cool. Faux pas?

If anyone notices any bugs or can think of anything that should be added or corrected, let me know. Windows only, sorry, but there are enough ways of running Windows executables on other platforms, so it's not worth the effort to port anything.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Fri Apr 20, 2018 8:31 am
by madtheory
Soooooo coooool! Nice work guys well done.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Wed Apr 25, 2018 6:35 am
by gmeredith
Now that you've got that done, you can do a memory expansion mod for the RZ and load it up with samples to the hilt! You should be able to do a 16x sample bank expansion with the SRAM chips that are commonly available - that would give you 64 samples! I've done this mod to a Casio SK-8 as well as other samplers - it would be the closest thing to the RZ. Here's my guide for the SK-8:

http://www.warningwillrobinson.com.au/i ... ansion.htm

You could simply adapt it to the RZ. If I owned an RZ I would make a DIY expansion guide for everyone. Anyone want to sell me an RZ-1?? Need to be 240V though.

Here is my 16x expansion for an MMT8 of mine. I simply replaced the 2 SRAM stock chips with larger chips and rerouted the extra memory lines to a selector switch:

Image

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Wed Apr 25, 2018 8:51 am
by Rasputin
gmeredith wrote:Now that you've got that done, you can do a memory expansion mod for the RZ and load it up with samples to the hilt!

You could simply adapt it to the RZ. If I owned an RZ I would make a DIY expansion guide for everyone. Anyone want to sell me an RZ-1?? Need to be 240V though.
Yes, very cool!

I just created a couple tools to facilitate the creation of custom sound EPROMs for the RZ-1 as well, so I will be publishing them in a few days to a few weeks. I just want to build up a little library of example sounds and what not first so that people have something to go on.

It's fairly easy to make a selectable bank of 4 separate kits, so if mixed and matched with selectable banks of sample RAM then the RZ-1 would be jam packed with goodness!

In my best Superman-overcoming-Kryptonite-weakness voice: "Noooooot.... enouuuuuugh..... tiiiiiiime!" :lol:

Too many projects. Too many.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 26, 2018 12:29 am
by gmeredith
Too many projects
Yes, I know the feeling :oops:

There is a ROM expansion already made for the RZ called the RZ Plus.



http://r-massive.cellarseer.com/casio-r ... om-hacking


Also, have you seen this:

http://r-massive.cellarseer.com/casio-r ... re-hacking

Down the bottom of the page it mentions a virtual RZ! I downloaded the files. I think it runs under a MAME Emulator. I'll try it :)

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 26, 2018 3:04 am
by Rasputin
gmeredith wrote:Down the bottom of the page it mentions a virtual RZ! I downloaded the files. I think it runs under a MAME Emulator. I'll try it :)
Yes, but you'll probably need to compile the most recent MAME build yourself because the RZ-1 is a new driver and is being updated still.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 26, 2018 5:00 am
by gmeredith
Yes I imagined half as much :roll:

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 26, 2018 5:12 am
by Rasputin
gmeredith wrote:Yes I imagined half as much :roll:
I don't know if the eyeroll was in reference to (unintentional) condescension or the rigamarole of compiling (and boy, is it a dry activity!) but MAME can be daunting to some. :dontknow:

Whenever I see MinGW, Cygwin, or the like involved, I cry a little on the inside. :lol:

Zero fun.

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Thu Apr 26, 2018 6:18 am
by gmeredith
Yes, the eye roll was a "why is everything in life such a complicated process" whinge :lol:

I'll get over it!

Re: Casio RZ-1 System Exclusive (SysEx) Implementation

Posted: Sat Apr 28, 2018 3:52 pm
by Rasputin
gmeredith wrote:

http://zine.r-massive.com/casio-rz-1-firmware-hacking

Down the bottom of the page it mentions a virtual RZ! I downloaded the files. I think it runs under a MAME Emulator. I'll try it :)
You'll probably want this Casio RZ-1 MAME ROM pack instead. The previously mentioned ROMs are correct, but they aren't "MAME ready" without renaming and zipping in a particular way.