Friday 30 December 2011

IBNIZ - a hardcore audiovisual virtual machine and an esoteric programming language

Some days ago, I finished the first public version of my audiovisual virtual machine, IBNIZ. I also showed it off on YouTube with the following video:

As demonstrated by the video, IBNIZ (Ideally Bare Numeric Impression giZmo) is a virtual machine and a programming language that generates video and audio from very short strings of code. Technically, it is a two-stack machine somewhat similar to Forth, but with the major execption that the stack is cyclical and also used at an output buffer. Also, as every IBNIZ program is implicitly inside a loop that pushes a set of loop variables on the stack on every cycle, even an empty program outputs something (i.e. a changing gradient as video and a constant sawtooth wave as audio).


How does it work?

To illustrate how IBNIZ works, here's how the program ^xp is executed, step by step:

So, in short: on every loop cycle, the VM pushes the values T, Y and X. The operation ^ XORs the values Y and X and xp pops off the remaining value (T). Thus, the stack gets filled by color values where the Y coordinate is XORed by the X coordinate, resulting in the ill-famous "XOR texture".

The representation in the figure was somewhat simplified, however. In reality, IBNIZ uses 32-bit fixed-point arithmetic where the values for Y and X fall between -1 and +1. IBNIZ also runs the program in two separate contexts with separate stacks and internal registers: the video context and the audio context. To illustrate this, here's how an empty program is executed in the video context:

The colorspace is YUV, with the integer part of the pixel value interpreted as U and V (roughly corresponding to hue) and the fractional part interpreted as Y (brightness). The empty program runs in the so-called T-mode where all the loop variables -- T, Y and X -- are entered in the same word (16 bits of T in the integer part and 8+8 bits of Y and X in the fractional). In the audio context, the same program executes as follows:

Just like in the T-mode of the video context, the VM pushes one word per loop cycle. However, in this case, there is no Y or X; the whole word represents T. Also, when interpreting the stack contents as audio, the integer part is ignored altogether and the fractional part is taken as an unsigned 16-bit PCM value.

Also, in the audio context, T increments in steps of 0000.0040 while the step is only 0000.0001 in the video context. This is because we need to calculate 256x256 pixel values per frame (nearly 4 million pixels if there are 60 frames per second) but suffice with considerably fewer PCM samples. In the current implementation, we calculate 61440 audio samples per second (60*65536/64) which is then downscaled to 44100 Hz.

The scheduling and main-looping logic is the only somewhat complex thing in IBNIZ. All the rest is very elementary, something that can be found as instructions in the x86 architecture or as words in the core Forth vocabulary. Basic arithmetic and stack-shuffling. Memory load and store. An if/then/else structure, two kinds of loop structures and subroutine definition/calling. Also an instruction for retrieving user input from keyboard or pointing device. Everything needs to be built from these basic building blocks. And yes, it is Turing complete, and no, you are not restricted to the rendering order provided by the implicit main loop.

The full instruction set is described in the documentation. Feel free to check it out experiment with IBNIZ on your own!


So, what's the point?

The IBNIZ project started in 2007 with the codename "EDAM" (Extreme-Density Art Machine). My goal was to participate in the esoteric programming language competition at the same year's Alternative Party, but I didn't finish the VM at time. The project therefore fell to the background. Every now and then, I returned to the project for a short while, maybe revising the instruction set a little bit or experimenting with different colorspaces and loop variable formats. There was no great driving force to insppire me to finish the VM until mid-2011 after some quite succesful experiments with very short audiovisual programs. Once some of my musical experiments spawned a trend that eventually even got a name of its own, "bytebeat", I really had to push myself to finally finishing IBNIZ.

The main goal of IBNIZ, from the very beginning, was to provide a new platform for the demoscene. Something without the usual fallbacks of the real-world platforms when writing extremely small demos. No headers, no program size overhead in video/audio access, extremely high code density, enough processing power and preferrably a machine language that is fun to program with. Something that would have the potential to displace MS-DOS as the primary platform for sub-256-byte demoscene productions.

