Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bittboy builds? #75

Open
purelygrey opened this issue Feb 8, 2024 · 41 comments
Open

Bittboy builds? #75

purelygrey opened this issue Feb 8, 2024 · 41 comments

Comments

@purelygrey
Copy link

Hello! I use LGPT on Powkiddy V90 and I use the Bittboy build for it. I build the 1.3o_2 myself and I've been running my projects on it for a bit and everything seems to work just fine.

What's required to bring Bittboy builds back? I've read they were dropped because of lack of testers, what kind of testing is needed?

Also to everyone involved -- fantastic job!

@djdiskmachine
Copy link
Owner

Hey thanks for showing some love to the Pig! =)
I can attach a Bittboy build later this evening if you care to try it out =)

@djdiskmachine
Copy link
Owner

Here you go.
Things to keep an eye out for is save as functionality which should be OK with the latest build.

If you have any recommendations for mappings, config that makes it run nicer please attach as a reply here and I'll include them in the official build. I don't have a device to test it myself. =)
LGPT-BITTBOY-1.3o_2.zip

@djdiskmachine
Copy link
Owner

Omg I'm so sorry I didn't read you already built it yourself, way to go!
If you feel it works good I can just update the release with this as well ^_^

The lack of testers was due to not being aware of anyone that could find any issues for this specific platform and describe steps on how to reproduce, very happy to have you :)
Please join the Discord if you want to discuss further. Cheers!

@purelygrey
Copy link
Author

Omg I'm so sorry I didn't read you already built it yourself, way to go! If you feel it works good I can just update the release with this as well ^_^

The lack of testers was due to not being aware of anyone that could find any issues for this specific platform and describe steps on how to reproduce, very happy to have you :) Please join the Discord if you want to discuss further. Cheers!

It's alright, thank you though :) I tested Save As on my tracks, it works fine, so far I couldn't break this build in any way, should be safe enough to include in the release. Will do my best to report any issues from now on.

As for mappings/etc the defaults should be fine for now.

I actually have a pretty nice setup on the V90 (it has a "function" button which I use as shoulder button along with select) but it's hacky and I haven't tested the non-hacky way on the latest firmware. Even after I figure that out it'd be better to put it on a wiki or make a separate build for it since the Bittboy build also should work for Q90 (which is horizontal) and, well, Bittboy :D

Sorry not really a Discord guy, but I might swing by sometime later. Thanks again!

@djdiskmachine
Copy link
Owner

Jolly good, thanks a lot for checking in and trying it out 🥰
Alright you do you, Discord sure isn't for everyone :)
Nice work with the mapping, that sounds comfortable :)

I'll try to do some more work on the coding side in a few weeks when I feel up to it again, right now I'm enjoying making music with 🐷
All the best!

@lucian2599
Copy link

For Powkiddy V90 I made a package without building.
I used the binaries from RG35xx (lgpt and j2k.so).
I had to put them in root folder (outside of bin), to recognize the samplelib folder.
LittleGPTracker.sh moved there too.
Then updated the path in LittleGPTracker.sh : progdir=$(dirname "$0")
This is my config.xml with V90 key mappings (I prefer A-B reversed):



<KEY_A value="key:0:left alt" />
<KEY_B value="key:0:left ctrl" />
<KEY_LEFT value="key:0:left" />
<KEY_RIGHT value="key:0:right" />
<KEY_DOWN value="key:0:down" />
<KEY_UP value="key:0:up" />
<KEY_LSHOULDER value="key:0:tab" />
<KEY_RSHOULDER value="key:0:backspace" />
<KEY_START value="key:0:return" />


@ploupipoulpi
Copy link

Hi guys, not a discord person either but I am using LGPT on the v90. Not sure which build I have that works but it sure is the last one. I found mine on an SD image from a youtube video and changed stuff here and there to make it work on my 1.3.3 cfw.

In any case, I'll try this new one, thanks a lot! I agree it would be nice if the v90 had its official build. Happy to report anything if that helps.

@ploupipoulpi
Copy link

What an improvement from the older version. Congratulations on the good work, and thanks.
I didn't have to do anything besides a config xml for folders and a&b swapping.
I tried it on my stable CFW 1.3.3 on a v90, will try it on the 2.0.0 soon.

I'll come back with more feedback after I spend some time using and abusing it.
Once again, a thousand thanks for keeping this alive and making it even better.

@djdiskmachine
Copy link
Owner

Hello!
I'm setting up workflows for automated builds, please attach any configs that you'd like included with Bittboy builds and I'll add them to the workflows. :)
Cheers!

@purelygrey
Copy link
Author

I think the defaults are fine for now. There's enough latency to make it unusable for DJing but I couldn't make it better through configuration on the Bittboy build, not sure why. I love using menu button for screen navigation, it's so much better than going for shoulder buttons all the time, however the setup I use doesn't really work out of the box with the V90 CFW due to menu button hotkey combinations not registering, if that gets fixed someday I'll do a PR separately or something else. Maybe @ploupipoulpi has some ideas (glad to see another v90 enjoyer :-) )

