Niveles De Abstraccion
written by blas.v
About languages, human and computer programing. Partially inspired by memes.
The goal for the hackathon was to feature a unique minting interface and make collectors become co-creators.
For the Mintig UI, I decided to go retro and embrace the look of old software, a mix of win95/98, Bios setup, stuff coded in pascal, vb6, etc. I wanted the minting ui to feel like some shareware software for making banners from 2001. In some way I think it's like the actual state of crypto.
My take on giving the collectors a role as co-creators was about giving them the protagonism by letting them add dynamic text, the idea started as subtitles and later i figured out that the same format could be used for ascii art also. By using web-safe fonts, any language could be included by the minter, giving a lot of room for expression/inclusion.
project name project name project name
IDEA + GRAPHICS
The idea of subtitles came, in part, from memes and tumblr-era gifs. Some memes become a format, and the message transmitted will depend on the text given.The same way a scene of a movie can change its tone depending on the music.
The graphics are minimal. 3 invisibly entangled Levels representing different abstractions, each with it's own complexites.
Saying the same things with different words, coding a "hello world" in js, c++ or Assembler.
TECHNICAL ASPECTS + WAYS TO MINT
I choosed to code a SRT file reader/maker into the token, so that the collector gets different choices. Add a srt file already created ( Could be part of a movie, series, documentary) or make one directly with the custom UI provided.
What's an srt?, ChatGPT says:
SRT, which stands for SubRip Subtitle format, is a widely used file format for storing subtitles or captions for videos. It is a plain text file format that contains information about the timing and text of each subtitle or caption displayed during a video. SRT files are commonly used in the film and television industry and are supported by most video players and editing software.
Here's a basic structure of an SRT file:
1
00:00:00,000 --> 00:00:02,500
This is the first subtitle.
2
00:00:03,000 --> 00:00:05,000
This is the second subtitle.
Each subtitle entry consists of the following components:
- A sequential number, starting with 1, that identifies the subtitle. ( not used in the code )
- A timecode indicating when the subtitle should appear and disappear. It's in the format: hh:mm:ss,ms (hours, minutes, seconds, milliseconds).
- The actual text of the subtitle.
By attaching the register of the token's runtime to the timecodes of a srt file that's saved as a bytes param, we get something like a frame by frame text-output coding language.
When you think about subtitles, most of the time it will be only 2 lines of text at a time, erasing that limit enables a whole new world.
Both examples below would be valid and will print the text on screen for 2.5 seconds counting from zero, once the token is loaded:
1
00:00:00,000 --> 00:00:02,500
- is this a regular subtitle?
- yes, only two lines..
1
00:00:00,000 --> 00:00:02,500
██╗ ██╗██╗ ███████╗██╗ ██╗██╗ ██╗ █████╗ ███████╗██╗ ██╗
██║ ██║██║ ██╔════╝╚██╗██╔╝██║ ██║██╔══██╗██╔════╝██║ ██║
███████║██║ █████╗ ╚███╔╝ ███████║███████║███████╗███████║
██╔══██║██║ ██╔══╝ ██╔██╗ ██╔══██║██╔══██║╚════██║██╔══██║
██║ ██║██║ ██║ ██╔╝ ██╗██║ ██║██║ ██║███████║██║ ██║
╚═╝ ╚═╝╚═╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝
If you split the lines from the second example, set the duration of each line to 0.1-0.2 seconds and the gap to 0 seconds, you'll get an ASCII animation:
On the console it would look like this ( text parsed as a srt file):
In the token could look like this:
Let's say that you want to add some part of a movie or series. I'll use the first chapter of a series called DEVS:
1. Download the subitle file in whatever language you desire.
2. Search for the text that you want to include.
283
00:30:17,951 --> 00:30:21,454
The life we lead,
with all its apparent chaos,
284
00:30:21,722 --> 00:30:24,157
is actually a life on tramlines.
285
00:30:25,158 --> 00:30:30,831
Prescribed.
Undeviating. Deterministic.
286
00:30:32,633 --> 00:30:34,935
I know it doesn't feel that way,
Sergei.
287
00:30:36,202 --> 00:30:39,105
We fall into an illusion
of free will,
The issue here is that the timecode of the selected text starts at 00:30:17,951.
If you save it as a new srt file and select it to be displayed it will work, but it will take 30 minutes for the text to show.
You can solve this by making ChatGPT a third co-creator.
With this prompt followed by the text that you want to display, ChatGPT will change the timecodes so the subtitles start as soon as the token is loaded
"Modify the timestamps in the provided SRT file so that the subtitles start from zero while maintaining the original time intervals between the subtitles. Please provide the adjusted version of the SRT file with the updated timestamps."
ChatGPT will return:
That's it. Copy the text, save it as something.SRT and load it with the main subtitles menu.
That's all.
It's been coded with an old netbook, so it should run everywhere. The code is not minified, I tried to make it super easy to read.
index.html - Fxhash snippet and menus as divs.
s.css - Styles.
index.js - Main code.
fxdef.js - Definition of the fxParams / selection of the html elements.
f.js - All the functions used.
Libs.
lzma-worker.js - This library is used to compress the subtitles and save storage. The text will be added to the blockchain so we need to save space.
p5.js.
ps. thanks to everyone from the fxhackathon channel on the discord server :)