There are also other considerations. One of them is educational: modern computing platforms tend to be mind-bogglingly complex and highly abstracted and lack the immediacy and tangibility of the old-school home computers. I am somewhat concerned that young people whose mindset would have made them great programmers in the eighties find their mindset totally incompatible with today's mainstream technology and therefore get completely driven away from programming. IBNIZ will hopefully be able to serve as an "oldschool-style platform" in a way that is rewarding enough for today's beginninng programming hobbyists. Also, as the demoscene needs all the new blood it can get, I envision that IBNIZ could serve as a gateway to the demoscene.

I also see that IBNIZ has potential for glitch art and livecoding. By taking a nondeterministic approach to experimentation with IBNIZ, the user may encounter a lot of interesting visual and aural glitch patterns. As for livecoding, I suspect that the compactness of the code as well as the immediate visibility of the changes could make an IBNIZ programming performance quite enjoyable to watch. The live gigs of the chip music scene, for example, might also find use for IBNIZ.


About some design choices and future plans

IBNIZ was originally designed with an esoteric programming language competition in mind, and indeed, the language has already been likened to the classic esoteric language Brainfuck by several critical commentators. I'm not that sure about the similarity with Brainfuck, but it does have strong conceptual similarities with FALSE, the esoteric programming language that inspired Brainfuck. Both IBNIZ and FALSE are based on Forth and use one-character-long instructions, and the perceived awkwardness of both comes from unusual, punctuation-based syntax rather than deliberate attempts at making the language difficult.

When contrasting esotericity with usefulness, it should be noted that many useful, mature and well-liked languages, such as C and Perl, also tend to look like total "line noise" to the uninitiated. Forth, on the other hand, tends to look like mess of random unrelated strings to people unfamiliar with the RPN syntax. I therefore don't see how the esotericity of IBNIZ would hinder its usefulness any more than the usefulness of C, Perl or Forth is hindered by their syntaxes. A more relevant concern would be, for example, the lack of label and variable names in IBNIZ.

There are some design choices that often get questioned, so I'll perhaps explain the rationale for them:

  • The colors: the color format has been chosen so that more sensible and neutral colors are more likely than "coder colors". YUV has been chosen over HSV because there is relatively universal hardware support for YUV buffers (and I also think it is easier to get richer gradients with YUV than with HSV).
  • Trigonometric functions: I pondered for a long while whether to include SIN and ATAN2 and I finally decided to do so. A lot of demoscene tricks depend, including all kinds of rotating and bouncing things as well as more advanced stuff such as raycasting, depends on the availability of trigonometry. Both of these operations can be found in the FPU instruction set of the x86 and are relatively fundamental mathematical stuff, so we're not going into library bloat here.

  • Floating point vs fixed point: I considered floating point for a long while as it would have simplified some advanced tricks. However, IBNIZ code is likely to use a lot of bitwise operations, modular bitwise arithmetic and indefinitely running counters which may end up being problematic with floating-point. Fixed point makes the arithmetic more concrete and also improves the implementability of IBNIZ on low-end platforms that lack FPU.
  • Different coordinate formats: TYX-video uses signed coordinates because most effects look better when the origin is at the center of the screen. The 'U' opcode (userinput), on the other hand, gives the mouse coordinates in unsigned format to ease up pixel-plotting (you can directly use the mouse coordinates as part of the framebuffer memory address). T-video uses unsigned coordinates for making the values linear and also for easier coupling with the unsigned coordinates provided by 'U'.

Right now, all the existing implementations of IBNIZ are rather slow. The C implementation is completely interpretive without any optimization phase prior to execution. However, a faster implementation with some clever static analysis is quite high on the to-do list, and I expect a considerable performance boost once native-code JIT compilers come into use. After all, if we are ever planning to displace MS-DOS as a sizecoding platform, we will need to get IBNIZ to run at least faster than DOSBOX.

