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>
@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