Skip to content

Instantly share code, notes, and snippets.

@sonnm
Created October 16, 2019 08:51
Show Gist options
  • Save sonnm/a6378d2a4776edb5b1ede1dd3f1a29bb to your computer and use it in GitHub Desktop.
Save sonnm/a6378d2a4776edb5b1ede1dd3f1a29bb to your computer and use it in GitHub Desktop.
Convert GE200 preset file to GE 150
<?php
if (isset($_POST["submit"])) {
$content = file_get_contents($_FILES["file"]["tmp_name"]);
$array = unpack("C*", $content);
//print_r($array);
$effectModule = [];
//FX/COMP 541 - 548
$effectModule['FX/COMP']['TYPE'] = $array[541] - 1;
$effectModule['FX/COMP']['SWITCH'] = $array[542];
$effectModule['FX/COMP']['Data']['ATTACK'] = $array[543];
$effectModule['FX/COMP']['Data']['THRES'] = $array[544];
$effectModule['FX/COMP']['Data']['RATIO'] = $array[545];
$effectModule['FX/COMP']['Data']['LEVEL'] = $array[546];
//DS/OD 549 - 556
$effectModule['DS/OD']['TYPE'] = $array[549] - 1;
$effectModule['DS/OD']['SWITCH'] = $array[542];
$effectModule['DS/OD']['Data']['VOLUME'] = $array[551];
$effectModule['DS/OD']['Data']['TONE'] = $array[552];
$effectModule['DS/OD']['Data']['GAIN'] = $array[553];
//AMP 557 - 564
$effectModule['AMP']['TYPE'] = $array[557] - 1;
$effectModule['AMP']['SWITCH'] = $array[558];
$effectModule['AMP']['Data']['GAIN'] = $array[559];
$effectModule['AMP']['Data']['BASS'] = $array[560];
$effectModule['AMP']['Data']['MID'] = $array[561];
$effectModule['AMP']['Data']['TREBLE'] = $array[562];
$effectModule['AMP']['Data']['PRES'] = $array[563];
$effectModule['AMP']['Data']['MST'] = $array[564];
//CAB 565 - 572
$effectModule['CAB']['TYPE'] = $array[565] - 1;
$effectModule['CAB']['SWITCH'] = $array[566];
$effectModule['CAB']['Data']['TUBE'] = $array[559];
$effectModule['CAB']['Data']['MIC'] = $array[567];
$effectModule['CAB']['Data']['CENTER'] = $array[568];
$effectModule['CAB']['Data']['DISTANCE'] = $array[569];
//NS GATE 573 - 580
$effectModule['NS GATE']['TYPE'] = $array[573] - 1;
$effectModule['NS GATE']['SWITCH'] = $array[574];
$effectModule['NS GATE']['Data']['ATTACK'] = $array[575];
$effectModule['NS GATE']['Data']['RELEASE'] = $array[576];
$effectModule['NS GATE']['Data']['THRES'] = $array[577];
//DELAY 597
$effectModule['DELAY']['TYPE'] = $array[597] - 1;
$effectModule['DELAY']['SWITCH'] = $array[598];
$effectModule['DELAY']['Data']['LEVEL'] = $array[599];
$effectModule['DELAY']['Data']['SUB-D'] = $array[604];
$effectModule['DELAY']['Data']['TIME'] = @array_shift(unpack('S*', $content[862] . $content[863]));
$effectModule['DELAY']['Data']['FEEDBACK'] = $array[600];
//REVERB 605
$effectModule['REVERB']['TYPE'] = $array[605] - 1;
$effectModule['REVERB']['SWITCH'] = $array[606];
$effectModule['REVERB']['Data']['PRE DELAY'] = $array[607];
$effectModule['REVERB']['Data']['LEVEL'] = $array[608];
$effectModule['REVERB']['Data']['DECAY'] = $array[609];
$effectModule['REVERB']['Data']['TONE'] = $array[610];
//EQ 581
$effectModule['EQ']['TYPE'] = $array[581] - 1;
$effectModule['EQ']['SWITCH'] = $array[582];
if ($effectModule['EQ']['TYPE'] == 1) {
$effectModule['EQ']['Data']['80Hz'] = 16 + ($array[583] - 12);
$effectModule['EQ']['Data']['240Hz'] = 16 + ($array[584] - 12);
$effectModule['EQ']['Data']['750Hz'] = 16 + ($array[585] - 12);
$effectModule['EQ']['Data']['2.2KHz'] = 16 + ($array[586] - 12);
$effectModule['EQ']['Data']['6.6KHz'] = 16 + ($array[587] - 12);
} elseif ($effectModule['EQ']['TYPE'] == 2) {
$effectModule['EQ']['Data']['100Hz'] = 16 + ($array[583] - 12);
$effectModule['EQ']['Data']['200Hz'] = 16 + ($array[584] - 12);
$effectModule['EQ']['Data']['400Hz'] = 16 + ($array[585] - 12);
$effectModule['EQ']['Data']['800Hz'] = 16 + ($array[586] - 12);
$effectModule['EQ']['Data']['1.6KHz'] = 16 + ($array[587] - 12);
$effectModule['EQ']['Data']['3.2KHz'] = 16 + ($array[588] - 12);
}
//MOD 589 - 596
$effectModule['MOD']['TYPE'] = $array[589] - 1;
$effectModule['MOD']['SWITCH'] = $array[590];
$effectModule['MOD']['Data']['LEVEL'] = $array[592];
$effectModule['MOD']['Data']['DEPTH'] = $array[593];
$effectModule['MOD']['Data']['RATE'] = $array[591];
$presetName = ucwords(preg_replace('/[^A-Za-z0-9\-]/', '', (trim(substr($content, 524, 16)))));
$fileInfo = [
'app' => 'GE150 Edit',
'app_version' => 'V1.1.0',
'device' => 'MOOER GE150',
'preset_name' => $presetName,
'schema' => 'GE150 Preset',
'device_version' => 'V1.1.0',
];
header('Content-disposition: attachment; filename=' . $presetName . '.mo');
header('Content-Type: application/json');
echo json_encode([
'effectModule' => $effectModule,
'Exp' => [
'VOL_MIN' => 0,
'FUN_SWITCH' => 0,
'VOL_MAX' => 100,
'PARA_CTRL' => 1,
'MODULE_CTRL' => 0,
'VOL_SWITCH' => 0,
],
'fileInfo' => $fileInfo,
]);
exit();
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>GE200 TO GE150</title>
</head>
<body>
<form action="" method="post" enctype="multipart/form-data">
<input type="file" name="file">
<input type="submit" value="Submit" name="submit">
</form>
</body>
</html>
@kleinerbaer1970
Copy link

Hey, great "tool" so far.

I think, I have encounterd an small error:
In the CAB section, the value for TUBE is taken from AMP Gain $array[559].

@JetroDamaso
Copy link

How do I use this?

@sidekickDan
Copy link

Thanks! Seems like it's working with a mo file for converting from ge200 format to ge150 :) Now i'm going to try the files :)