The use of externally-provided coordinate and time values will make it possible to scale a considerable portion of IBNIZ programs to a vast range of different resolutions from character-cell framebuffers on 8-bit platforms to today's highest higher-than-high-definition standards. I suspect that a lot of IBNIZ programs can be automatically compiled into shader code or fast C-64 machine language (yes, I've made some preliminary calculations for "Ibniz 64" as well). The currently implemented resolution, 256x256, however, will remain as the default resolution that will ensure compatibility. This resolution, by the way, has been chosen because it is in the same class with 320x200, the most popular resolution of tiny MS-DOS demos.

At some point of time, it will also become necessary to introduce a compact binary representation of IBNIZ code -- with variable bit lengths primarily based on the frequency of each instruction. The byte-per-character representation already has a higher code density than the 16-bit x86 machine language, and I expect that a bit-length-optimized representation will really break some boundaries for low size classes.

An important milestone will be a fast and complete version that runs in a web brower. I expect this to make IBNIZ much more available and accessible than it is now, and I'm also planning to host an IBNIZ programming contest once a sufficient web implementation is on-line. There is already a Javascript implementation but it is rather slow and doesn't support sound, so we will still have to wait for a while. But stay tuned!

248 comments:

«Oldest   ‹Older   201 – 248 of 248
jewelry said...

dark web

The Dark Web and Tor Browser are becoming more important as the world wakes up to the dark side of cyberspace. Hackers and malicious online content are a huge problem for internet users. A hacker can break into your computer, access your personal information, and transfer it to their own server, leaving you to wither in the wake. But with Tor Browser and the Dark Web, you can feel safe and assured that your web browsing and transactions are kept safe and secure from the prying eyes of hackers and other internet predators. Here are some reasons why you should use the Dark Web and Tor Browser.

Jr. SEO MAN said...

The best short article I encountered a variety of years, write something concerning it on this web page.
Archives
eprimefeed.com
Latest News
Economy
Politics
Tech
Sports
Movies
Fashion

best ERP in India said...

Amazing article, I strongly advise everyone to read as much as possible

noyon said...

dark web links

These days, we are all too familiar with the advantages of dark web links. They are not a new thing at all, as they have been around for quite some time now. In fact, any person who is familiar with online marketing will already be aware of them, because links on the dark side of the net are nothing new. But what many people do not realize is that they can be very useful tools when it comes to getting traffic to your website. Although this particular type of link-building service has been around since the early nineties, people do not do very much with them anymore due to the rise of search engines. But before you dismiss them altogether, let us examine how useful they can be in this day and age.

Samuel Badree said...

Thanks for sharing your thoughts. colourist logo

rohit said...

top 10 crm software in india

crm software in india
thank you for this excellent information . it is very helping and am learning many things . you are doing good. thank you so much

rohit said...

Your article is so insightful and detailed that I got to learn new concepts and develop my skills.. thank you so much
best crm software in india

aaraon said...
This comment has been removed by the author.
David Paul said...

The experience was so basic and lighthearted. Gotten endorsement in minutes.
Car Loans for Bad credit
Bad Credit Loans

Loans for people with bad credit said...

I've generally adored find alongside my Mastercard , The credit cycle was basic. There isn't anything I can say terrible regarding allbadcreditloan
Bad Credit Loans Personal
Bad Credit Loans for people

Personal Loans for Bad credit said...

Exceptionally direct method for merging exorbitant interest obligation to a simple one installment
Online Loans for Bad credit
Loans for people with bad credit

personal loans for bad credit said...

Getting and getting credit was basic and simple. Delight to work with Allbadcreditloan
Personal Loans for Bad credit
Loans for Bad credit

Homeloan4badcredit said...

So easy to get an individual advance. My obligations are paid in not any more than 3 days and the remainder of the advance is stored in my financial balance.I energetically suggested
Personal Loans for Bad credit
Loans for Bad credit

Quick loan said...

the application cycle online was straightforward and quick. In any case, what made the experience the best was the credit master. He was valuable, capable, and welcoming. He talked me through the whole connection. he went over the things I had entered in. He found a couple of mistakes I had made. corrected them. Overall he made right now basic collaboration a prevalent experience. A real individual touch.
Online Loans for Bad credit
Loans for people with bad credit