@ploupipoulpi
Copy link

for now I only see the config switching a and b for the v90 that would be nice.
the different button layouts are there: TriForceX/MiyooCFW#274 if that's helpful

For navigation I already have muscle memory from LSDJ with select+dpad and I even prefer using the shoulder button on the v90 to the point that I might remap R1 to select for LSDJ. I wouldn't personally use the menu button for that also because I don't like its clickyness on the v90. Although I'm interested in your hacky way purelygrey, for science.
Other than that, it works out of the box if the folders are in the right place.

I just finished a shell/python script for color theme selection at startup but I need more themes with the new available colors and I realized that I forgot the row number selection so I'll add that as well.

I'm adding a "music" tab in gmenu2x on my v90 with things like GMU, LGPT and direct links to LDSJ and other chiptune roms, if you have any logo or any visual besides the pixelated piggy let me know, if you're interested in that setup I can share what I'm using.

I haven't finished the "one text file" manual but if I can finish it soon we could add that, as it can then be made available in gmenu on the LGPT link (Y for manual on a link if it exists), that would be nice in a v90 build for Miyoo CFW.
I also tried to make something sexier than a text file but failed (for now).

Finally, it would be great if an official LGPT build was listed in the the Miyoo CFW ports.

I put the LGPT directory in /mnt/apps with everything in it, but for sample management, one might prefer have the project and sample directories directly on the main. I don't know what the best "default" would be.

In the package we could also add the link for Gmenu2x

title=LGPT
description=Little Piggy
exec=/mnt/apps/LGPT/lgpt-bittboy.elf
manual=/mnt/apps/LGPT/lgptmanual.txt

Thanks again for all the work, I'm moving pretty slow on this but making progress. I hope I can contribute a little to the piggy community.

@purelygrey
Copy link
Author

purelygrey commented Jul 1, 2024

For navigation I already have muscle memory from LSDJ with select+dpad and I even prefer using the shoulder button on the v90 to the point that I might remap R1 to select for LSDJ. I wouldn't personally use the menu button for that also because I don't like its clickyness on the v90. Although I'm interested in your hacky way purelygrey, for science.

Here goes, for science! @djdiskmachine you can disregard everything below

Same here about lsdj, I'd actually prefer to have a single select button for everything, but that only works on vertical handhelds. And yeah you're right I completely forgot that I modded my V90 with a piece of foam to dampen the annoying menu button microswitch 😀 it's an easy fix, get some EVA or some sort of soft foam and put it inbetween the switch and the button, makes it a lot better even if you won't use it for LGPT

I haven't updated to the official 2.0.0 release yet, I used the betaalpha when it was around. I only use my V90 for Piggy, mine boots straight to LGPT and shutdowns on exit. The 2.0.0 beta made it possible to turn off constant disk checks on unclean shutdown, and I haven't had any problems with flipping a switch yet, it should be pretty safe, I don't think Piggy writes to disk unless you are loading a sample/saving the project or if logging is turned on. It feels very gameboy-ish to just flick a switch to turn it off.

