Log In  
Follow
drakmaniso
[ :: Read More :: ]

NOTE: mouse locking seems to be broken on the web player for now, so to try the instrument editor you should load the cart in Picotron instead (i.e. load #visitrack).

Mouse locking also behaves strangely on some platforms (e.g. mac); I added some settings (accessible through the menu) to change the sensitivity and direction, to see if that helps.

Cart #visitrack-2 | 2024-04-24 | Embed ▽ | License: CC4-BY-NC-SA
24

VisiTrack is a music tracker, an alternative to the SFX editor provided with Picotron. This is still a work in progress!

(NOTE: this cartridge requires the last version of Picotron, 0.0.1f)

VisiTrack also contains a fully functional instrument editor, which should be able to do anything the default sfx editor can, but presented in a different way.

I'd love to have feedback on the design of the synth interface!

In the instrument editor, the top half of the screen show the audio routing of the current instrument, i.e. how the oscillators, modulators and effects are connected. You can select a module to show its interface below, or choose the "all" button to show an overview of all the synth modules currently in use.

You can exchange instrument definitions with the default editor by copy/pasting (i.e. use Ctrl-C and Ctrl-V while in the "inst" page of either application), or by saving the file in one application and opening it in the other.

Loading files

There is currently no way to associate an application with a file extension, so in order to load an existing .sfx file into VisiTrack you have to use drag-and-drop: in the menu, choose "Open File", but instead of double-clicking, drag the file you want to open onto the application window.

How to use the pattern editor

You can enter notes with the same keys as the default tracker (i.e. piano-like layout). Use "backspace" to erase the previous step, "del" to enter a rest (i.e. silence) in the current step. Use "shift" + keys 0 to 9 to change the octave.

When the selection is on a volume slider (the blue bar below the note), use keys 0 to 9 to set the volume (mouse interaction is not yet implemented).

When the selection is on the instrument number, also use keys 0 to 9 to select one of the 10 first instrument. Use "shift" + keys 0 to 9 to change the tens digit.

Changelog

0.0.3 (release #visitrack-2):

  • redesigned interface for the instrument editor
  • flexible module insertion and removal
  • copy/paste instruments (compatible with sfx.p64)
  • settings for mouse movements (direction and sensitivity)
P#146380 2024-04-11 17:37 ( Edited 2024-04-24 07:34)

[ :: Read More :: ]

Cart #okpal-5 | 2024-05-03 | Embed ▽ | License: CC4-BY-NC-SA
61

Okpal is a tool to create and edit color palettes. You can easily use those palettes in your programs, and even directly in Picotron's sprite and map editors.

Features

  • Any change to the palette is propagated to Picotron's sprite and map editors.
  • Use a perceptually uniform color space (oklab).
  • Choose colors by hue, saturation and lightness.
  • Reorder colors by drag-and-drop.
  • Supports two file formats: ".hex" and ".pal"
  • Multiple options for importing external palettes (keep default palette, overwrite it, or try to match it)

Usage

The tool shows you four different views of the 64 colors in the current palette:

  • at the top-left of the screen, the colors are shown in palette order (same as in sprite editor first tab);
  • below, on the left, the colors are shown inside a circle picker: the angle correspond to the hue, and the distance from the center correspond to the saturation;
  • in the middle the colors are shown as inside a square picker: the X axis correspond to the saturation, and the Y axis correspond to the lightness;
  • finally, on the right is a "test zone", where you can use 24 paintable cubes to test color combinations.

To modify a color, you must first select it. You can do that either by clicking in the palette overview at the top of the screen, or by clicking directly on one of the color dots in the circle picker or in the square picker.

Once selected, some information about the color are displayed on the right of the palette overview:

  • the color number;
  • the hex code corresponding to the RGB values of the color;
  • a padlock icon: if the padlock is closed, the color is "locked" and cannot be edited; click on the icon to lock/unlock it;
  • an eye icon: if the eye is closed, the color is only shown in the palette overview; it is hidden in the circle and square pickers.
  • a paint bucket icon: you can click on it to change the color background to the current selected color; click again to go back to a black background.

You can copy the current color by using Ctrl-C, and paste a copied color onto the current one by using Ctrl-V. This also works outside OkPal: the color is stored in the clipboard as a hex code ("#ffacc5").

There is five different ways to adjust the selected color:

  • a small colored circle outside the circle picker allows you to change the hue of the color;
  • a small colored circle inside the circle picker allows you to change at the same time the hue and the saturation;
  • a small colored triangle below the square picker allows you to change just the saturation;
  • a small colored triangle at the right of the square picker allows you to change the lightness;
  • finally, a small colored circle inside the square picker allows you to change at the same time the saturation and the lightness.

Any change you make can be reverted by hitting Ctrl-Z for undo. Use Ctrl-Y for redo.

Once you have several colors in you palettes, you can reorder them in the palette overview: just drag one color onto another, they will swap their positions. Note that both colors must be unlocked.

Using the palette in cartridges

By default, the palette you edit is saved in the cart you're working on, alongside your sprite sheets and maps.

The default path is "/ram/cart/pal/0.pal"

In order to use a palette in your programs, you just need to copy it in memory:

poke4(0x5000, get(fetch"/ram/cart/pal/0.pal"))

Loading and saving

If you only need one palette for your cart, you don't need to do anything special to save it. It is saved alongside the rest of your assets each time you hit Ctrl-S.

In order to create a new palette, use the '+' button at the right of the tabs and choose the name of your new palette, for example "1.pal". If you need to start from scratch for this new palette, use "Empty Palette" or "Picotron Palette" from the menu.

You can load a previously created palette by using "Open File" in the menu.

Importing and exporting

You can import and export palettes for use with external tools. Currently the only supported format is ".hex" files, which are simple text files with one line per color, represented by their RGB code in hex format (without "#" or "0x", just the hexadecimal numbers).

To import a palette, choose "Open File" from the menu, and select the ".hex" file. If this is the first time you open this external palette in OkPal, a dialog will appear to let you choose how to arrange the colors in the palette. You can either:

  • Keep default Picotron palette in the first 32 colors, and put the imported colors in the last 32 slots.
  • Completely remove the Picotron palette and import the whole palette, but reorder the colors to try to match the default colors.
  • Or simply import the palette as is. Note that this will affect the interface and probably make it difficult to use the menu, the sprite editor and the map editor.

Changelog

2024-05-03: version 1.0.2 (release #okpal-5)

  • fixed: bug while using "+" button in Picotron
    0.1.0g;
  • changed: disabled tabs in BBS, as it prevents
    the cart from running;

2024-04-27: version 1.0.1 (release #okpal-4)

  • fixed: picotron's palette was not locked in the
    default file on first opening;
  • fixed: saving a ".pal" file from an imported
    ".hex" file was not working;
  • explain how to export to .hex in the manual;

2024-04-06: version 1.0.0 (release #okpal-3)

  • propagate palette to sprite and map editors;
  • undo/redo;
  • reorder colors by drag-and-drop;
  • import dialog;
  • reorder imported colors to match default colors;
  • added a manual;
  • menu entries to initialize the palette and open
    the manual;
  • flash padlock icon when trying to edit a locked
    color;
  • shift-click paint-bucket icon to change the "white"
    color used in the interface, and ctrl-click the
    icon to change the "black" (useful when importing
    external palettes);

2024-04-02: version 0.0.3 (release #okpal-2)

  • Added the ability to change the background color (by clicking on the small paint bucket icon), and switched the default background to black.
  • Added the ability to import ".hex" files (using drag and drop from the "Open File" dialog); to actually create the ".pal" file, you need to save.
  • Improved the color pickers.
  • Added the ability to copy/paste colors (using a hex string starting with #).
  • Added the ability to show/hide individual colors (right click on a color in the palette).

2024-04-01: v0.0.1 (release #okpal-1)

  • Added the ability to lock colors, to avoid accidentally modifying them. By default the first 33 colors are locked (click on the padlock to unlock)
  • Added the ability to hide specific rows of color from the two color pickers.
  • Added sliders to change the individual components (hue, saturation and luminance).
  • Added the ability to select a color by clicking on their dot in the color pickers.
  • Added a test zone, with 24 paintable cubes (click on a cube face to change its color).
P#145244 2024-03-31 14:43 ( Edited 2024-05-03 07:22)

[ :: Read More :: ]

Cart #font_utils-0 | 2024-03-29 | Embed ▽ | License: CC4-BY-NC-SA
10

This cartridge contains two command line utilities, font2gfx and gfx2font, to perform conversion between fonts and sprite sheets.

Installation

First, load the cart with load #font_utils.

After loading, you have two options:

  • Either an automatic installation: run the cart (press CTRL-R) and follow the instructions.
  • or a manual installation:
    • cp /ram/cart/exports/appdata/system/util/font2gfx.lua /appdata/system/util/
    • cp /ram/cart/exports/appdata/system/util/gfx2font.lua /appdata/system/util/

Usage

Converting a font into a sprite sheet

Use font2gfx input.font

This will create two files: a gfx file containing the sprite sheet, and a lua file containing the configuration of the font (character width, height, variable width offsets, and so on).

You can optionally specify a specific output: font2gfx input.font output.gfx

If the output already exists, you can add a flag to overwrite: font2gfx -o input.font

Converting a sprite sheet into a font

Use gfx2font input.gfx

You need to have a lua file containing the configuration for the font. For example, here is the configuration for the default font (lil.font):

font_config = {
    width = 5,
    width_128 = 10,
    height = 11,
    x_offset = 0,
    y_offset = 0,
    flags = 3,
    char_offsets = {
        ["#"] = 1,
        ["."] = -1,
        ["I"] = -1,
        ["M"] = 1,
        ["T"] = 1,
        ["W"] = 1,
        ["i"] = -1,
        ["l"] = -1,
        ["m"] = 1,
        ["w"] = 1,
    }
}

You can optionally specify a different configuration file: gfx2font input.gfx input.lua, and/or a different output file: gfx2font input.gfx input.lua output.font

If the output already exists, you can add a flag to overwrite: font2gfx -o input.font

Using the font

To use the font in a program (or in the terminal), use poke(0x4000, get(fetch("some.font"))).

Memory layout for non-monospace fonts

I didn't find any information in the wiki about the format of non-monospace fonts, so here is what I found:

The fifth byte seems to contain two flags: the lower bit indicates that the font is not monospace. The second bit is also set for the default picotron font, but I don't know its purpose.

Then each character (at least in the range 32-127) have a configuration stored using 4 bits.

To find the index for a character configuration: divide the character code by 2; if the code is even, the configuration is in the 4 lower bits, otherwise it's in the 4 higher bits.

The 3 lower bits of a character configuration contains a delta to the base width (between -4 and +3), and the fourth bit pushes the character upward by 1 pixel (note that this vertical offset is currently not taken into account by my utilities).

P#145026 2024-03-29 20:45