Learn VELATO with Real Code Examples
Updated Nov 26, 2025
Code Sample Descriptions
Hello World in Velato
[MIDI-BASED] The 'Hello World' program is represented as a sequence of notes. For example, middle C (C4) might represent an instruction prefix, with subsequent notes encoding ASCII values for 'H', 'e', 'l', 'l', 'o', etc. The actual program is a .mid file rather than plain text.
A Velato program that prints 'Hello World'. It is encoded as a MIDI file where the sequence of notes corresponds to the ASCII codes of the characters.
Simple Addition in Velato
[MIDI-BASED] Sequence of notes: C4 -> instruction prefix for load A, D4 -> value 3, E4 -> load B, F4 -> value 5, G4 -> add, A4 -> output result. The program is a .mid file.
Adds two numbers using Velato MIDI instructions encoded as note sequences.
Loop Example in Velato
[MIDI-BASED] Notes: C4 -> setup counter, D4 -> start loop, E4 -> increment, F4 -> check condition, G4 -> jump to loop start if not done, A4 -> output final value. Encoded in a .mid file.
Demonstrates looping using repeated MIDI note patterns to increment a counter.
Conditional Branch in Velato
[MIDI-BASED] Notes: C4 -> load variable, D4 -> compare to threshold, E4 -> if greater jump to label, F4 -> else instructions, G4 -> label target, H4 -> continue. Encoded in a .mid file.
Uses Velato MIDI sequences to perform an if-else branch based on a value.
String Output in Velato
[MIDI-BASED] Notes: C4 -> output start, D4 -> ASCII 'H', E4 -> ASCII 'i', F4 -> ASCII '!', G4 -> output end. The program is stored in a .mid file.
Outputs a string character by character using MIDI-encoded ASCII values.
Multiplication in Velato
[MIDI-BASED] Notes: C4 -> load A, D4 -> load B, E4 -> multiply, F4 -> store result, G4 -> output. Program is a .mid file.
Multiplies two numbers using a sequence of MIDI instructions.
Decrement Example in Velato
[MIDI-BASED] Notes: C4 -> set counter, D4 -> decrement, E4 -> check if zero, F4 -> jump if not zero, G4 -> output. Encoded in .mid file.
Decreases a counter using MIDI instructions repeatedly.
Nested Loop Example in Velato
[MIDI-BASED] Notes: C4 -> outer loop start, D4 -> inner loop start, E4 -> increment, F4 -> check inner, G4 -> jump inner start, H4 -> check outer, I4 -> jump outer start, J4 -> output. Stored in a .mid file.
Shows nested loops with MIDI note sequences representing inner and outer loops.
Array Handling in Velato
[MIDI-BASED] Notes: C4 -> load array, D4 -> access index, E4 -> modify value, F4 -> iterate, G4 -> output array. Program is encoded in .mid file.
Represents array operations using MIDI sequences for load, store, and iterate.
Function Call Example in Velato
[MIDI-BASED] Notes: C4 -> define function, D4 -> function instructions, E4 -> call function, F4 -> return, G4 -> output result. Encoded as .mid file.
Defines and calls a simple function using MIDI instruction patterns.