/autoexec.sh (I have LGPT files in the root of the MAIN partition, sleep 0.5 is a hack so the v90 has enough time to redraw the screen after bootlogo, cd'ing to mnt is needed for Piggy to see the folders in MAIN):

#!/bin/bash
sleep 0.5

cd mnt
./lgpt.elf &

program_pid=$!

while kill -0 "$program_pid" >/dev/null 2>&1; do
   sleep 1
done

poweroff

However as I mentioned Menu button is used as a system hotkey modifier in MiyooCFW and there's no fallthrough for it, I mean even when system hotkeys are turned off through a config file they do not register at all in LGPT, they just do nothing. A dirty fix for that is to set device type to Q90 instead of V90, so the system hotkey is on R2, and menu button is free for application hotkeys. Didn't have any problems with that as well so far

Part of config.xml with folder paths and menu button (Q90 firmware):

<ROOTFOLDER value="/mnt/PROJECTS"/>
<SAMPLELIB value="/mnt/SAMPLES"/>

<KEY_UP value="key:0:up" />
<KEY_DOWN value="key:0:down" />
<KEY_LEFT value="key:0:left" />
<KEY_RIGHT value="key:0:right" />
<KEY_A value="key:0:left alt" />
<KEY_B value="key:0:left ctrl" />
<KEY_LSHOULDER value="key:0:escape" />
<KEY_RSHOULDER value="key:0:right alt" />
<KEY_START value="key:0:return" />

@ploupipoulpi
Copy link

ploupipoulpi commented Jul 7, 2024

Hi guys, @purelygrey @djdiskmachine
I completed the script for theme selection.
I hardcoded the controls in python, and it works fine on the v90

Anyone willing to test in on a v90 (I haven't tried it on the 1.3.3, only on 2.0 beta2) or another device?
I probably need to adapt it to test for device and change controls.
Currently it captures "A or Start", "B" and the DPAD. For the v90 A is LALT and B LCTRL, start is "Enter".

How it works: you create a folder named "themes" in which you put individual themes XML with the following :

You can have many different themes in the folder, it's going to list them based on file name.

Script will display a menu that allows to select a theme based on its name with up/down and to modify the "Altrownumber" with left/right. Default sets the value to what is in the theme xml.

Selecting a theme and pressing A applies the theme to the config.xml

Only caveat is that it is pretty important to respect the syntax exactly (space included) in the config.xml and individual themes xml.

If you want to test this script please let me know and I'll prepare a zip with everything inside.
If you want me to adapt the script for a specific device, let me know and I can look it up but I'll need someone to test it.
It will run for sure on any device under Miyoo CFW firmware (again, only 2.0 beta2 tested currently) with maybe the need to modify key detection based on device model.

Now making themes can be a pain with the new colors, so I'm updating the theme creator page ( http://poyo.co/lgpt/ don't know the owner, downloaded the code and messed with it locally). My current local version has all the new colors, but they're not set up to display in the example yet. It will allow the export of properly formatted individual themes for the theme selector script.

I'll have a local working version soon, however @djdiskmachine can you confirm exactly what the colors do now between hicolor, cursorcolor, and songview ones? It would be easier for me to update the tool.

Here's the code for the theme selection script for the v90, still need to clean a few things up but it's enough for testing purposes (note: half of the credit goes to chatGPT which was very helpful for making this work):

#!/bin/busybox sh

# Initialize variables
themes_folder="/mnt/apps/LGPT/themes"
config_file="/mnt/apps/LGPT/bin/config.xml"

# Check if themes directory exists
if [ ! -d "$themes_folder" ]; then
    echo "Themes directory not found: $themes_folder"
    exit 1
fi

theme_files=$(ls $themes_folder/*.xml 2>/dev/null)
if [ -z "$theme_files" ]; then
    echo "No theme files found in: $themes_folder"
    exit 1
fi

names=""
index=0

# Load theme names and associated paths
for theme_file in $theme_files; do
    theme_name=$(basename "$theme_file" .xml)
    eval "names_$index=\"$theme_name\""
    eval "paths_$index=\"$theme_file\""
    index=$((index + 1))
done
num_items=$index

# Generate the Python script for the menu
cat << 'EOF' > menu.py
import os
import re
import keyboard

names = [
EOF

# Append names array to the Python script
index=0
while [ $index -lt $num_items ]; do
    eval "name=\$names_$index"
    echo "    \"$name\"," >> menu.py
    index=$((index + 1))
done

cat << 'EOF' >> menu.py
]

paths = [
EOF

# Append paths array to the Python script
index=0
while [ $index -lt $num_items ]; do
    eval "path=\$paths_$index"
    echo "    \"$path\"," >> menu.py
    index=$((index + 1))
done

cat << 'EOF' >> menu.py
]

row_numbers = ["default"] * len(names)

def print_menu(selected_index):
    os.system('clear')
    print("\033[?25l", end="")  # Hide cursor
    print("\033[32;40m░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\033[0m")
    print("\033[32;40m▒▒▒     LGPT THEME CONFIGURATION     ▒▒▒\033[0m")
    print("\033[32;40m▓▓▓     ▲ ▼ scroll    ◀ ▶ ALTROW     ▓▓▓\033[0m")
    print("\033[32;40m▒▒▒   A to update config B to quit   ▒▒▒\033[0m")
    print("\033[32;40m░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░\033[0m\n")
    print("\033[32;40m-                                      -\033[0m\n")
    for i, name in enumerate(names):
        if i == selected_index:
            row_number = row_numbers[i]
            print(f"\033[30;42m   -{name}   -ROW#: {row_number}\033[0m")
        else:
            print(f"\033[32;40m   -{name}\033[0m")

def parse_xml(filepath):
    with open(filepath, 'r') as file:
        content = file.read()
    data = {}
    keys = ["BACKGROUND", "FOREGROUND", "HICOLOR1", "HICOLOR2", "SONGVIEW_FE", "SONGVIEW_00", "CURSORCOLOR", "ROWCOLOR1", "ROWCOLOR2", "ALTROWNUMBER"]
    for key in keys:
        pattern = re.compile(rf'<{key} value\s*=\s*"([^"]+)"\s*/>')
        match = pattern.search(content)
        if match:
            value = match.group(1)
            data[key] = value
            print(f"Found {key} in theme: {value}")  # Debug statement for found values
    return data

def update_config(selected_index):
    config_path = "/mnt/apps/LGPT/bin/config.xml"
    theme_path = paths[selected_index]
    row_number = row_numbers[selected_index]

    # Parse the selected theme XML
    theme_data = parse_xml(theme_path)

    # Read the config file
    with open(config_path, 'r') as file:
        config_content = file.read()

    # Update config values based on the selected theme
    for key, value in theme_data.items():
        if value:
            start_tag = f'<{key} value="'
            end_tag = '" />'
            start_idx = config_content.find(start_tag)
            if start_idx != -1:
                start_idx += len(start_tag)
                end_idx = config_content.find(end_tag, start_idx)
                if key == "ALTROWNUMBER" and row_number != "default":
                    value = row_number
                config_content = config_content[:start_idx] + value + config_content[end_idx:]
                print(f"Updated {key} in config to {value}")  # Debug statement for updates

    # Write back the updated config
    with open(config_path, 'w') as file:
        file.write(config_content)

def main():
    selected_index = 0
    previous_index = -1
    print_menu(selected_index)

    while True:
        if keyboard.is_pressed('up'):
            if selected_index > 0:
                if previous_index != -1:
                    row_numbers[previous_index] = "default"
                previous_index = selected_index
                selected_index -= 1
                print_menu(selected_index)
            while keyboard.is_pressed('up'):
                pass
        elif keyboard.is_pressed('down'):
            if selected_index < len(names) - 1:
                if previous_index != -1:
                    row_numbers[previous_index] = "default"
                previous_index = selected_index
                selected_index += 1
                print_menu(selected_index)
            while keyboard.is_pressed('down'):
                pass
        elif keyboard.is_pressed('left'):
            if row_numbers[selected_index] == "default":
                row_numbers[selected_index] = "9"
            elif row_numbers[selected_index] == "1":
                row_numbers[selected_index] = "default"
            else:
                row_numbers[selected_index] = str(max(1, int(row_numbers[selected_index]) - 1))
            print_menu(selected_index)
            while keyboard.is_pressed('left'):
                pass
        elif keyboard.is_pressed('right'):
            if row_numbers[selected_index] == "default":
                row_numbers[selected_index] = "1"
            elif row_numbers[selected_index] == "9":
                row_numbers[selected_index] = "default"
            else:
                row_numbers[selected_index] = str(min(9, int(row_numbers[selected_index]) + 1))
            print_menu(selected_index)
            while keyboard.is_pressed('right'):
                pass
        elif keyboard.is_pressed('enter') or keyboard.is_pressed('alt'):
            os.system('clear')
            update_config(selected_index)
            print(f" ")
            print(f"Theme '{names[selected_index]}' selected - LGPT config updated.")
            os.system('sleep 2')  # Delay using sleep command if available
            break
        elif keyboard.is_pressed('ctrl'):
            os.system('clear')
            print("Bye...")
            break
    print("\033[?25h", end="")  # Show cursor

if __name__ == "__main__":
    main()
EOF

# Save current terminal settings
stty -g > /tmp/stty-settings

# Disable terminal echo
stty -echo

# Run the Python script and redirect all its output to the terminal
python menu.py &>$(tty)

# Restore terminal settings
stty $(cat /tmp/stty-settings)

@ploupipoulpi
Copy link

ploupipoulpi commented Jul 7, 2024

Capture d’écran 2024-07-07 à 11 05 46

the piggy themer for which I need confirmation to set the new colors on the example on the right side

@ploupipoulpi
Copy link

ploupipoulpi commented Jul 7, 2024

Capture d’écran 2024-07-07 à 20 20 16

I think I found them all.
Is it me or rowcolor2 and 1 are reversed?
I intentionally used ugly colors to make it easier so see, this is not my taste in colors :D

@ploupipoulpi
Copy link

ploupipoulpi commented Jul 7, 2024

Updated code for the page (you need https://www.eyecon.ro/colorpicker/#download to make it work locally):

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>LGPT color themer</title>   
    <link rel="stylesheet" media="screen" type="text/css" href="css/colorpicker.css" />
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/colorpicker.js"></script>
    <script type="text/javascript">

      $(document).ready(function(){

        var values = {
            "bg":"000000",
            "sn":"E5E5B9",
            "rw":"35748B",
            "cs":"FF4138",
            "se":"FFFFFF",
            "s0":"0000FF",
            "cc":"FF00FF",
            "r1":"00FF00",
            "r2":"FFFF00"
        };

        var hash = window.location.hash.replace('#', '').split('&');
        var ret = {};
        values.title = "untitled";

        for (var x = 0; x < hash.length; x++) {
            var itemArray = hash[x].split('=');
            ret[itemArray[0]] = itemArray[1];
        }

        var testset = function(id){
          if (ret[id] !== undefined){
            values[id] = ret[id];
          }
        }

        testset("bg");
        testset("sn");
        testset("rw");
        testset("cs");
        testset("se");
        testset("s0");
        testset("cc");
        testset("r1");
        testset("r2");
        testset("title");

        var $bg    = $("#bg");
        var $sn    = $("#sn");
        var $rw    = $("#rw");
        var $cs    = $("#cs");
        var $se    = $("#se");
        var $s0    = $("#s0");
        var $cc    = $("#cc");
        var $r1    = $("#r1");
        var $r2    = $("#r2");
        var $title = $("#title");
        var $titleinput = $("#titleinput");

        var currentElement;

        if (values.title !== "untitled") {
          var val = decodeURIComponent(values.title).replace(/\+/g, ' ');
          values.title = val;
          $title.text(val);
          $("#txt").attr("value", val);
        }

        $title.bind("click", function(){
          $title.hide();
          $titleinput.show();
        });

        $titleinput.submit(function(e){
          e.preventDefault();
          console.log(e);
          var val = $("#titleinput input").val();
          $title.text(val).show();
          $("#txt").attr("value", val);
          $titleinput.hide();
          $title.show();
          values.title = val;
          window.location.hash = $.param(values);
        });

        $("#colorpickers").submit(function(e){
          e.preventDefault();
        });

        var before = function(){
          $(this).ColorPickerSetColor(this.value);
          currentElement = this;
        }

        var onchange = function(hsb, hex, rgb){
          values[$(currentElement).attr("id")] = hex.toUpperCase();
          update();
        }

        $("#colorpickers input").ColorPicker({onChange:onchange, onBeforeShow:before});

        function update(){
          //hex values
          var bgh  =  "#"+values.bg;
          var snh  =  "#"+values.sn;
          var rwh  =  "#"+values.rw;
          var csh  =  "#"+values.cs;
          var seh  =  "#"+values.se;
          var s0h  =  "#"+values.s0;
          var cch  =  "#"+values.cc;
          var r1h  =  "#"+values.r1;
          var r2h  =  "#"+values.r2;

          $(".bgtxt").css({color:bgh});
          $(".sntxt").css({color:snh});
          $(".rwtxt").css({color:rwh});
          $(".cstxt").css({color:csh});
          $(".setxt").css({color:seh});
          $(".s0txt").css({color:s0h});
          $(".cctxt").css({color:cch});
          $(".r1txt").css({color:r1h});
          $(".r2txt").css({color:r2h});
          $(".bgback").css({"background-color":bgh});
          $(".snback").css({"background-color":snh});
          $(".rwback").css({"background-color":rwh});
          $(".csback").css({"background-color":csh});
          $(".seback").css({"background-color":seh});
          $(".s0back").css({"background-color":s0h});
          $(".ccback").css({"background-color":cch});
          $(".r1back").css({"background-color":r1h});
          $(".r2back").css({"background-color":r2h});

          //set input vals
          $bg.val(bgh);
          $sn.val(snh);
          $rw.val(rwh);
          $cs.val(csh);
          $se.val(seh);
          $s0.val(s0h);
          $cc.val(cch);
          $r1.val(r1h);
          $r2.val(r2h);

          var txt = '<BACKGROUND value="'+values.bg+'" />\n'+
                    '<FOREGROUND value="'+values.sn+'" />\n'+
                    '<HICOLOR1 value="'+values.rw+'" />\n'+
                    '<HICOLOR2 value="'+values.cs+'" />\n'+
                    '<SONGVIEW_FE value="'+values.se+'" />\n'+
                    '<SONGVIEW_00 value="'+values.s0+'" />\n'+
                    '<CURSORCOLOR value="'+values.cc+'" />\n'+
                    '<ROWCOLOR1 value="'+values.r1+'" />\n'+
                    '<ROWCOLOR2 value="'+values.r2+'" />\n';

          $("textarea").val(txt);

          window.location.hash = $.param(values);
        };

        var parsecode = function(str){
         var arr = str.split("\"");
          if(arr.length > 18){
            values = {
              "bg": arr[1],
              "sn": arr[3],
              "rw": arr[5],
              "cs": arr[7],
              "se": arr[9],
              "s0": arr[11],
              "cc": arr[13],
              "r1": arr[15],
              "r2": arr[17]
            };
            update();
          }
        }

        $("textarea").bind("paste", function(){
          console.log($(this).val())
          parsecode($(this).val());
        });
        $("textarea").bind("keyup", function(){
          console.log($(this).val())
          parsecode($(this).val());
        });
        update();
      });
</script>
<style type="text/css">
  body{
    width: 960px;
    margin: 10px auto;
    font-family: sans-serif;
    background-image: url("brushed.png");
  }
  #inputs {
    float: left;
  }

  .title{
    display: inline-block;
    width: 100px;
    border-right: 1px solid #ccc;
    margin: 0 10px;
    padding: 5px;
  }

  #noninputs{
    float: left; 
  }

  #visual{
    height: 400px;
    width: 600px;
  }

  textarea{
    width: 100%;
    height: 150px;
  }
  h1, h2{
   text-align: center;
  }
  h1 span{
    border-radius: 5px;
    padding: 3px;
  }
  h2{
    margin: 0 auto;
    font-size: 28px;
    width: 600px;
  }

 .box{
   display: inline-block;
   height: 20px; 
   margin: 0px 10px -8px 0px;
   width: 20px;
   padding: 3px
 }

 pre{
  font-weight: bold;
  line-height: 1em;
 }
 .main{
  position: relative; 
  overflow: hidden;
  height: 30em;
 }
 .menu{
  position: absolute;
  left: 0;
  top: 2em;
 }

 .note{
  position: absolute;
  bottom: 0;
  height: 3em;
 }

 .n1{
 left: 64px;
 }
 .n2{
 left: 88px;
 }
 .n3{
 left: 112px;
 }
 .n4{
 left: 137px;
 }
 .n5{
  left: 160px;
 }
 .n6{
 left: 184px;
 }
 .n7{
 left: 208px;
 }
 .n8{
 left: 233px;
 }
 #titleinput{
  display: none;
  text-align: center;
 }

