Flaksator – Introduction to song generation details

Well, I’m afraid this is about time to stop procrastination. As one of fellow bloggers suggested (thanks Andrzej) I’m switching this series into English. There are at least few reasons: wider audience, more ways to promote my blog and most importantly – to share some nuances of Polish language with English speaking people that might be interested in.

Well, where to start…

Song structure

Every song has a title. And then body. Or not – if it is instrumental one. So, first decision is to randomize that case – let say giving an instrumental creation a 5% chance. The fun factor comes from sometimes ridiculous brain associations on how such stupid title can be realized by only instrumental performance. See few examples and try imagining those tracks:

ORGIASTYCZNI DOKTORZY - Orgiastic Doctors
NAJBARDZIEJ SPLUGAWIONY UPIÓR - The most defiled phantom
WYRACHOWANI RESTAURATORZY (KABŁĄKOWATY KONIEC MISIA) - Selfish (calculated) restaurateurs (baily end of teddy-bear)
SPODNIE W OKNIE BOKU KLEJU (NADCHODZI PRADZIAD) - Pants (trousers ;-)) in the window on the side of glue (Here it comes the great grandfather)

Titles being stored in separate file (Titles.txt) and are treated just as regular verse (will be discussed later). Sometimes titles are being decorated with extra parts from TitleEx.txt to increase fun factor even more 😉

When the song has a body there are few possibilities:

  • Either it is symmetric, having stanzas and refrains one after another
  • Either it’s not – and has different pieces, some being stanzas, some are being refrains, some being instrument solo parts etc.

Even when it has refrains there are another two possibilities:

  • All refrains are same
  • All refrains are different (at list partially).

Both stanzas and refrains consist of two-line verses and are being generated almost the same way as titles, though using different schema source (Verses.txt).
Any special sections come from two more resource files:
Elements.txt for more docorative pieces, including these:

Przerażające Solo     - frightening solo
Chór                  - choir
Przygrywka            - prelude
Solo na Perkusji      - percussion solo
Elektroniczne Solo    - electronic solo
{AN1NE} Solo          - [some_other_randomized_kind_of_solo] solo
Solo na Bałałajce     - balalaika solo
Chlupot Krwi          - squelch of blood
Trzask Kości          - sounds of bone crushing
Jęki Agonii           - agony groans
Demoniczna Inkantacja - demonic incantation
Pochrząkiwanie        - grunting

and StaticElements.ini that names all possible constant track pieces:

[StaticElements]
INTER=Interludium
INSTR=Instrumental
END=Zakończenie
REF=Refren
BRIDGE=Przejście

I’m not really proud of this engine and soon will start redesigning it in hope of creating something more flexible and resulting with more interesting results. I hope you stay with me to see this.

Verse syntax

Syntax is bad. Syntax is evil. Has two versions of which one does not work… The bad thing is that I have only Nouns and Adjectives implemented… I started working on Nouns, but this was too complicated in the time being. Why?

English is quite simple at this matter (please fix me wherever I did mistake – I’m not PhD in either Polish or English ;-)):

  1. Adjectives are always the same and appear only before Noun, like “green car
  2. Nouns are always the same, sometimes same word can also be a Verb, but you might get that from the context
  3. Verbs are always the same. To point person you use proper (personal) pronouns, and to build proper tense expression you use other helpers like have, had, been etc. Sometimes use postfiks “-ed”.
  4. There are however some irregular pieces: many verbs and in past tenses and some adjectives grade irregularly.

However. What in English is mostly treated as irregular, in Polish is on quite regular basis:

  1. In Polish we use postfixes everywhere, with Nouns, Adjectives and Verbs. And other grammar pieces too.
  2. With Nouns we use postfiks not only to remark gender of the word but mainly to specify something almost not present in English at all – cases
  3. Adjectives can be used before and after the Noun (“zielony samochód” and “samochód zielony”) – while latter is treated as outdated it is still valid.
  4. Adjectives have gender – directly attached to the gender of the Noun. But this is not always this simple – sometimes they are different. And it uses postfiks to show this: masculine car will be “zielony“, while neuter tree will be “zielone” and feminine purse will be “zielona“. Which all will be translated to simple “green”.
  5. Many adjectives are irregular.
  6. Verbs use postfixes that change according to the tense and person. And, same like in English – many are irregular. You might only guess how complicated this is and how many there are.
  7. Most of the time when we add postfiks to the root of the word it mutates. For example “pies” (dog) in Nominative becomes “ps+***” (psa, psu, psom, psach…) in all other cases. (Those could appear in following sentences: This is dog. I need a dog. I’m looking at the dog. I’m looking at the dogs. I’m talking about the dogs.)
  8. Sometimes in different cases root might have different mutation.
  9. Not event mentioning, that postfixes them self might mutate depending of the root they are attached to. But I’m going to talk about this later.