Instant loans for low credit score said...

While calling these folks you will get somebody in this country; not an outside country; who can comprehend and help you. They make the cycle simple.
Bad Credit Loans Personal
Bad Credit Loans for people

allbadcreditloan said...

The experience was quick, simple, and productive! I had the option to supplant my electrical box because of this!
Loans for Bad Credit Online
Loans for Bad credit score

Installment Loans for Bad credit said...

The credit analyst made it uncommonly easy to survey portions. Composing got were incredibly illustrative and client care specialists were capable.
No check credit loan
Installment Loans for Bad credit

Fast loan with terrible credits said...

Just accepted my third credit with Discover. Simple to apply, quick reaction, and receipt of assets.
Car Loans for Bad credit
Bad Credit Loans

Allbadcreditloan said...

It was speedy and simple to get this advance. I particularly needed an advance choice that would not expand the quantity of years that I would convey obligation by too much.
Auto Loans for Bad credit
Urgent Loans for Bad credit

Loans for Bad credit score said...

Everybody I addressed in the individual advances dept was astonishing. Applying for the advance was so natural and I included my cash inside 2-3 days.
Small Loans for Bad credit
Home Loans for Bad credit

The Hydrocodone said...

In the wake of getting an email that I qualified for a loan, I had the option to look at numbers in minutes! I was immediately endorsed and the application cycle was speedy and extremely straightforward :) Couldn't suggest a superior interaction in the event that you want an advance!!
Auto Loans for Bad credit
Urgent Loans for Bad credit

Loans for people with bad credit said...

The loan number cruncher is the best apparatus. I would return to them assuming I at any point need an advance once more. Strongly suggested.
Loans for Bad Credit Online
Loans for Bad credit score

personal loans for bad credit said...

I was so apprehensive with regards to going through the most common way of acquiring a credit on the web, I've never gotten it done, however abcl made the interaction so quick and basic.
No check credit loan
Installment Loans for Bad credit

Xnxx said...

When you have completed the steps above you will be able to access all Disney Plus content on your FireStick device. It lets you stream your favorite content without any hassle.
Disney Plus Begin Code
Disneyplus.com/begin

expertriya said...

Your article so unique and usefull and thanx for sharing this content.
Sexologist in Delhi

Unknown said...

HOW TO DEAL (AND PLAY) 메이저토토사이트추천 RULES OF DRAWING CARDS

H&R Block said...

It is the most popular and demanding software because of its amazing features and affordability. Visit activate.hrblock.com/crj and own H&R Account to get started with it.
Activate.hrblock.com/crj
Register H&R Block Activation Code
Activate.hrblock.com/crj
Activate.hrblock.com/crj

ซูโม่ said...

Positive site, where did u come up with the information on this posting?I have read a few of the articles on your website now, and I really like your style. Thanks a million and please keep up the effective work.สล็อตเว็บใหญ่

ซูโม่ said...

I was surfing net and fortunately came across this site and found very interesting stuff here. Its really fun to read. I enjoyed a lot. Thanks for sharing this wonderful information.สล็อต ฝาก-ถอน true wallet ไม่มี บัญชีธนาคาร

ซูโม่ said...

Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post.บาคาร่าวอเลท

ซูโม่ said...

I have read your blog it is very helpful for me. I want to say thanks to you. I have bookmark your site for future updates.เว็บสล็อตเว็บตรง

Lucy Lohan said...

Take this prescription by mouth on an empty stomach as coordinated by your PCP, generally once per night.

Buy Ambien Online
ambien online

Anonymous said...

Why is this medication prescribed?
Phentermine and topiramate extended-release (long-acting) capsules are used to help adults who are obese or who are overweight and have weight-related medical problems to lose weight and to keep from gaining back that weight. Phentermine and topiramate extended-release capsules must be used along with a reduced calorie diet and exercise plan. Phentermine is in a class of medications called anorectics. It works by decreasing appetite. Topiramate is in a class of medications called anticonvulsants. It works by decreasing appetite and by causing feelings of fullness to last longer after eating.

phentermine diet pills

phentermine online