</style>
</head>
<body>
  <h1><span class="bgtxt rwback">Little</span>
      <span class="sntxt csback">Piggy</span>
      <span class="rwtxt bgback">Tracker</span>
      <span class="cstxt snback">Themer</span></h1>
  <h2 id="title">Click to set title</h2>
  <form id="titleinput">
    <input type="text" id="txt" value="Click to set title" />
    <input type="submit" value="save" />
  </form>
  <div id="inputs">
    <h3>
    Select box to change color.
    </h3>
    <form id="colorpickers">
      <span class="title">Background:</span><span class="bgback box"></span><input type="text" id="bg" class="text" name="background" value="" /><br/>
      <span class="title">Foreground:</span><span class="snback box"></span><input type="text" id="sn" class="text" name="song" value="" /><br/>
      <span class="title">Row Count:</span><span class="rwback box"></span><input type="text" id="rw" class="text" name="row" value="" /><br/>
      <span class="title">Cursor:</span><span class="csback box"></span><input type="text" id="cs" class="text" name="cursor" value="" /><br/>
      <span class="title">Songview FE:</span><span class="seback box"></span><input type="text" id="se" class="text" name="songview_fe" value="" /><br/>
      <span class="title">Songview 00:</span><span class="s0back box"></span><input type="text" id="s0" class="text" name="songview_00" value="" /><br/>
      <span class="title">Cursor Color:</span><span class="ccback box"></span><input type="text" id="cc" class="text" name="cursorcolor" value="" /><br/>
      <span class="title">Row Color 1:</span><span class="r1back box"></span><input type="text" id="r1" class="text" name="rowcolor1" value="" /><br/>
      <span class="title">Row Color 2:</span><span class="r2back box"></span><input type="text" id="r2" class="text" name="rowcolor2" value="" /><br/>
    </form>
  </div>
  <div id="noninputs">
    <div id="visual">
