apps/piano: refactoring and improvement #302

Merged
mxlgv merged 7 commits from rewrite-piano into main 2026-03-07 20:10:52 +00:00
Owner

Refactoring of Piano source code.

Co-authored-by: Doczom mixa.frolov2003@gmail.com
Co-authored-by: qullarwee

What was done:

  • Refactored source code
  • Added Spanish translation
  • Updated UX/UI
  • Updated keyboard layout (fix #25 ?)
  • Added keymap configuration via separate binary file

What remains:

  • Fix "error finding thread" bug
  • Improve keyboard layout (?)
  • Use another sound player instead of beeper (?)

Help needed:

  • To test it on real hardware
  • To review code for managing second thread
  • To propose keyboard layout improvements
image.png
Refactoring of Piano source code. Co-authored-by: Doczom <mixa.frolov2003@gmail.com> Co-authored-by: qullarwee What was done: - [x] Refactored source code - [x] Added Spanish translation - [x] Updated UX/UI - [x] Updated keyboard layout (fix #25 ?) - [x] Added keymap configuration via separate binary file What remains: - [x] ~Fix "error finding thread" bug~ - [x] ~Improve keyboard layout (?)~ - [x] ~Use another sound player instead of beeper (?)~ Help needed: - To test it on real hardware - To review code for managing second thread - To propose keyboard layout improvements <img alt="image.png" src="attachments/62cd318b-5f0f-46ff-ad2e-97f481a3fcf0">
Burer added the
Priority
Low
Category/Applications
Kind
Enhancement
FASM
labels 2025-12-24 17:18:50 +00:00
Burer self-assigned this 2025-12-24 17:18:50 +00:00
Burer added 1 commit 2025-12-24 17:18:51 +00:00
Piano refacoring, part 1
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 2m29s
Build system / Build (pull_request) Successful in 16m32s
5049d6b0b4
Burer requested review from Doczom 2025-12-24 17:18:51 +00:00
Burer requested review from dunkaist 2025-12-24 17:18:51 +00:00
Burer requested review from Sweetbread 2025-12-24 17:18:51 +00:00
Burer added 1 commit 2025-12-26 18:58:57 +00:00
apps/piano: refactoring, part 2
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 2m26s
Build system / Build (pull_request) Successful in 17m1s
81f34cd28c
- Fixed bugs in keys and buttons reading and audio play
- Refactored data tables and removed loops
- Used more constants for everything
- Changes Spanish encoding to CP850
- Shifted notes on keys by -0x10 to match buttons
- Configured events mask for help thread
- Shift now works for buttons also
- Help window have relative coordinates from main window
- Maybe something else that I already forgot

Co-authored-by: Doczom <mixa.frolov2003@gmail.com>
Burer changed title from WIP: Piano refacoring to apps/piano: refactoring 2025-12-26 19:19:35 +00:00
Burer added 1 commit 2026-01-28 15:36:42 +00:00
apps/piano: add keymap configuration via separate binary file
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 1m10s
Build system / Build (pull_request) Successful in 16m21s
75ecc961dc
Burer changed title from apps/piano: refactoring to apps/piano: refactoring and improvement 2026-01-28 16:43:13 +00:00
Burer requested review from mxlgv 2026-01-29 06:55:56 +00:00
Doczom approved these changes 2026-02-20 17:47:18 +00:00
mxlgv requested changes 2026-02-21 19:17:34 +00:00
Dismissed
@@ -5,0 +3,4 @@
; Piano - Toy Piano
; Copyright (C) 2019-2025 KolibriOS team
;
; Contributor ??? - Initial code
Owner

I read several pages of the topic and concluded that the program was actually authored by Antonio, with support from Leency. The original code is an example that has nothing in common with the piano developed by Antonio and Leency. Therefore, I propose listing them as the authors:

; Authors: Antonio and Leency
I read several pages of the [topic](https://board.kolibrios.org/viewtopic.php?t=3831) and concluded that the program was actually authored by Antonio, with support from Leency. The original code is an example that has nothing in common with the piano developed by Antonio and Leency. Therefore, I propose listing them as the authors: ```asm ; Authors: Antonio and Leency ```
mxlgv marked this conversation as resolved
@@ -5,0 +5,4 @@
;
; Contributor ??? - Initial code
; Contributor Antonio - Refactoring and new functionality
; Contributor Burer - Refactoring and Spanish translation
Owner

Your changes will already be stored using git. Just add the people who helped you as "Co-authored-by" in commit body.

Your changes will already be stored using git. Just add the people who helped you as "Co-authored-by" in commit body.
mxlgv marked this conversation as resolved
mxlgv requested changes 2026-02-21 19:21:43 +00:00
Dismissed
mxlgv left a comment
Owner

I find this kind of indentation strange... Especially before labels. It seems most programs follow the kernel code style.

I find this kind of indentation strange... Especially before labels. It seems most programs follow the kernel code style.
mxlgv requested changes 2026-02-21 20:34:09 +00:00
Dismissed
@@ -5,3 +4,1 @@
tup.rule("echo lang fix " .. ((tup.getconfig("LANG") == "") and "en_US" or tup.getconfig("LANG")) .. " > %o", {"lang.inc"})
tup.rule({"piano.asm", extra_inputs = {"lang.inc"}}, FASM .. " %f %o " .. tup.getconfig("KPACK_CMD"), "piano")
tup.rule("keymap.asm", FASM .. " %f %o", "piano.map")
Owner

Why is there no compression via kpack?

Why is there no compression via kpack?
Author
Owner

For the logic to work, it must be unpacked in “byte per key” format, and unpacking during execution does not make much sense in this case, since it only occupies one sector of the floppy disk anyway.

For the logic to work, it must be unpacked in “byte per key” format, and unpacking during execution does not make much sense in this case, since it only occupies one sector of the floppy disk anyway.
mxlgv marked this conversation as resolved
@@ -0,0 +3,4 @@
; Piano - Default Keymap (256 bytes)
; Copyright (C) 2025 KolibriOS team
;
; Contributor Burer - Main code
Owner

Move co-authors to the commit body

Move co-authors to the commit body
mxlgv marked this conversation as resolved
Burer added 1 commit 2026-03-01 07:27:47 +00:00
apps/piano: tweak copyright header
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 55s
Build system / Build (pull_request) Successful in 16m12s
a0a27e7c5a
Co-authored-by: Doczom <mixa.frolov2003@gmail.com>
Co-authored-by: qullarwee
Burer added 1 commit 2026-03-01 07:31:46 +00:00
apps/piano: cleanup to previous
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 26s
Build system / Build (pull_request) Successful in 9m27s
3adbd6d770
mxlgv requested changes 2026-03-02 17:18:05 +00:00
Dismissed
@@ -908,0 +522,4 @@
dd 0
dd 256
dd keymap
db 'piano.map', 0
Owner

@Burer
It reads from the working directory; therefore, when launched from the menu, a warning appears that the file was not found.

@Burer It reads from the working directory; therefore, when launched from the menu, a warning appears that the file was not found.
Author
Owner

Should be fixed now.

Should be fixed now.
mxlgv marked this conversation as resolved
Burer added 1 commit 2026-03-07 09:04:49 +00:00
apps/piano: fix CWD path, refactor code
Some checks failed
Build system / Check kernel codestyle (pull_request) Successful in 1m11s
Build system / Build (pull_request) Failing after 2m25s
e3272c4b2d
Burer added 1 commit 2026-03-07 09:08:34 +00:00
apps/piano: fix to previous
All checks were successful
Build system / Check kernel codestyle (pull_request) Successful in 29s
Build system / Build (pull_request) Successful in 17m15s
347c29a0d3
mxlgv approved these changes 2026-03-07 19:50:27 +00:00
mxlgv added the
PR
Ready to merge
label 2026-03-07 19:50:37 +00:00
mxlgv force-pushed rewrite-piano from 347c29a0d3 to 2a5f73351b 2026-03-07 19:51:13 +00:00 Compare
mxlgv merged commit b7d50b8243 into main 2026-03-07 20:10:52 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KolibriOS/kolibrios#302