Lucy Lohan said...

Losing weight and keeping it off can decrease the various well-being hazards of obesity, including heart disease, diabetes, high circulatory strain, and more limited life.


online doctors who prescribe phentermine

phentermine weight loss pills

NdakJoleh said...

Percetakan Buku Online Di Jakarta
Cetak Buku Murah di Jakarta Timur
Tempat Cetak Novel Murah di Jakarta Timur
Jasa Cetak Buku Murah 24 Jam di Jakarta Timur
Tempat Cetak Spanduk Murah di Jakarta Timur
Tempat Cetak Banner Murah 24 Jam di Rawamangun Jakarta Timur
Tempat Jasa Print Skripsi Murah 24 Jam di Rawamangun Jakarta Timur
Tempat Jasa Fotocopy 24 Jam di Rawamangun Jakarta Timur
Tempat Cetak Spanduk 24 Jam di Jakarta Timur

โรซ่า said...

Hello, we have a game to recommend.

รีวิวเครื่องสำอาง
สูตรบาคาร่า
บอล
เลขเด็ด
jili-เว็บตรง

Thank you for your interest."

Anmol Verma said...

Thank you so much for providing good quality information. I think it would not have been easy to collect this information and organize it in an easy to understand way.
sexologist in delhi

namrathaseo said...

Great job for publishing such a beneficial web site. excellent post.
tamilrockers

Fleek IT Solutions said...

Great share! Thanks for the information. Keep going!

Rodrigo said...

Check my latest article on quality casinos at Europeanbusinessreview

emergingindiagroup said...

This is an extremely well written article. I’ll make sure to bookmark it and return to read more of your useful information. Thanks for the post. I’ll definitely return.merging India Analytics is promoted by professionals from IITs, IIMs and Experts from Education and IT Industry. We are one of the India’s fastest growing Analytics/ IT consulting and training companies.

Sharon Johnson said...


Wishing you the best of success with your upcoming article. You will learn the answer in this article. Make a phony entire Twitter profile and amuse your friends with it. Even celebrities might be profiled by you to deceive your pals. You should add a profile picture. Check out this profile to discover more about fake twitter account generator.

Educativeminds said...

Boarding high school. We'd like to present ourselves as one of the country's premier K-12 and higher education advisory and Outsourcing marketing partnerships. True to its name,

sandraking155 said...

It is beneficial to invest in presentations because such assignments are on the rise. Often there are special powerpoint projects for students that you need to do in a matter of ours. But the task is exciting!

Anonymous said...

Hello to all

Fullz with good credit scores are available
CC's with cvv & Dumps
SSN DOB USA Fullz/Pros
EIN Fullz
COmbos/Logs

Legit fullz with guarantee results
Fresh spammed & valid info
-----------------------------------------
ICQ/Telegram @killhacks
WA +92 317 2721122
Email exploit dot tools4u @ gmail dot com
Wickr/Skype @peeterhacks
-----------------------------------------
Tools & tutorials are also available
Hacking Carding Spamming Scripting Stuff
Mailers Senders C-panels
Brutes Crackers

Legit tools & tutorials
Fresh & verified tools

gif445 said...

"Thanks for sharing ths valuable content!.

I've found a web portal and APIs can be very useful when sending bulk SMS offers. The thing I like most about them is that they allow me to send really targeted messages based on specific criteria, which makes it easier for me to increase sales and customer satisfaction at the same time!

Click to know more:
bulk sms
bulk sms india
dlt registration
"

emilywilson said...

Very useful post. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. Really its great article. Keep it up.attorney to contest protective order virginia

Artificial Intelligence said...

https://aivsu.blogspot.com/2023/07/how-ai-is-changing-daily-work-routine.html

Artificial Intelligence refers to computer systems that can perform tasks that typically require human intelligence. These tasks encompass a broad range of activities, from simple calculations to complex decision-making processes. AI systems are designed to learn from data, identify patterns, and adapt their actions accordingly, often leading to more efficient and accurate outcomes.

«Oldest ‹Older   201 – 248 of 248   Newer› Newest»