<pre class="main bgback sntxt">
Song - lgpt10k


     <span class="r2txt">00</span> -- 05 12 12 <span class="bgtext s0txt">00</span> -- -- --  ----
     <span class="r2txt">01</span> -- 01 0F 0C 01 -- -- --  000%
     <span class="r2txt">02</span> -- 01 02 08 09 -- -- --  100
     <span class="r2txt">03</span> -- 05 <span class="bgtext s0txt">00</span> 04 0D -- -- --  00:14
     <span class="r1txt">04</span> -- 07 03 15 10 -- -- --
     <span class="r1txt">05</span> --<span class="bgtext cctxt">></span><span class="rntxt">14</span><span class="bgtext cctxt">></span><span class="rntxt">11</span><span class="bgtext cctxt">></span><span class="rntxt">37</span><span class="bgtext cctxt">></span><span class="rntxt">03</span> -- -- --
     <span class="r1txt">06</span> -- 17 18 11 1E -- -- --
     <span class="r1txt">07</span> -- 22 <span class="bgtext setxt">FE</span> 11 21 -- -- --
     <span class="r2txt">08</span> -- 14 13 11 1E <span class="bgtext bgtxt csback">--</span> -- --
     <span class="r2txt">09</span> -- 01 02 0C 0E -- -- --
     <span class="r2txt">0A</span> -- 01 06 08 0E -- -- --
     <span class="r2txt">0B</span> -- 05 02 04 0E -- -- --
     <span class="r1txt">0C</span> -- 07 1A <span class="bgtext s0txt">00</span> 0E -- -- --
     <span class="r1txt">0D</span> -- <span class="bgtext setxt">FE</span> 37 12 25 -- -- --
     <span class="r1txt">0E</span> -- 22 24 2D 2B -- -- --
     <span class="r1txt">0F</span> -- 2A 24 27 25 -- -- --
     <span class="r2txt">10</span> -- 2A 24 2E 25 -- -- --
     <span class="r2txt">11</span> -- 01 11 08 09 -- -- --
     <span class="r2txt">12</span> -- 05 A2 04 0D -- -- --
     <span class="r2txt">13</span> -- 07 12 15 <span class="bgtext s0txt">00</span> -- -- --
     <span class="r1txt">14</span> -- 07 1A 1C 12 -- -- --
     <span class="r1txt">15</span> -- 05 20 19 09 -- -- --