@sidekickDan
Copy link

@Rembx Because it's a php file, you'd have to upload it to a n apache web hosting server that you can access from a url, or you could install a virtual server like xampp to your computer and run it from there on localhost.

@sidekickDan
Copy link

@sonnm Thanks for the code! I was able to add it to a web page and make it more user friendly. I gave credits and links to your mooer gist and github profile. I put the working page up at http://uxredesigner.com/mooer.php and have the github repo over at https://github.com/sidekickDan/mooerMoConvert . Let me know what you think :) The code seems to work great when converting GE200 presets into the GE150.

@sonnm
Copy link
Author

sonnm commented Jan 5, 2022

@sidekickDan It looks great! Thank you for hosting it and credit me also 👍

@sidekickDan
Copy link

@sonnm Thanks! Oh i wanted to ask you. How did you figure out how to read the GE200 .mo files so as to know how to convert it to the GE150 format? I can open the converted files and read the text with no issues. They also seem to convert the data to the preset correctly. But if i try to open the original mo files for the GE200 or the GE150, it looks all encoded. Is there an editor or tool that you used to read the original files? Thanks! :)

@Nezza42
Copy link

Nezza42 commented Jan 17, 2022

Stumbled on this thread after Googling how to use GE200 presets on a GE150. Wow, what you've done @sonnm is awesome!
And the Web page you created @sidekickDan works like a charm. I had a bunch of 8 GE200 presets that now work great in my GE150.

Thanks for your efforts :)

Would either of you object to my posting the link to the Converter on some Facebook groups I belong to? I'm sure others will find this just as useful as I am?

Cheers
Nezza

@sidekickDan
Copy link

@Nezza42 Hey Nezza! Glad you liked it and it worked! @sonnm did a great job with the core functionality! I duplicated the site on aws and picked up a cheap domain name if you want to share it. It should be hosted now at https://mooereffects.cloud . Let me know if it still works for you ok. I wouldn't mind knowing if others found it useful too. I just got the GE150 and really like it! Thanks! :)

@Nezza42
Copy link

Nezza42 commented Jan 21, 2022

Thanks for the reply. I've tried the converter at https://mooereffects.cloud & it works just fine.
I'll let you know if I get any response from others.
Cheers

@Guita14336
Copy link

Thanks to the developer it helped me a lot

@pedromagalhaess
Copy link

Is there a way to convert to GE 300?
Convert from GE200, GE 250 to GE 300?

@BetoWesker
Copy link

Is there a way to convert to GE 300? Convert from GE200, GE 250 to GE 300?

I'd like that too :(

@Guita14336
Copy link

Guita14336 commented Jan 8, 2023 via email

@BetoWesker
Copy link

I want to know how to convert .mo files from ge200, ge250 to ge300. The problem is I'm a newbie but I want to learn. Now the problem to transform this code to my need I have to understand at least how to interpret the hexadecimal code at least, isn't? But for these I will know what changes will do this and that in the columns and in its corresponding binary code for the Mooer Ge300 ... That would take me ages! and besides I don't have a ge200 so how I can figure out a .mo code like that? :/ Does someone has some technical documentation (yeah like real tech stuff) on how these presets are organized in code, to understand them? Please? Even more than 10 years ago one guy made a converter for old Digitech RPs (reading the hexadecimal values and binaries and just that) and you can even visualize old gnx pedalboard patches. It was wild. My thinking is if nobody wants to do it at least I want to at least try to do it... So anyway, can anyone please share some insight please in those .mo code or some documentation?

@pedromagalhaess
Copy link

pedromagalhaess commented Jan 10, 2023 via email

@BetoWesker
Copy link

without at least some documentation about the .mo file code I doubt it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment