[L2Ork-dev] Hello, and a rough plan on how to port K12 mode for GSoC

Coniine Dieu coniinedieu at gmail.com
Mon Mar 25 12:10:11 EDT 2019


Hi list!

I'm Zhang Shaoqian, a student from National University of Singapore, and of
course very excited about the GSoC 2019 opportunity. Above all, thanks all
for
Purr Data. As a self-proclaimed musician I find it absolutely beautiful and
empowering, and by reading the source code I come to understand the
tremendous
endeavors put into this. Thank you.

Now a bit more about GSoC. Under the name nerrons and with this email
address, I
have a few very elementary modifications merged into master (!257, !260 and
!270) since January, the last one about our building system (which "humans
cannot reason about", according to Jonathan). I've been thinking about how
to
port K12 mode since I have more experience in the frontend. During the past
few
weeks I've read all the nw.js code, a portion of the legacy TCL code and
the C
code, and spent some time with the K12 mode of pd-l2ork on Linux. Here's my
observations and how I roughly plan to tackle the problem. In case this
isn't
readable, here's a Google Docs link to the same thing:
https://tinyurl.com/pdk12plan

- Make all k12 abstractions usable again:
  - Good news! (heavily) modifying C code doesn't seem necessary, since all
k12
    abstractions are built with existing objects. We don't even need to add
the
    gui_ functions in pdgui.js. Actually I got K12 patches working already,
    link at the end.
  - Put the patches in the "extra" folder in the installation directory.
Need to
    modify the build system for that.
  - Get the pretty pics working.
    - Update respective pd files in l2ork_addons/K12 with the correct paths
of
      the icon and the gop background image.
    - Seems like absolute path is needed for the [image] in abstractions to
find
      correct resources, otherwise it will look under the current working
      directory. Need to find a way to generate absolute path just like the
old
      @pd_extra.
    - Adjust the layout in the gop area, so that the background image
doesn't
      cover up inlets, outlets and the border of the gop area. Currently it
      looks a bit off after simply updating the path; Need to either
automate
      this or manually do it.
  - Index help files for k12 abstractions. If we decide to keep popups in
purr's
    k12 mode (while l2ork forbids popup), make sure they show up when right
    clicking on the abstraction and clicking help.
- Maintain a list of k12 abstractions with correct order, to be used in the
k12
  frame later. We probably need another json file for this.
- Change menu bar items:
  - In File, add "show k12 demos"
  - Hide complicated menus, keep only File, Edit and Windows (cuz mac
requires
    the "windows" menu, if I'm not wrong)
    - Remove find-related entries in Edit, and similarly anything related
to find
- Display tooltips on the inlets and outlets of k12 abstractions. Should be
  simple using JS hover events.
- Add a k12 frame: a <div> besides the canvas's <svg>. Can be structured in
an
  HTML file and styled with CSS Grid. Things to take care of:
  - Handling geometry:
    - Set a different minimum height and width of patch windows so k12 frame
      doesn't get cropped
    - Make sure geometry-related functions acknowledge the k12 frame,
      e.g. zooming, optical zoom, etc. If we put the k12 frame into the
<body>
      of pd_canvas.html I think it won't be frustrating.
  - Layout of the k12 frame:
    - A button that switches on/off edit mode and changes pic when switching
      (icons/edit.png & icons/perform.png).
    - Two tabs of control/sound categories (icons/data.png, data_on.png,
      sound.png, sound_on.png).
    - A bunch of buttons of k12 abstractions from the current category,
listed
      in a predefined order.
  - Make sure we have tooltips for everything.
  - Add keyboard shortcuts.
  - (Nice-to-have) Make a toggle that switches the frame on/off.
"display:none;"
    might prove useful here.
- Add a hidden preset_hub to all k12 canvases, using negative coords and
  %hidden%.
  - In frontend, prevent the PH from being seen or selected in any way (just
    don't include it in the DOM instead of using "display:none;", I guess?)
  - Make sure demos have nice presets.
  - Do enough testing and make sure preset_hub works as intended. (This
seems
    like stating the obvious, but I think it's quite important, given that
kids
    might mess around)
- (Optional) Hide the console by default. Nw.js should have APIs for this.

Please kindly point out if I missed out anything. I would really appreciate
it
if I can get feedback on this "proposal-of-proposal" and then I'll start
writing
the proper proposal, hopefully getting accepted, of course :-) Also, I
managed
to make one of the K12 demos working with the latest Purr Data. I messed up
the
sequencer so it sounds experimental, the borders of the abstractions aren't
displaying elegantly, there are two sets of images, but it works. Google
Drive
link: https://tinyurl.com/pdk12demo

Looking forward to hearing from you!

Cheers
Shaoqian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://disis.music.vt.edu/pipermail/l2ork-dev/attachments/20190326/59124b6d/attachment.html>


More information about the L2Ork-dev mailing list