You forgot to create the midi_event container. If you will check the log of Pixilang during launching your app, you will see this error: "Variable midi_event is not initialized. Default value = 0.".

midi_event is the container with numbers; so the midi_event[ i ] is a number. And when you write noteNumber=midi_event, noteNumber is just a variable with some number, it is not a container. So your code noteNumber="0" does not make sense, because "0" is a container. You should write something like: noteNumber=0

2) Dollar sign is the prefix of the local variable.
A - global variable; available in any place of your program.
$A - local variable; available only within a function.
For example you have a function:

4) WHY IS IT SCROLLING LEFTWARD!?!?!?!?
Because you use strcat() which is add your text to the $berg every time.
When you write dt("note number",noteNumber), "note number" is the container which is created once during the Pixilang program compilation.
strcat() adds to selected container.
sprintf() clears and the adds.
You should write something like this:

Excellent, my bads, sorry I did panic. Sorry about the attitude!
with midi_event=new(1,1,INT8) properly declared/initialized I can't even get the weird values I was trying to show... working well now... uh...

I'm still unclear on why $berg wasn't an empty string with each call, however.
$berg = "" does what? is there a way to say $berg= "new empty string and I mean it?"

Also, and here's my problem probably: " If you will check the log of Pixilang "
How do I do that on OSX?
On pc I notice you have a pixilang_console.exe, is there a way to get compile-time error feedback on OSX? I tried running "terminal" alongside but nope.
Or is there a way to set pixilang to "Stop on every little discrepancy" aka "verbose?"

on my fn() scope question, I guess I was confused: declared variables are indeed passed by value, I thought I was getting "passed by reference" behavior with certain containers or something... I'll let you know when I figure out what I was talking about... Oh, I'm terrible at programming

I'm still unclear on why $berg wasn't an empty string with each call, however.
$berg = "" does what? is there a way to say $berg= "new empty string and I mean it?"

This is quote from Pixilang manual:
str = "Hello" //"Hello" is the string container with five 8-bit characters (UTF-8 encoding).
//This container (with string) will be created only once, during the bytecode generation.
So this string is unique for the whole program. If you will change it - it will be changed forever.

$berg = "" - is not creating the new empty string. This string is already created for you during bytecode generation stage. Here is the process of compilation and running of your program:

you select your *.pixi file with code;

compilation process:

generating bytecode;

creating the containers for your strings; for example, container 1 for the string "some string", and container 2 for the string "";

running;

and now this code $berg="" is equivalent to this $berg=2, and this code $str="some string" is equivalent to this $str=1; so your strings are just constants.

Also, and here's my problem probably: " If you will check the log of Pixilang "
How do I do that on OSX?

Ah, yes... Good question :) I'm Linux user...
You can find this log somewhere on your disk. Just search for the "pixilang_log.txt" file.
Of course it is not the best solution. I will try to improve this in the next updates.

run-time substitution, that explains everything -- no not run-time substitution... generating byte code... so it goes through and allocates containers, like registers for every container the source says it will ever need... hmm...

Read the manual? But that's cheating!!

I didn't find pixilang_log.txt
maybe I'll switch to a PC laptop for pixilang