drakmaniso [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=5951 VisiTrack 0.0.2 (music tracker) <p>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. <code>load #visitrack</code>).</p> <p>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.</p> <p> <table><tr><td> <a href="/bbs/?pid=146380#p"> <img src="/bbs/thumbs/pico64_visitrack-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=146380#p"> VisiTrack 0.0.1 (tracker)</a><br><br> by <a href="/bbs/?uid=5951"> drakmaniso</a> <br><br><br> <a href="/bbs/?pid=146380#p"> [Click to Play]</a> </td></tr></table> </p> <p>VisiTrack is a music tracker, an alternative to the SFX editor provided with Picotron. This is still a work in progress!</p> <p>(NOTE: this cartridge requires the last version of Picotron, 0.0.1f)</p> <p>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.</p> <p>I'd love to have feedback on the design of the synth interface!</p> <p>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 &quot;all&quot; button to show an overview of all the synth modules currently in use.</p> <p>You can exchange instrument definitions with the default editor by copy/pasting (i.e. use Ctrl-C and Ctrl-V while in the &quot;inst&quot; page of either application), or by saving the file in one application and opening it in the other.</p> <h2>Loading files</h2> <p>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 &quot;Open File&quot;, but instead of double-clicking, drag the file you want to open onto the application window.</p> <h2>How to use the pattern editor</h2> <p>You can enter notes with the same keys as the default tracker (i.e. piano-like layout). Use &quot;backspace&quot; to erase the previous step, &quot;del&quot; to enter a rest (i.e. silence) in the current step. Use &quot;shift&quot; + keys 0 to 9 to change the octave.</p> <p>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).</p> <p>When the selection is on the instrument number, also use keys 0 to 9 to select one of the 10 first instrument. Use &quot;shift&quot; + keys 0 to 9 to change the tens digit.</p> <h2>Changelog</h2> <p>0.0.3 (release #visitrack-2):</p> <ul> <li>redesigned interface for the instrument editor</li> <li>flexible module insertion and removal</li> <li>copy/paste instruments (compatible with <code>sfx.p64</code>)</li> <li>settings for mouse movements (direction and sensitivity)</li> </ul> https://www.lexaloffle.com/bbs/?tid=141649 https://www.lexaloffle.com/bbs/?tid=141649 Thu, 11 Apr 2024 17:37:59 UTC OkPal (palette editor) <p> <table><tr><td> <a href="/bbs/?pid=145244#p"> <img src="/bbs/thumbs/pico64_okpal-10.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=145244#p"> OkPal 1.2.1</a><br><br> by <a href="/bbs/?uid=5951"> drakmaniso</a> <br><br><br> <a href="/bbs/?pid=145244#p"> [Click to Play]</a> </td></tr></table> </p> <p>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.</p> <p>To use a palette in your programs:</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> fetch(&quot;pal/0.pal&quot;):poke(0x5000)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>Features</h2> <ul> <li>Any change to the palette is propagated to Picotron's sprite and map editors.</li> <li>Use a perceptually uniform color space (oklab).</li> <li>Choose colors by hue, saturation and lightness.</li> <li>Reorder colors by drag-and-drop.</li> <li>Supports two file formats: &quot;.hex&quot; and &quot;.pal&quot;</li> <li>Multiple options for importing external palettes (keep default palette, overwrite it, or try to match it)</li> </ul> <h2>Changelog</h2> <p>2025-03-18: version 1.2.1 (release #okpal-10)</p> <ul> <li>Added: &quot;Export File&quot; menu entry to save a copy of the current file without opening it.</li> <li>Changed: &quot;.hex&quot; files are saved without metadata.</li> <li>Changed: dragging color dots is much more precise.</li> <li>Changed: constrain color changes along an axis when dragging a color dot<br /> using the right or middle mouse buttons (instead of holding &quot;shift&quot; or &quot;control&quot;).</li> <li>Changed: bigger color dots, easier to grab.</li> <li>Changed: propagate palette to sprite and map editors only when focus is lost.</li> <li>Changed: Don't automatically register as default app for &quot;.pal&quot; and &quot;.hex&quot;.</li> <li>Fixed: bug in opening files (due to bug in picotron's <code>wrangle.lua</code> since 0.1.1e)</li> <li>Fixed: reset display palette rows when hiding the color band.</li> </ul> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> 2025-03-13: version 1.2.0 (release #okpal-9)</p> <ul> <li>Added: new alternate view with hue/lum and hue/sat pickers.</li> <li>Added: hold &quot;shift&quot; or &quot;ctrl&quot; when dragging a color dot to constrain the change along one axis.</li> <li>Added: ability to scroll the hue axis of the alternate view, either with the scroll wheel or the dedicated control at the bottom of the screen.</li> <li>Added: color names in the alternate view.</li> <li>Added: color band in the alternate view.</li> <li>Added: settings to hide the color names and color band.</li> <li>Changed: simplified the old view (remove color lines on the 1D sliders)</li> </ul> <p>2025-03-08: version 1.1.0 (release #okpal-8)</p> <ul> <li>removed remapping option when importing &quot;.hex&quot; palettes (was not working very well anyway);</li> <li>added text entries for the hex code, the hue, the saturation and the luminance;</li> <li>added a new tab for drawing color ramps in the test zone;</li> <li>added dialog when creating a new palette (to choose between empty palette or default colors);</li> <li>added settings dialog;</li> <li>added settings to register OkPal as default app for &quot;.pal&quot; and &quot;.hex&quot; files;</li> <li>added settings for disabling the propagation of the palette to the sprite and map editors;</li> <li>changed dialog when importing &quot;.hex&quot; files;</li> <li>changed dialog for displaying help;</li> <li>fixed menu bar colors when default colors are redefined;</li> <li>fixed undo/redo of test cube color changes;</li> </ul> <p>2025-02-26: version 1.0.4 (release #okpal-7)</p> <ul> <li>added registering as default app for &quot;.pal&quot; and &quot;.hex&quot; (needed for the file dialog?)</li> <li>added undo/redo and help buttons;</li> <li>added &quot;clear&quot; button to the &quot;test cubes&quot;;</li> <li>added legends for the two pickers;</li> <li>changed: moved the luminance slider to the left of the sat/lum picker for consistency;</li> <li>fixed: palette is now propagated to all gfx and map editors (thanks to Eiyeron for the implementation);</li> <li>fixed: the &quot;test cubes&quot; saved in metadata where not properly loaded;</li> </ul> <p>2024-08-23: version 1.0.3 (release #okpal-6)</p> <ul> <li>added: add file icon to saved palettes;</li> <li>changed: can load and import palettes by<br /> double-clicking in the file dialog (no need<br /> to drag-and-drop anymore);</li> <li>fixed: bug in BBS;</li> </ul> <p>2024-05-03: version 1.0.2 (release #okpal-5)</p> <ul> <li>fixed: bug while using &quot;+&quot; button in Picotron<br /> 0.1.0g;</li> <li>changed: disabled tabs in BBS, as it prevents<br /> the cart from running;</li> </ul> <p>2024-04-27: version 1.0.1 (release #okpal-4)</p> <ul> <li>fixed: picotron's palette was not locked in the<br /> default file on first opening;</li> <li>fixed: saving a &quot;.pal&quot; file from an imported<br /> &quot;.hex&quot; file was not working;</li> <li>explain how to export to .hex in the manual;</li> </ul> <p>2024-04-06: version 1.0.0 (release #okpal-3)</p> <ul> <li>propagate palette to sprite and map editors;</li> <li>undo/redo;</li> <li>reorder colors by drag-and-drop;</li> <li>import dialog;</li> <li>reorder imported colors to match default colors;</li> <li>added a manual;</li> <li>menu entries to initialize the palette and open<br /> the manual;</li> <li>flash padlock icon when trying to edit a locked<br /> color;</li> <li>shift-click paint-bucket icon to change the &quot;white&quot;<br /> color used in the interface, and ctrl-click the<br /> icon to change the &quot;black&quot; (useful when importing<br /> external palettes);</li> </ul> <p>2024-04-02: version 0.0.3 (release #okpal-2)</p> <ul> <li>Added the ability to change the background color (by clicking on the small paint bucket icon), and switched the default background to black.</li> <li>Added the ability to import &quot;.hex&quot; files (using drag and drop from the &quot;Open File&quot; dialog); to actually create the &quot;.pal&quot; file, you need to save.</li> <li>Improved the color pickers.</li> <li>Added the ability to copy/paste colors (using a hex string starting with #).</li> <li>Added the ability to show/hide individual colors (right click on a color in the palette).</li> </ul> <p>2024-04-01: v0.0.1 (release #okpal-1)</p> <ul> <li>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)</li> <li>Added the ability to hide specific rows of color from the two color pickers.</li> <li>Added sliders to change the individual components (hue, saturation and luminance).</li> <li>Added the ability to select a color by clicking on their dot in the color pickers.</li> <li>Added a test zone, with 24 paintable cubes (click on a cube face to change its color).<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=141308 https://www.lexaloffle.com/bbs/?tid=141308 Sun, 31 Mar 2024 14:43:54 UTC Font Utils <p> <table><tr><td> <a href="/bbs/?pid=145026#p"> <img src="/bbs/thumbs/pico64_font_utils-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=145026#p"> Font Utils</a><br><br> by <a href="/bbs/?uid=5951"> drakmaniso</a> <br><br><br> <a href="/bbs/?pid=145026#p"> [Click to Play]</a> </td></tr></table> </p> <p>This cartridge contains two command line utilities, <code>font2gfx</code> and <code>gfx2font</code>, to perform conversion between fonts and sprite sheets.</p> <h1>Installation</h1> <p>First, load the cart with <code>load #font_utils</code>.</p> <p>After loading, you have two options:</p> <ul> <li>Either an automatic installation: run the cart (press CTRL-R) and follow the instructions.</li> <li>or a manual installation: <ul> <li><code>cp /ram/cart/exports/appdata/system/util/font2gfx.lua /appdata/system/util/</code></li> <li><code>cp /ram/cart/exports/appdata/system/util/gfx2font.lua /appdata/system/util/</code></li> </ul></li> </ul> <h1>Usage</h1> <h2>Converting a font into a sprite sheet</h2> <p>Use <code>font2gfx input.font</code></p> <p>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).</p> <p>You can optionally specify a specific output: <code>font2gfx input.font output.gfx</code></p> <p>If the output already exists, you can add a flag to overwrite: <code>font2gfx -o input.font</code></p> <h2>Converting a sprite sheet into a font</h2> <p>Use <code>gfx2font input.gfx</code></p> <p>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):</p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>font_config = { width = 5, width_128 = 10, height = 11, x_offset = 0, y_offset = 0, flags = 3, char_offsets = { [&quot;#&quot;] = 1, [&quot;.&quot;] = -1, [&quot;I&quot;] = -1, [&quot;M&quot;] = 1, [&quot;T&quot;] = 1, [&quot;W&quot;] = 1, [&quot;i&quot;] = -1, [&quot;l&quot;] = -1, [&quot;m&quot;] = 1, [&quot;w&quot;] = 1, } }</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You can optionally specify a different configuration file: <code>gfx2font input.gfx input.lua</code>, and/or a different output file: <code>gfx2font input.gfx input.lua output.font</code></p> <p>If the output already exists, you can add a flag to overwrite: <code>font2gfx -o input.font</code></p> <h2>Using the font</h2> <p>To use the font in a program (or in the terminal), use <code>poke(0x4000, get(fetch(&quot;some.font&quot;)))</code>.</p> <h1>Memory layout for non-monospace fonts</h1> <p>I didn't find any information in the wiki about the format of non-monospace fonts, so here is what I found:</p> <p>The fifth byte seems to contain two flags: the lower bit indicates that the font is <em>not</em> monospace. The second bit is also set for the default picotron font, but I don't know its purpose.</p> <p>Then each character (at least in the range 32-127) have a configuration stored using 4 bits.</p> <p>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.</p> <p>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> https://www.lexaloffle.com/bbs/?tid=141244 https://www.lexaloffle.com/bbs/?tid=141244 Fri, 29 Mar 2024 20:45:55 UTC