<pre class="menu bgtxt rwback">
P G 
SCPI
TT  
</pre>
<pre class="note n1 rwback bgtxt">  </pre>
<pre class="note n2 rwback bgtxt">
F 
 2
07
</pre>
<pre class="note n3 rwback bgtxt">  </pre>
<pre class="note n4 rwback bgtxt">  </pre>
<pre class="note n5 rwback bgtxt">
C 
 4
0D
</pre>
<pre class="note n6 csback bgtxt">  </pre>
<pre class="note n7 rwback bgtxt">  </pre>
<pre class="note n8 rwback bgtxt">  </pre>
</pre>

 </div>
    <textarea>
    </textarea>
  </div>
</body>
</html>

@ploupipoulpi
Copy link

However as I mentioned Menu button is used as a system hotkey modifier in MiyooCFW and there's no fallthrough for it, I mean even when system hotkeys are turned off through a config file they do not register at all in LGPT, they just do nothing. A dirty fix for that is to set device type to Q90 instead of V90, so the system hotkey is on R2, and menu button is free for application hotkeys. Didn't have any problems with that as well so far

thanks! I see why it works. Might work with 2.0 even though I don't know what happens at first install, when it autodetects the model if you change it.
Still a cool way to get it to work the way you want!

@djdiskmachine
Copy link
Owner

