Vide diary – 29th of April 2016

Again – another week gone by. Malban should be doing some more programming, but he doesn’t feel like it, and he just remembered, that the diary hadn’t had an update in a week. Sooo rather than doing some more vecci stuff – he chose to collect the last advances and write about it.

ympanel2The mentioned YM-update after the last entry did continue…
As you can see in the image, now you can edit a whole platoon of things, in short:




  • you can edit all (PSG) registers of a YM “row”
  • you can enable/disable registers in the player and source generator (the player code also can handle disabled registers)
  • you can add and delete rows of ym-files
  • you can insert other ym-files or write parts of ym-files
  • you can save/insert AYFX effects into ym-records
  • loading all ym-formats is now supported (although samples are not implemented)

Recording of ym-files has also been slightly updated.

Malban looked also at some other trackers that might be usefull to support, namely Arkos Tracker, but the “standard” player uses self modifying code, so as of yet Malban chose not to “translate” the player code (yet).

The other Tracker that was looked at was WYZ Tracker, that one looks rather nice, and Malban would have liked to write a player, but after having been  in (short) contact with the author he decided to postpone that to a time he was more bored than now.
He asked about the data structure of the resulting music files – and the answer was (in my words) “Uh, that is so complex – I can not tell you, please take the code of a Z80 player routine and translate that…” (the code by the way is commented in Spanish – which Malban does not speak).

Malban also thought of writing other players:
– that “on the fly” could add AYFX – sound effects to channels while playing a YM-file

– and/or a player that would use the “volume” of the PSG to play digitized sound, rather than the direct DAC method which is used by the “normal” sample routines (dunno if that would work)(which than again could be played in just one channel)

But after some thinking he decided that would be better put into Vide 2.0 – or being left out as an exercize to the adapt users of Vide :-).

Vecci – Vectors!
The next thing to do in the line of planning are vectors. Editing vectors/converting/importing/exporting vectors.

Malban started of by adding “standard” loading/saving routines, vectors, vectorlists and animations (list of vectorlists) are now saved as xml files. All “input” of vectors will internally be translated to one format and will be exportable to other formats (depending on the list type).

After implementing better persistency routines Malban stepped back und looked at Vedi again, or rather at the menu:vimagemanu

“convert image to vector”


The idea to that menu entry was born while doing the “badapple” tryouts (see blog: BadApple).
A while Malban thought about implementing his own “conversion” routines, but after doing some diggings for algorithms and what would be needed, he decided to take a shortcut and let the main conversion being done by potrace. There are binaries available for nearly every OS-brand. Vide now sports a new directory: “externalTools” which contains binaries for win/mac/linux in 32bit and 64bit version. Potrace is called from Vide, my testing showed it works on my systems rather well (tested: Win32, Win64, Mac64 and Linux32).VecImage1

Here is the current (not fully done) imagery:

Not all the work is done by potrace… mind you.

Potrace does only accept b/w images and only bmp, but can generate (with the right settings) nice vector images, even usable for vectrex purposes.
If interested, for the images Malban used the same values SpritesMods used, namely:

potrace -a0 -O1 -ooutFile inFile


-a0       :is alphamax = 0 -> output has no smooth corners, it is a 
           polygon, not a spline
-O1       :set the curve optimization tolerance, one is very high 
           inaccurate but less vectors
-bgeojson :output in json format (easy readable)


Generating the BW image is done by using a simple “Threshold”-Filter (threshold can be configured). The resulting json-datafile which is generated by potrace is read by Vide and post-processed. Here again Malban took lead by the groundwork done by SpritesMods – as you can see in the above image, two other parameters can be set:

  • minimal vector length
  • minimal vector angle

Vectors which are shorter then the given length are “joined” to their neighbours (or totally omitted) and vectors which have an angle less than the given value in relation to each other are also joined. Using these reduction scheme one can generate “tolerable” vector images.

Below you can see the same “base” conversion settings as used above, but with different reduction settings:

VecImage2 VecImage3 VecImage4

… well, thats all for today…

See ‘ya!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.