So this is why Polish language is so hard – not because alphabet or pronunciation. But those damn, irregular postfixes mess. If you run “Flaksator” (the old one), you might find “Edit” menu, where you might look on some Adjectives (Nouns are already fixed, but read-only) – how they look differently in different cases and grades:

OldUi_Adjectives2

But to the point. You might guess, that I can’t just design verses to be like “bla bla [Noun], bla balas [Adjective] [Verb] bla.” I must always connect them properly and use altogether. Adjective must match the Noun, and Verb must match both and all pronouns – or vice versa.
This is not an easy taks. Old format, very restrictive was like:

Wnet usłyszałem {NN1T} {NG1P},
zabić mi kazał {NC1P} nikczemnika.

You could see two Nouns working together on another Noun. Original verse was something like “I just heard a (1)call from my (2)ancestors, he ordered me to kill the scoundrel (2)warrior”. In most cases it will not generate sane results, when just adding some random Nouns. They will just not work properly to construct this dependency. Not even mentioning that “scoundrel / nikczemnik” here is also untranslated Noun, however working as Adjective…

Therefore I’d started implementing a new syntax, using categories. But it’s not working. And is hard to write manually. I’ll save you not showing that.
Or another attempt on building even more flexible, adaptable syntax. I tried to build both at the same time in 2009 and failed. I need to find another way.
It looks like there is a very long road ahead. Stay with me if you dare 😉

And, as usual in the series, some ready lyrics from old code:

BOKI W GARDLE ULICZNEJ UMYWALKI

(Elektroniczne Solo)

Było to kiedyś, bardzo dawno,
Grzyb pogrzebany opętał mnie.
Już Cię widzę, jeszcze moment, jeszcze dziewica,
Ja już czuję jak drewno me się w Ciebie wbija.
By spełnić łańcuchową kaplicę moją,
Zabrałem pancerz ostrego skarbnika.

Było to kiedyś, bardzo dawno,
Rzeźnik raniony opętał mnie.
Chwyciłem napar w konceptualnym koszmarze,
Nadejdą dziś rzeczy tłuste fale.
Zanurzam boczek w Twojej stolicy, oddaje się przeraźliwej dziewicy.

Rzucasz mi się u zbroi na zniszczenia o goleń mnie błagając,
Mnie to nie rusza, “Zginiesz jak misiaczek!” – krzyczę, decyzję Ci przebijając.
W świetle księżyca błyszczy mój topór,
Twa głowa ekscentryczny stawia mu opór.
Zanurzam Żyda w Twojej służbie, oddaje się elektrycznej biedronce.

Wyjmuję miecz, robię zamach i mierzę w Ciebie,
To Twe ostatnie chwile, już za moment będziesz w niebie.
Wnet usłyszałem pancerz chirurga,
Zabić mi kazał sanitariusza nikczemnika.
Leżysz już u moich stóp, rozjuszona i ssąca masa,
Jeden za drugim padniecie wszyscy, salonowa żydów rasa.

W chwale Szatana, macham siekierą – przerażający cios,
Głowa odpada a krew się leje – taki już Twój los.
W kurzu pancerza stała służba,
Usposobienie świata tak się tam poniewiera.
Ekscentryczne ręce mnie opętały, zabijam dziś dla straszliwej bramy.

Ah, we have here even just mentioned example: “Wnet usłyszałem pancerz chirurga, Zabić mi kazał sanitariusza nikczemnika.” It translates quite nicely into “I’ve just heard my surgeon’s armor talking. It ordered me to kill the scoundrel paramedic.” I wonder what happened out there in the clinic 😉