Hey peeps I was distracted by a flood of CI messages so I missed a lot of what was going on, sorry about that.

A theme maker is fantastic, great work!
Looking forward to a locally runnable one!

About colors.. 'Unfortunately' there's been some additions 😅
Consult this document for clarification:
https://github.com/djdiskmachine/littlegptracker/releases/

@ploupipoulpi
Copy link

ploupipoulpi commented Jul 8, 2024

Hei @djdiskmachine
Sorry if I wasn't clear with my messages:

  • The shell/python script works on V90 with CFW 2.0 and allows to select a theme. Just save the .sh. in the lgpt folder and create a "themes" folder with your individual themes xmls.

  • The HTML for the theme maker is working locally, and I think I got all the colors, just save the html and add the contents of color picker https://www.eyecon.ro/colorpicker/#download in the same folder. And there you go.--- I only modified the previous theme maker that is available here: http://poyo.co/lgpt/ - maybe the owner could update the code there as well.

--- Edit --- My bad I spoke too fast :D just saw the changes. Ok I'll get back to it !

@djdiskmachine
Copy link
Owner

Ah cool, gotcha!
I'll reference these in an upcoming manual update, this is really great ^_^

@djdiskmachine
Copy link
Owner

I've added bittboy as a build target for automated builds. If someone could verify this is working properly I'd like to close this issue. :)

@purelygrey
Copy link
Author

I've added bittboy as a build target for automated builds. If someone could verify this is working properly I'd like to close this issue. :)

It does, though I haven't tried the 1.4.1 yet. I'm running 1.4.0 on the newest firmware, it seems to work just fine so far

@djdiskmachine
Copy link
Owner

Alright! There should be no specific changes related to bittboy between 1.4.0 and 1.4.1, I'll consider this solved.
Thanks for your contributions!

@djdiskmachine
Copy link
Owner

Hello again!
I noticed Bittboy noticed has USB serial as a feature of cfw-2.0.0b, might it be possible to get USB MIDI going with this device? Should be pretty simple to find out. Just add the RTMidi folders and .o files to BITTBOY and cross our fingers that cfw has the the kernel module for USB-MIDI. =)

@purelygrey
Copy link
Author

Hello again! I noticed Bittboy noticed has USB serial as a feature of cfw-2.0.0b, might it be possible to get USB MIDI going with this device? Should be pretty simple to find out. Just add the RTMidi folders and .o files to BITTBOY and cross our fingers that cfw has the the kernel module for USB-MIDI. =)

Interesting, I'm going to try it out before the end of the week!

@djdiskmachine
Copy link
Owner

I've seen some reports on double binds when assigning custom button mappings with mapping.xml, is this something you've encountered?

@purelygrey
Copy link
Author

Can't say I have, however I don't use mapping.xml, I just map buttons inside config, maybe it's not related

@djdiskmachine
Copy link
Owner

djdiskmachine commented Aug 29, 2024

Can you post your config.xml please
Edit: i saw you pasted a q90 config, I believe the issue was for miyoo cfw

@purelygrey
Copy link
Author

purelygrey commented Aug 29, 2024

Here's my current config.xml:

<CONFIG>
<DUMPEVENT value="NO"/>

<BACKGROUND value="000000"/> <!-- BACKGROUND-->
<FOREGROUND value="FFFFFF"/> <!-- song name -->
<HICOLOR1   value="343434"/> <!-- row count in song screen -->
<HICOLOR2   value="888888"/> <!-- cursor-->
<SONGVIEW_FE value="A55B8F" /> <!-- color of the chain "FE" in song screen-->
<SONGVIEW_00 value="853B6F" /> <!-- color of the chain "00" in song screen-->
<CURSORCOLOR value = "FF00DD"/> <!--Cursor color-->
<ROWCOLOR1 value = "BA28F9"/> <!--Row count color 1 -->
<ROWCOLOR2 value = "FF00FF"/> <!--Row count color 2-->
<ALTROWNUMBER value = "4"/>      <!--How many rows of each ROWCOLOR-->

<ROOTFOLDER value="/mnt/PROJECTS"/>
<SAMPLELIB value="/mnt/SAMPLES"/>


