User:Gilbert189/Stratta

From Esolang
Jump to navigation Jump to search
This article is just a draft. See User:Gilbert189#Drafts for more info.

The idea for Stratta came from how we decided to represent how computers "talk" in most creative works. Instead of the more or less canonical V.34 or some other/similar standard on the ITU-T V-Series Recommendations, we decided to represent them with random beeps of differing frequencies, usually in chromatic scale. Don't get me wrong, I don't hate this way of signifying communication. If it communicates its user "oh, the computer is talking/calculating something", then it has fulfilled its purpose.

The concept of communication using beeps of broad frequencies isn't exactly fictional. If you're into ham radio, you might know about Olivia, a MFSK communication protocol. Like the acronym implies, it uses beeps of differing frequencies, in a range of 250 or 500 or 1000 Hz in case of Olivia. Nevertheless, an idea went into my head to somehow make this into a language; not a programming language, but a language that computers could use to converse by statements and questions with other computers, much like how humans does it... or something idk.

Statements

Stratta statements are essentially RDF triples. Each statement consists of three terms: the subject, the predicate, and the object. Stratta uses Wikidata as the main knowledge base (explaining the list of prefixes on the term struct), though other IRIs are allowed.

They are represented with the prefix name and term name separated by :. IRIs are placed between angle brackets:

wd:Q188709
<http://docs.python.org/3/>

Terms could refer to a known or unknown term. This is called a pro-term (or a variable). Using it is mandatory as Stratta doesn't have recursion (in the linguistic sense).

Pro-terms are represented with an identifier with a ? prefix, like how it's done in SPARQL. However, the identifier would be encoded as a number when it is "spoken".

?music

Terms

The term struct is as such:

  1. A single bit, denoting the component type:
  2. A single bit, denoting continuation of this triple:
    • If it's set, the next term will share the same subject and predicate as the current one.
    • If it's clear, this triple ends, and the next term will be the next triple's subject.
    • These have no meaning for terms other than objects.

Modulating into beeps

To modulate the data into beeps, split the resulting bitstream into 5 bits. Padding is put on the LSB, so 10 becomes 10111. With an accumulator A initially set to 0, add the 5 bits (plus 1 to avoid two beeps having the same frequency) in order, modding it by 33. In each addition, beep in the frequency of 512+(32×A) Hz. Beeps can be as long as you want, but 20 beeps per second is recommended. It's recommended to taper the beeps to reduce clicking. Don't let beeps collide with each other; it's even better if you space them out. A single beep cannot be any shorter than 0.01 seconds.

Examples

Is it true?
?thing wdt:P31 wd:Q7949.
10110 010001010010110 001100100101010010001000110
10110010001010010110001100100101010010001000110
Me and my brother like to eat on The Jazz Café.

wd:Q18086706 wdt:P3373 ?brother; 
    p:P3373 wds:1.
wds:1 rdf:type wikibase:Statement; 
    ps:P3373 ?brother; 
    pq:P1039 wd:Q10861465.
?group rdf:type rdf:Bag.
wd:Q18086706 rdf:_1 ?group.
?brother rdf:_2 ?group.
?group wdt:P1034 wd:Q6168202.

wd:Q18086706 wdt:P3373 ?2.
?1 p:P3373 wds:1.
wds:1 rdf:t wikibase:Stm.
?1 ps:P3373 ?2. 
?1 pq:P1039 wd:Q10861465.
?3 rdf:t rdf:B.
wd:Q18086706 rdf:_1 ?3.
?2 rdf:_2 ?3.
?3 wdt:P1034 wd:Q6168202.

0011000000010101000000001010001000101000110 0100011000000100100100110 10110
1110 0100111000000100100100110 001110110
001110110 00000001010010011110 00011000001010110101001001100000010011110
1110 0101001000000100100100110 10110
1110 0101110001010100000011 10110 00110010001010001000100101000101000100011
100110 00000001010010011110 0000001010100011110
0011000000010101000000001010001000101000110 0000001111 100110
10110 00000011011 100110
100110 01000100000101000000110 00110010100001000000010010100010100000110

001100000001010100000000101000100010100011001000110000001001001001101011011100100111000000100100100110001110110001110110000000010100100111100001100000101011010100100110000001001111011100101001000000100100100110101101110010111000101010000001110110001100100010100010001001010001010001000111001100000000101001001111000000010101000111100011000000010101000000001010001000101000110000000111110011010110000000110111001101001100100010000010100000011000110010100001000000010010100010100000110

You can hear this Stratta statement with this fish script:

for x in 6 7 18 2 4 13 31 7 0 4 5 15 20 14 9 28 10 11 30 7 25 20 24 14 15 21 26 24 28 29 18 7 12 4 7 23 5 16 25 28 5 12 2 31 22 25 13 15 10 14 19 30 2 12 21 9 18 14 6 7 28 15 7 9 20 28 13 30 0 21 22 0 5 16 23 24 7 27 6 7 14 10 4 17 2 3 24 26 11 30 14 31 1 12 18 19 14
    sox -n -t f32 -r 48000 - synth 0.035 sine (math 512 + $x x 32) fade q 0.01 -0 0.01 pad 0 0.015
end | play -t f32 -r 48000 -

[[Category:Non-textual]]