<KEY_UP value="key:0:up" />
<KEY_DOWN value="key:0:down" />
<KEY_LEFT value="key:0:left" />
<KEY_RIGHT value="key:0:right" />
<KEY_A value="key:0:left alt" />
<KEY_B value="key:0:left ctrl" />
<KEY_LSHOULDER value="key:0:escape" />
<KEY_RSHOULDER value="key:0:right alt" />
<KEY_START value="key:0:return" />

<KEYDELAY value="150"/>
<KEYREPEAT value="40"/>

</CONFIG>

I'm on Miyoo CFW 2.0.0 beta 2. Q90 is just a sibling device to Powkiddy V90, CFW lets you select the device on install -- I only use it to free up the "Menu" button from system hotkeys, because there's no fallthrough for it (yet)

@purelygrey
Copy link
Author

Also I need a bit more info about RTMidi, what to do and what to expect, I'm not exactly sure if I'm doing the right thing, is it right that I should add the mentioned folders names and files in Makefile under BITTBOY everywhere and compile it this way?

@djdiskmachine
Copy link
Owner

djdiskmachine commented Aug 30, 2024

Almost, you're gonna need to do something like this
bittboy_usb_MIDI.txt

I'm getting linking errors with this patch though. Can't investigate any further at this moment, check back in later

Edit: I did some more digging. The toolchain is missing rtmidi shared object files.
I'm compiling a new toolchain with the missing packages, fingers crossed!

@djdiskmachine
Copy link
Owner

djdiskmachine commented Aug 30, 2024

Edit: Won't work, I missed some things

OK here goes
You're gonna want to LD_PRELOAD the librtmidi.so

lgpt-bittboy-midi-maybe-v0.zip

@djdiskmachine
Copy link
Owner

Actually I made a mistake for that one, here we go again

lgpt-bittboy-midi-maybe-v1.zip

@purelygrey
Copy link
Author

purelygrey commented Aug 30, 2024

Actually I made a mistake for that one, here we go again

lgpt-bittboy-midi-maybe-v1.zip

Alright, it doesn't work, but at least it tries to! Outputs this:

[AUDIO] Audio object initialised with
[AUDIO] Api:
[AUDIO] Device:
[AUDIO] Buffer size:1024
[AUDIO] Pre Buffer Count:8
[*ERROR*] Couldn't get RtMidiIn object
[*ERROR*] RtMidiIn::initialize: error creating ALSA sequencer input client object.
[*ERROR*] Couldn't get RtMidiOut object
[*ERROR*] RtMidiOut::initialize: error creating ALSA sequencer client object.

It also by default works as an MTP device, it does something like:

#!/bin/busybox sh

echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
modprobe -r g_serial
killall umtprd
umtprd &

So I tried to kill umtprd before running Piggy, but it didn't change anything, but I have barely any idea about what I'm doing :-)

@djdiskmachine
Copy link
Owner

Yeah that's a shame. I suspect it's missing MIDI kernel support, this would be an issue towards maintainers of miyoo cfw unless you want to roll your own. 😅

@djdiskmachine
Copy link
Owner

MIDI would be a serial mode rather than MTP so if there's anything like that maybe check it out

@ploupipoulpi
Copy link

Hi, I was wondering the same thing, USB_CONFIGFS_F_MIDI was my lead but I didn't get very far. I don't understand enough on all that part currently to get much of it yet.

It seems to be MTP by default at startup.
As for serial, there was a script for that in the betas, I believe for the serial console:

#!/bin/busybox sh
echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
killall umtprd
modprobe g_serial

If you have any specific lead, I can create a discussion in the cfw to get to the bottom of it, they're super nice and responsive.

I'm on a clean version of a recent nightly build, if there's any version you'd like me to test on the v90 let me know, I'm also super interested in the usbmidi for this thing.

@djdiskmachine
Copy link
Owner

I'd love to join in the discussion, where do I find the cfw peeps?

@ploupipoulpi
Copy link

https://github.com/TriForceX/MiyooCFW/discussions over there!

@djdiskmachine
Copy link
Owner

I created a thread here: TriForceX/MiyooCFW#610
Let's hope for some good news =)

@purelygrey
Copy link
Author

Hi, I was wondering the same thing, USB_CONFIGFS_F_MIDI was my lead but I didn't get very far. I don't understand enough on all that part currently to get much of it yet.

It seems to be MTP by default at startup. As for serial, there was a script for that in the betas, I believe for the serial console:

#!/bin/busybox sh
echo peripheral > /sys/devices/platform/soc/1c13000.usb/musb-hdrc.1.auto/mode
killall umtprd
modprobe g_serial

If you have any specific lead, I can create a discussion in the cfw to get to the bottom of it, they're super nice and responsive.

I'm on a clean version of a recent nightly build, if there's any version you'd like me to test on the v90 let me know, I'm also super interested in the usbmidi for this thing.

I've tried killing the umtprd which does MTP stuff, and also modprobing g_serial and g_midi before running the tracker and logged the output, both don't seem to fail, but it didn't change anything, sadly. Fingers crossed though, usb midi for v90 would be sick! I'm slowly working on a custom shell and buttons for it, with usb-midi it would be such a good and full featured dedicated Piggy handheld

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants