Sonic Pi - en to ro translation catalogue (1364 entries)

en: 1 Welcome to Sonic Pi
ro: 1 Bine ai venit

en: Welcome friend :-)
ro: Bine ai venit, prietene :)

en: Welcome to Sonic Pi. Hopefully you're as excited to get started making crazy sounds as I am to show you. It's going to be a really *fun* ride where you'll learn all about music, synthesis, programming, composition, performance and more.
ro: Bine ai venit. Sper ca esti la fel de nerabdator sa incepi sa creezi sunete interesante pe cat sunt eu sa iti arat cum. Va fi o experienta cu adevarat amuzanta, pe parcursul careia vei invata despre muzica, sinteza sunetelor, programare, compozitie, interpretare si multe altele.

en: But wait, how rude of me! Let me introduce myself - I'm [Sam Aaron](https://twitter.com/samaaron) - the chap that created Sonic Pi. You can find me at [@samaaron](http://twitter.com/samaaron) on Twitter and I'd be more than happy to say hello to you. You might also be interested in finding out more about my [Live Coding Performances](https://youtube.com/samaaron) where I code with Sonic Pi live in front of audiences.
ro: Dar, stai, am fost cam nepoliticos! Sa ma prezint - sunt [Sam Aaron](http://twitter.com/samaaron) - tipul care a creat Sonic Pi. Ma poti gasi la [@samaaron](http://twitter.com/samaaron) pe Twitter si voi fi incantat sa te salut. S-ar putea sa te intereseze sa afli mai multe despre sesiunile mele de [Pogramare live](https://youtube.com/samaaron) in care programez in Sonic Pi in direct in fata spectatorilor.

en: If you have any thoughts, or ideas for improving Sonic Pi - please pass them on - feedback is so helpful. You never know, your idea might be the next big feature!
ro: Daca ai idei sau sugestii pentru imbunatatirea Sonic Pi, te rog sa mi le transmiti - feedback-ul este foarte de folos. Nu se stie, poate ideea ta se va transforma intr-o functionalitate de scucces!

en: This tutorial is divided up into sections grouped by category. Whilst I've written it to have an easy learning progression from start to finish, feel very free just to dip in and out of sections as you see fit. If you feel that there's something missing, do let me know and I'll consider it for a future version.
ro: Tutorialul este impartit in sectiuni grupate pe categorii. Desi eu l-am scris ca sa permita ofere o trecere lina de la inceput la sfarsit, poti sa mergi direct la sectiunile care te intereseaza. Daca ti se pare ca ceva lipseste, anunta-ma si voi lua in considerare ideea ta pentru versiunile viitoare.

en: Finally, watching others live code is a really great way to learn. I regularly stream live on [https://youtube.com/samaaron](http://youtube.com/samaaron) so please do drop by, say hi and ask me lots of questions :-)
ro: A urmari pe cineva in timp ce programeaza live este o buna metoda de a invata. Eu transmit live in mod regulat sesiunile mele la [https://youtube.com/samaaron](https://youtube.com/samaaron), deci te rog sa treci pe acolo, sa ne salutam si sa iti raspund la intrebari :)

en: OK, let's get started...
ro: Sa incepem...

en: 1.1 Live Coding
ro: 1.1 Programare live

en: Live Coding
ro: Programare live

en: One of the most exciting aspects of Sonic Pi is that it enables you to write and *modify code live* to make music, just like you might perform live with a guitar. This means that given some practice you can take Sonic Pi on stage and gig with it.
ro: Una din chestiile cele mai tari legate de Sonic Pi este ca iti permite sa scrii si sa modifici codul in direct pentru a crea muzica, la fel ca atunci cand canti in direct la chitara. Asta inseamna ca dupa ce exersezi putin, poti lua Sonic Pi pe scena si sa interpretezi cu el.

en: Free your mind
ro: Elibereaza-ti mintea

en: Before we get into the real details of how Sonic Pi works in the rest of this tutorial, I'd like to give you an experience of what it's like to live code. Don't worry if you don't understand much (or any) of this. Just try to hold onto your seats and enjoy...
ro: Inainte de a trece la detaliile despre cum functioneaza Sonic Pi, as vrea sa experimentezi ce inseamna sa programezi live. Nu te speria daca nu intelegi prea multe din asta. Tine-te bine in scaun si bucura-te de muzica...

en: A live loop
ro: O bucla live

en: Let's get started, copy the following code into an empty buffer:
ro: Sa incepem. Copiaza codul de mai jos intr-un buffer gol:

en: live_loop :flibble do
      sample :bd_haus, rate: 1
      sleep 0.5
    end
ro: ```
    live_loop :flibble do
      sample :bd_haus, rate: 1
      sleep 0.5
    end
    ```

en: Now, press the `Run` button and you'll hear a nice fast bass drum beating away. If at any time you wish to stop the sound just hit the `Stop` button. Although don't hit it just yet... Instead, follow these steps:
ro: Acum, apasa butonul 'Executa' si vei auzi un ritm de toba bass. Daca la un moment dat vrei sa opresti sunetul, apasa pe butonul 'Stop'. Dar deocamdata nu-l apasa... Mai bine urmeaza pasii astia:

en: Make sure the bass drum sound is still running
ro: Asigura-te ca sunetul de toba bass inca se aude

en: Change the `sleep` value from `0.5` to something higher like `1`.
ro: Schimba valoarea 'sleep' din '0.5' in ceva mai mare, cum ar fi '1'.

en: Press the `Run` button again
ro: Apasa din nou pe 'Executa'

en: Notice how the drum speed has changed.
ro: Observi ca viteza s-a schimbat.

en: Finally, *remember this moment*, this is the first time you've live coded with Sonic Pi and it's unlikely to be your last...
ro: *Tine minte momentul asta*, e prima data cand ai programat live, dar probabil nu va fi ultima...

en: Ok, that was simple enough. Let's add something else into the mix. Above `sample :bd_haus` add the line `sample :ambi_choir, rate: 0.3`. Your code should look like this:
ro: OK, a fost destul de simplu. Sa mai adaugam ceva. Deasupra liniei 'sample :bd_haus' adauga linia `sample :ambi_choir, rate: 0.3`. Codul ar trebui sa arate asa acum:

en: live_loop :flibble do
      sample :ambi_choir, rate: 0.3
      sample :bd_haus, rate: 1
      sleep 1
    end
ro: ```
    live_loop :flibble do
      sample :ambi_choir, rate: 0.3
      sample :bd_haus, rate: 1
      sleep 1
    end
    ```

en: Now, play around. Change the rates - what happens when you use high values, or small values or negative values? See what happens when you change the `rate:` value for the `:ambi_choir` sample just slightly (say to `0.29`). What happens if you choose a really small `sleep` value? See if you can make it go so fast your computer will stop with an error because it can't keep up (if that happens, just choose a bigger `sleep` time and hit `Run` again).
ro: Acum poti sa te joci. Schimba valorile pentru ritm - ce se intampla cand folosesti valori mai mari sau mai mici, sau valori negative? Vezi ce se intampla cand schimbi 'rate:' pentru ':ambi_choir' doar putin (sa zicem la 0.29). Ce se intampla daca alegi o valoare foarte mica pentru 'sleep'? Vezi daca poti sa il faci sa se miste atat de repede incat calculatorul sa dea o eroare fiindca nu poate tine pasul (in cazul asta alege o valoare mai mare prentru 'sleep si apasa din nou 'Run').

en: Try commenting one of the `sample` lines out by adding a `#` to the beginning:
ro: Incearca sa transformi in comentariu una dintre liniile 'sample' adaugand un '#' la inceput:

en: live_loop :flibble do
      sample :ambi_choir, rate: 0.3
    #  sample :bd_haus, rate: 1
      sleep 1
    end
ro: ```
    live_loop :flibble do
      sample :ambi_choir, rate: 0.3
    #  sample :bd_haus, rate: 1
      sleep 1
    end
    ```

en: Notice how it tells the computer to ignore it, so we don't hear it. This is called a comment. In Sonic Pi we can use comments to remove and add things into the mix.
ro: Observi ca i-am spus calculatorului sa ignore acea linie, deci nu o vom auzi. Acesta se numeste comentariu. In Sonic Pi putem folosi comentariile pentru a adauga sau inlatura sunete.

en: Finally, let me leave you something fun to play with. Take the code below, and copy it into a spare buffer. Now, don't try to understand it too much other than see that there are two loops - so two things going round at the same time. Now, do what you do best - experiment and play around. Here are some suggestions:
ro: La final, iti voi lasa ceva distractiv cu care sa te joci. Ia codul de mai jos si copiaza-l intr-un buffer gol. Deocamdata nu incerca sa intelegi prea mult, remarca doar ca sunt doua bucle - deci doua lucruri care se reiau in acelasi timp. Acum fa ceea ce faci cel mai bine - experimenteaza si joaca-te cu codul. Uite cateva sugestii:

en: Try changing the blue `rate:` values to hear the sample sound change.
ro: Incearca sa schimbi valorile afisate cu albastru pentru 'rate:' si vezi cum se schimba sunetul.

en: Try changing the `sleep` times and hear that both loops can spin round at different rates.
ro: Incearca sa schimbi valorile pentru 'sleep:' (pauza) si vei observa cum cele doua bucle se reiau cu frecvente diferite.

en: Try uncommenting the sample line (remove the `#`) and enjoy the sound of the guitar played backwards.
ro: Incearca sa inlaturi semnul pentru comentariu ('#') de la linia sample si delecteaza-te cu sunetul de chitara redat de la coada la cap.

en: Try changing any of the blue `mix:` values to numbers between `0` (not in the mix) and `1` (fully in the mix).
ro: Incearca sa schimbi oricare dintre valorile pentru 'mix:' afisate cu albastru cu numere intre '0' (nu intra in mix) si '1' (intra complet in mix).

en: Remember to press `Run` and you'll hear the change next time the loop goes round. If you end up in a pickle, don't worry - hit `Stop`, delete the code in the buffer and paste a fresh copy in and you're ready to jam again. Making mistakes is how you'll learn the quickest...
ro: Tine minte sa apesi 'Executa" si vei auzi schimbarea data viitoare cand se reia bucla. Daca ramai blocat, nu te panica - apasa 'Opreste', sterge codul din buffer, adu o noua copie si esti gata sa improvizezi din nou. Facand greseli vei invata cel mai rapid...

en: Now, keep playing and experimenting until your curiosity about how this all actually works kicks in and you start wondering what else you can do with this. You're now ready to read the rest of the tutorial.
ro: Continua sa te joci si sa experimentezi pana cand vei deveni curios cum merge de fapt chestia asta si te vei intreba ce altceva mai poti face cu ea. Acum esti pregatit sa citesti restul tutorialului.

en: So what are you waiting for...
ro: Deci, ce mai astepti?

en: 1.2 Exploring the Interface
ro: 1.2 Explorarea interfetei

en: The Sonic Pi Interface
ro: Interfata Sonic Pi

en: Sonic Pi has a very simple interface for coding music. Let's spend a little time exploring it.
ro: Sonic Pi are o interfata foarte simpla pentru a programa muzica. Hai sa o descoperim.

en: *A* - Play Controls
ro: *A* - Control Redare

en: *B* - Editor Controls
ro: *B* - Control Editor

en: *C* - Info and Help
ro: *C* - Informatii si Ajutor

en: *D* - Code Editor
ro: *D* - Editor Cod

en: *E* - Prefs Panel
ro: *E* - Panou Optiuni

en: *F* - Log Viewer
ro: *F* - Vizualizare Jurnal

en: *G* - Help System
ro: *G* - Sistem Ajutor

en: *H* - Scope Viewer
ro: *H* - Vizualizare Osciloscop

en: A. Play Controls
ro: A. Control Redare

en: These pink buttons are the main controls for starting and stopping sounds. There's the *Run* button for running the code in the editor, *Stop* for stopping all running code, *Save* for saving the code to an external file and *Record* to create a recording (a WAV file) of the sound playing.
ro: Butoanele roz sunt pentru pornirea/oprirea sunetelor. Butonul 'Executa' este pentru pornirea codului din editor, 'Opreste' pentru oprire, 'Salveaza' pentru salvarea intr-un fisier extern si 'Inregistreaza' pentru a crea un fisier WAV pornind de la sunetele care sunt redate.

en: B. Editor Controls
ro: B. Control Editor

en: C. Info and Help
ro: C. Informatii si Ajutor

en: These blue buttons give you access to information, help and preferences. The *Info* button will open up the information window which contains information about Sonic Pi itself - the core team, history, contributors and community. The *Help* button toggles the help system (*G*) and the *Prefs* button toggles the preferences window which allows you to control some basic system parameters.
ro: Butoanele albastre iti dau acces la informatii, ajutor si optiuni. Butonul *Info* deschide fereastra de informatii despre Sonic Pi - echipa de baza, istoric, colaboratori si comunitate. Butonul *Help* comuta afisarea sistemului de ajutor (*G*), iar butonul *Optiuni* comuta afisarea unei ferestre in care poti modifica anumiti parametri de sistem.

en: D. Code Editor
ro: D. Editor de Cod

en: This is the area where you'll write your code and compose/perform music. It's a simple text editor where you can write code, delete it, cut and paste, etc. Think of it like a very basic version of Word or Google Docs. The editor will automatically colour words based on their meaning in the code. This may seem strange at first, but you'll soon find it very useful. For example, you'll know something is a number because it is blue.
ro: Aceasta este zona in care vei scrie cod si vei compune/reda muzica. Este un editor de text simplu in care poti scrie cod, poti sa il stergi, sa copiezi/lipesti bucati din el, etc. Este un fel de versiune limitata de Word sau Google Docs. Editorul afiseaza automat anumite cuvinte cu culori, in functie de sensul lor in cadrul codului. Poate parea ciudat la inceput, dar in curand vei vedea ca e foarte util. De exemplu, vei recunoaste un numar dupa faptul ca este albastru.

en: E. Prefs Panel
ro: E. Panou de Optiuni

en: Sonic Pi supports a number of tweakable preferences which can be accessed by toggling the *prefs* button in the Info and Help button set. This will toggle the visibility of the Prefs Panel which includes a number of options to be changed. Examples are forcing mono mode, inverting stereo, toggling log output verbosity and also a volume slider and audio selector on the Raspberry Pi.
ro: Sonic Pi permite schimbarea anumitor parametri la care se poate ajunge apasand butonul *optiuni* in zona Informatii si Ajutor. Acesta va comuta afisarea Panoului Optiuni care contine un numar de parametri ce pot fi schimbati. Exemple de astfel de parametri sunt: forteaza modul mono, inversare canale stereo, comutare nivel de detaliu jurnal. Exista si un potentiometru de volum si selectie de iesire audio pentru Raspberry Pi.

en: F. Log Viewer
ro: F. Afisare Jurnal

en: When you run your code, information about what the program is doing will be displayed in the log viewer. By default, you'll see a message for every sound you create with the exact time the sound was triggered. This is very useful for debugging your code and understanding what your code is doing.
ro: Cand rulezi codul din buffer, in zona de afisare a jurnalului se afiseaza informatii despre ce face programul la un moment dat. Implicit, vei vedea un mesaj pentru fiecare sunet pe care il creezi, cu momentul exact in care a fost activat. Acest lucru este foarte util cand vrei sa iti depanezi codul sau sa intelegi ce face codul tau.

en: G. Help System
ro: G. Sistem Ajutor

en: One of the most important parts of the Sonic Pi interface is the help system which appears at the bottom of the window. This can be toggled on and off by clicking on the blue *Help* button. The help system contains help and information about all aspects of Sonic Pi including this tutorial, a list of available synths, samples, examples, FX and a full list of all the functions Sonic Pi provides for coding music.
ro: In sfarsit, una dintre cele mai importante parti ale interfetei Sonic Pi este reprezentata de sistemul de ajutor care apare in partea de jos a ferestrei. Aceasta poate fi afisata/ascunsa apasand pe butonul albastru *Ajutor*. Sistemul de ajutor contine informatii utile despre toate elementele Sonic Pi, inclusiv acest tutorial, o lista a sintetizatoarelor disponibile, sample-uri, exemple, efecte (FX) si o lista a tuturor functiilor pe care Sonic Pi le ofera pentru programarea muzicii.

en: H. Scope Viewer
ro: H. Osciloscop

en: The scope viewer allows you to see the sound you're hearing. You can easily see that the saw wave looks like a saw and that the basic beep is a curvey sine wave. You can also see the difference between loud and quiet sounds by the size of the lines. There are 3 scopes to play with - the default is a combined scope for the left and right channels, there is a stereo scope which draws a separate scope for each channel. Finally there is a Lissajous curve scope which will show the phase relationship between the left and right channels and allows you to draw pretty pictures with sound (https://en.wikipedia.org/wiki/Lissajous_curve).
ro: Osciloscopul ofera o reprezentare grafica a sunetelor pe care le auzi. Poti sa observi cum unda fierastrau chiar arata ca niste dinti de fierastrau si cum banalul bip este o unda sinusoidala. Poti observa de asemenea diferenta intre sunetele slabe si cele puternice urmarind dimensiunea liniilor. Exista 3 osciloscoape cu care te poti juca - cel implicit combina canalele stanga si dreapta, cel stereo afiseaza separat fiecare canal, iar al treilea prezinta relatia de faza intre cele doua canale folosind Curbele lui Lissajous (https://en.wikipedia.org/wiki/Lissajous_curve) si permite crearea de imagini interesante folosind sunetul.

en: 1.3 Learning through Play
ro: 1.3 Invatarea prin joaca

en: Learning through Play
ro: Invatarea prin joaca

en: Sonic Pi encourages you to learn about both computing and music through play and experimentation. The most important thing is that you're having fun, and before you know it you'll have accidentally learned how to code, compose and perform.
ro: Sonic Pi incurajeaza invatarea programarii si muzicii prin joaca si incercari. Cel mai important este sa te distrezi, iar fara sa iti dai seama vei invata sa programezi, sa compui si sa interpretezi.

en: There are no mistakes
ro: Nu exista greseli

en: Start Simple
ro: Incepe simplu

en: When you're learning, it's tempting to want to do amazing things *now*. However, just hold that thought and see it as a distant goal to reach *later*. For now, instead think of the *simplest* thing you could write which would be fun and rewarding that's a small step towards the amazing thing you have in your head. Once you have an idea about that simple step, then try and build it, play with it and then see what new ideas it gives you. Before long you'll be too busy having fun and making real progress.
ro: Cand inveti este tentant sa faci lucruri incredibile *acum*. Totusi, stapaneste-ti imboldul si considera asta ca un tel pe care sa il atingi *mai tarziu*. Acum, gandeste-te la *cel mai simplu* lucru pe care l-ai putea crea, care ar putea fi amuzant dar te-ar aduce cu un pas mai aproape de tinta pe care ti-ai propus-o. Cand te-ai decis asupra acestui pas simplu, incearca si construieste-l, joaca-te cu el si vezi ce idei iti mai inspira. Nu va dura mult si vei fi ocupat sa te distrezi si sa progresezi cu adevarat.

en: Just make sure to share your work with others!
ro: Ai grija sa impartasesti creatia ta cu altii!

en: 2 Synths
ro: 2 Sintetizatoare

en: Synths
ro: Sintetizatoare

en: OK, enough of the intros - let's get into some sound.
ro: OK, destul cu introducerea - sa trecem la sunete.

en: In this section we'll cover the basics of triggering and manipulating synths. Synth is short for synthesiser which is a fancy word for something which creates sounds. Typically synths are quite complicated to use - especially analog synths such as Eurorack modules connected together by a mess of wires. However, Sonic Pi gives you much of that power in a very simple and approachable manner.
ro: In aceasta sectiune vom discuta bazele lucrului cu sintetizatoare. De multe ori se foloseste varianta synth, forma prescurtata a cuvantului din engleza (synthesiser), care este un nume mai dichisit pentru ceva care creeaza sunete. De obicei, sintetizatoarele sunt complicat de folosit - mai ales cele analogice cu multe cabluri si module. Totusi, Sonic Pi iti ofera accesul la aceste instrumente puternice intr-o maniera usor de abordat.

en: Don't be fooled by the immediate simplicity of Sonic Pi's interface. You can get very deep into very sophisticated sound manipulation if that's your thing. Hold on to your hats...
ro: Nu te lasa pacalit de simplitatea aparenta a interfetei Sonic Pi. Poti patrunde foarte adanc in manipularea foarte sofisticata sunetelor daca asta iti doresti. Tine-te bine...

en: 2.1 Your First Beeps
ro: 2.1 Primele beep-uri

en: Your First Beeps
ro: Primele tale beep-uri

en: Take a look at the following code:
ro: Priveste codul de mai jos:

en: This is where it all starts. Go ahead, copy and paste it into the code window at the top of the app (the big white space under the Run button). Now, press Run...
ro: De aici incepe totul. Da-i drumul, copiaza acest cod si lipeste-l in fereastra din partea de sus a aplicatiei (spatiul mare alb de sub butonul Executa). Acum, apasa Executa...

en: Intense. Press it again. And again. *And again...*
ro: Intens. Apasa din nou. Si din nou. *Si din nou...*

en: Woah, crazy, I'm sure you could keep doing that all day. But wait, before you lose yourself in an infinite stream of beeps, try changing the number:
ro: Uau, nebunie! Sunt sigur ca ai putea face asta toata ziua. Dar stai, inainte sa te pierzi intr-un sir infinit de beep-uri, incearca sa schimbi numarul:

en: Can you hear the difference? Try a lower number:
ro: Auzi diferenta? Incearca un numar mai mic:

en: *Don't worry* if this means nothing to you - it didn't to me when I first started. All that matters right now is that you know that *low numbers make lower beeps* and *high numbers make higher beeps*.
ro: *Nu te speria* daca treburile astea nu-ti spun nimic - nici mie nu-mi spuneau cand am inceput. Tot ce conteaza acum este ca stii ca "numerele mai mici produc note mai joase* si *numerele mai mari produc note mai inalte*.

en: Chords
ro: Acorduri

en: Playing a note is quite fun, but playing many at the same time can be even better. Try it:
ro: Sa canti o nota este destul de distractiv, dar sa canti mai multe in acelasi timp este si mai bine. Incearca:

en: Jazzy! So, when you write multiple `play`s, they all play at the same time. Try it for yourself - which numbers sound good together? Which sound terrible? Experiment, explore and find out for yourself.
ro: Super! Deci, cand scrii mai multe instructiuni 'play', toate sunt executate in acelasi timp. Incearca si tu - ce numere suna mai bine impreuna? Care suna groaznic? Experimenteaza, exploreaza si descopera singur.

en: Melody
ro: Melodie

en: So, playing notes and chords is fun - but how about a melody? What if you wanted to play one note after another and not at the same time? Well, that's easy, you just need to `sleep` between the notes:
ro: Deci, redarea notelor si a acordurilor este distracitva - dar care e treaba cu melodiile? Ce-ar fi daca ai vrea sa canti notele una dupa alta si nu in acelasi timp? Ei bine, este usor, trebuie doar sa faci o pauza intre note, folosind instructiunea 'sleep' (somn):

en: How lovely, a little arpeggio. So what does the `1` mean in `sleep 1`? Well it means the *duration of the sleep*. It actually means sleep for one beat, but for now we can think about it as sleeping for 1 second. So, what if we wanted to make our arpeggio a little faster? Well, we need to use shorter sleep values. What about a half i.e. `0.5`:
ro: Ce dragut, un mic arpegiu. Ce inseamna '1' in instructiunea 'sleep 1'? Ei bine, inseamna *durata pauzei*. De fapt, inseamna o pauza cu durata de o masura, dar pentru moment putem sa ne gandim la ea ca la o pauza de 1 secunda. Deci, ce facem daca vrem sa facem arpegiul putin mai rapid? Trebuie sa folosim valori mai mici pentru pauze. Ce-ar fi sa incercam cu o jumatate, adica '0.5':

en: Notice how it plays faster. Now, try for yourself, change the times - use different times and notes.
ro: Observi ca acum canta mai rapid. Acum, incearca singur, schimba valorile pentru pauze si pentru note.

en: One thing to try is in-between notes such as `play 52.3` and `play 52.63`. There's absolutely no need to stick to standard whole notes. Play around and have fun.
ro: Un lucru pe care ar trebui sa-l incerci este sa redai note intermediare cum ar fi 'play 52.3' sau 'play 52.63'. Nu esti absolut deloc obligat sa folosesti notele standard. Distreaza-te putin schimband valorile.

en: Traditional Note Names
ro: Numele notelor traditionale

en: For those of you that already know some musical notation (don't worry if you don't - you don't need it to have fun) you might want to write a melody using note names such as C and F# rather than numbers. Sonic Pi has you covered. You can do the following:
ro: Cei care deja stiu notatia muzicala (nu te ingrijora daca tu nu o stii - nu ai nevoie de ea ca sa te distrezi) pot incerca sa scrie o melodie folosind numele notelor, cum ar fi C (Do) sau F# (Fa#) in locul numerelor. Sonic Pi are grija de tine in acesta caz. Poti incerca asta:

en: Remember to put the colon `:` in front of your note name so that it goes pink. Also, you can specify the octave by adding a number after the note name:
ro: Nu uita sa pui doua puncte ':' in fata numelui notei astfel incat sa apara afisat cu roz. De asemenea, poti specifica octava dorita, adaugand un numar dupa numele notei:

en: If you want to make a note sharp, add an `s` after the note name such as `play :Fs3` and if you want to make a note flat, add a `b` such as `play :Eb3`.
ro: Daca vrei sa faci marchezi un diez (sharp in engleza), adauga un 's' dupa numele notei: `play :Fs3`. Pentru bemol (flat in engleza), adauga un 'b': `play :Eb3`.

en: Now go *crazy* and have fun making your own tunes.
ro: Acum dezlantuie-te si distreaza-te cu propriile tale melodii.

en: 2.2 Synth Options
ro: 2.2 Optiuni sintetizatoare

en: Synth Options: Amp and Pan
ro: Optiuni sintetizatoare: Amp (amplitudine) si Pan (pozitionare)

en: As well as allowing you to control which note to play or which sample to trigger, Sonic Pi provides a whole range of options to craft and control the sounds. We'll be covering many of these in this tutorial and there's extensive documentation for each in the help system. However, for now we'll introduce two of the most useful: *amplitude* and *pan*. First, let's look at what options actually are.
ro: Pe langa faptul ca permite alegerea notelor sau sample-urilor pe care le va reda, Sonic Pi ofera o gama larga de optiuni pentru modificarea sunetelor. Vom acoperi mare parte dintre acestea in tutorial si exista o documentatie bogata pentru fiecare dintre ele in sistemul de help (ajutor). Deocmandata, vom face cunostinta cu doua dintre cele mai utile: *amplitudinea (amp)* si *pozitionarea (pan)*. Pentru inceput, sa privim putin ce inseamna de fapt optiunile.

en: Options
ro: Optiuni

en: Sonic Pi supports the notion of options (or opts for short) for its synths. Opts are controls you pass to `play` which modify and control aspects of the sound you hear. Each synth has its own set of opts for finely tuning its sound. However, there are common sets of opts shared by many sounds such as `amp:` and envelope opts (covered in another section).
ro: Sonic Pi ofera suport pentru optiuni (sau opts - prescurtarea din engleza) pentru sintetizatoare. Optiunile sunt parametri pe care ii trasnmiti comenzii 'play' pentru a modifica si controla diferite caracteristici ale sunetului pe care il vei auzi. Fiecare sintetizator are setul sau de optiuni pentru a regla fin sunetul. Totusi, exista si seturi de optiuni comune care se aplica multor sunete, cum ar fi 'amp:' si optiunile legate de anvelopa sunetului (prezentate in alta sectiune).

en: Opts have two major parts, their name (the name of the control) and their value (the value you want to set the control at). For example, you might have a opt called `cheese:` and want to set it with a value of `1`.
ro: Optiunile au doua componente majore, numele parametrului si valoarea acestuia. De exemplu, ai putea avea o optiune numita 'cheese:' si ai dori sa ii atribui valoarea '1'.

en: Opts are passed to calls to `play` by using a comma `,` and then the name of the opt such as `amp:` (don't forget the colon `:`) and then a space and the value of the opt. For example:
ro: Optiunile sunt transmise catre comanda 'play' folosind virgula ',' si apoi numele optiunii, cum ar fi 'amp:' (nu uita ':'), apoi un spatiu si valoarea pentru optiune. De exemplu:

en: (Note that `cheese:` isn't a valid opt, we're just using it as an example).
ro: ('cheese:' nu reprezinta o optiune reala, o folosim doar ca exemplu).

en: You can pass multiple opts by separating them with a comma:
ro: Poti transmite mai multe optiuni, separandu-le prin virgula:

en: The order of the opts doesn't matter, so the following is identical:
ro: Ordinea optiunilor nu conteaza, deci urmatoarea linie are acelasi efect:

en: Opts that aren't recognised by the synth are just ignored (like `cheese` and `beans` which are clearly ridiculous opt names!)
ro: Optiunile care nu sunt recunoscute de sintetizator sunt ignorate (cum este cazul cu 'cheese' si 'beans' care sunt evident niste nume inventate!)

en: If you accidentally use the same opt twice with different values, the last one wins. For example, `beans:` here will have the value 2 rather than 0.5:
ro: Daca din greseala folosesti aceeasi optiune de doua ori, cu valori diferite, ultima castiga. De exemplu, pentru 'beans:' valoarea luata in calcul va fi 2, nu 0.5:

en: Many things in Sonic Pi accept opts, so just spend a little time learning how to use them and you'll be set! Let's play with our first opt: `amp:`.
ro: Mai multe elemente din Sonic Pi accepta optiuni, deci acorda-le putina atentie si invata cum sa le folosesti, pentru ca iti va fi de folos! Sa ne jucam putin cu prima optiune: 'amp:'.

en: Amplitude
ro: Amplitudinea

en: Amplitude is a computer representation of the loudness of a sound. A *high amplitude produces a loud sound* and a *low amplitude produces a quiet sound*. Just as Sonic Pi uses numbers to represent time and notes, it uses numbers to represent amplitude. An amplitude of 0 is silent (you'll hear nothing) whereas an amplitude of 1 is normal volume. You can even crank up the amplitude higher to 2, 10, 100. However, you should note that when the overall amplitude of all the sounds gets too high, Sonic Pi uses what's called a compressor to squash them all to make sure things aren't too loud for your ears. This can often make the sound muddy and strange. So try to use low amplitudes, i.e. in the range 0 to 0.5 to avoid compression.
ro: Amplitudinea spune computerului care este taria sunetului pe care o doresti. *O amplitudine mare produce un sunet puternic*, iar *o amplitudine mica produce un sunet slab*. Asa cum Sonic Pi foloseste numere pentru a reprezenta durate si note, tot la fel foloseste numere pentru a reprezenta amplitudinea. Amplitudinea 0 inseamna liniste (nu vei auzi nimic), in timp ce amplitudineea 1 inseamna volum normal. Poti creste amplitudinea mai mult, la 2, 10, 100. Totusi, vei observa ca atunci cand amplitudinea globala a sunetelor devine prea mare, Sonic Pi foloseste un asa numit compresor pentru a le reduce si a se asigura ca nu devin prea puternice pentru urechile tale. De obicei aceasta face ca sunetele sa fie neclare si ciudate. Incearca deci sa folosesti amplitudini joase, adica in intervalul 0 - 0.5, pentru a evita compresia.

en: Amp it up
ro: Sa crestem amplitudinea

en: To change the amplitude of a sound, you can use the `amp:` opt. For example, to play at half amplitude pass 0.5:
ro: Pentru a schimba amplitudinea unui sunet, poti folosi optiunea 'amp:'. De exemplu, pentru a reda sunetul cu amplitudinea la jumatate, da-i valoarea 0.5:

en: To play at double amplitude pass 2:
ro: Pentru a-l reda la amplitudine dubla, da-i valoarea 2:

en: The `amp:` opt only modifies the call to `play` it's associated with. So, in this example, the first call to play is at half volume and the second is back to the default (1):
ro: Optiunea 'amp:' are efect doar in cadrul instructiunii 'play' din care face parte. Deci, in acest exemplu, primul play va fi cu volumul la jumatate, iar al doilea va reveni la valoarea implicita (1):

en: Of course, you can use different `amp:` values for each call to play:
ro: Desigur, se pot folosi valori diferite pentru 'amp:' pentru fiecare instructiune play:

en: Panning
ro: Pozitionare (panning)

en: Another fun opt to use is `pan:` which controls the panning of a sound in stereo. Panning a sound to the left means that you hear it out of the left speaker, and panning it to the right means you hear it out of your right speaker. For our values, we use a -1 to represent fully left, 0 to represent center and 1 to represent fully right in the stereo field. Of course, we're free to use any value between -1 and 1 to control the exact positioning of our sound.
ro: Alta optiune interesanta este 'pan:' care controleaza pozitionarea sunetului in stereo. Pozitionarea unui catre stanga va face sa il auzi mai puternic in difuzorul din stanga, iar pozitionarea la dreapta inseamna ca il vei auzi mai puternic in difuzorul din dreapta. In Sonic Pi vom folosi -1 pentru a reprezenta un sunet care se aude doar in stanga, 0 pentru un sunet pozitionat central si 1 pentru un sunet care se aude doar in dreapta. Desigur, poti utiliza orice valoare intre -1 si 1 ca sa controlezi exact pozitia sunetului.

en: Let's play a beep out of the left speaker:
ro: Sa redam un beep in difuzorul din stanga:

en: Now, let's play it out of the right speaker:
ro: Acum, sa-l redam in difuzorul din dreapta:

en: Finally let's play it back out of the center of both (the default position):
ro: La final sa-l redam inapoi in centru (in pozitia implicita):

en: Now, go and have fun changing the amplitude and panning of your sounds!
ro: Acum, distreaza-te schimband amplitudinea si pozitionarea sunetelor!

en: 2.3 Switching Synths
ro: 2.3 Alegerea altui sintetizator

en: Switching Synths
ro: Alegerea sintetizatorului

en: Buzzy saws and prophets
ro: Zumzet de fierastraie si profeti

en: A fun sound is the *saw wave* - let's give it a try:
ro: Un sunet interesant este *sunetul fierastrau* - sa il incercam:

en: Let's try another sound - the *prophet*:
ro: Sa incercam alt sunet - *profetul*:

en: How about combining two sounds. First one after another:
ro: Ce-ar fi sa le combinam? Mai intai unul dupa altul:

en: Notice that the `use_synth` command only affects the following calls to `play`. Think of it like a *big switch* - new calls to `play` will play whatever synth it's currently pointing to. You can move the switch to a new synth with `use_synth`.
ro: Observi ca instructiunea 'use_synth' afecteaza doar urmatoarele comenzi 'play'. Poti sa o vezi ca pe un *comutator global* - urmatoarele comenzi 'play' vor rula oricare ar fi sintetizatorul selectat. Pentru a-l trece la o noua pozitie folosesti 'use_synth'.

en: Discovering Synths
ro: Descopera sintetizatoarele

en: Now play around with *switching synths during your music*. Have fun combining synths to make new sounds as well as using different synths for different sections of your music.
ro: Acum joaca-te cu *schimbarea sintetizatorului in timpul muzicii*. Distreaza-te putin combinand sintetizatoarele pentru a crea noi sunete sau folosind diferite sintetizatoare pentru sectiuni diferite din melodie.

en: 2.4 Duration with Envelopes
ro: 2.4 Durata folosind anvelope

en: Duration with Envelopes
ro: Durata folosind anvelope

en: In an earlier section, we looked at how we can use the `sleep` command to control when to trigger our sounds. However, we haven't yet been able to control the duration of our sounds.
ro: Intr-o sectiune anterioara am vazut cum putem folosi comanda 'sleep' pentru a controla cand incep sunetele. Dar nu am reusit inca sa controlam durata sunetelor.

en: In order to give us a simple, yet powerful means of *controlling the duration* of our sounds, Sonic Pi provides the notion of an *ADSR amplitude envelope* (we'll cover what ADSR means later in this section). An amplitude envelope offers two useful aspects of control:
ro: Pentru a ne oferi un mod simplu dar puternic pentru *controlul duratei* sunetelor, Sonic Pi foloseste notiunea de *anvelopa de amplitudine ADSR* (vom vorbi mai tarziu in aceasta sesiune despre ce inseamna ADSR). O anvelopa de amplitudine ofera doua posibilitati de control foarte utile:

en: control over the duration of a sound
ro: controlul asupra duratei unui sunet

en: control over the amplitude of a sound
ro: controlul asupra amplitudinii unui sunet

en: Duration
ro: Durata

en: The duration is the length the sound lasts for. A longer duration means that you hear the sound for longer. Sonic Pi's sounds all have a controllable amplitude envelope, and the total duration of that envelope is the duration of the sound. Therefore, by controlling the envelope you control the duration.
ro: Durata reprezinta lungimea perioadei in care se aude sunetul. O durata mai mare inseamna ca vei auzi sunetul pentru mai mult timp. Toate sunetele din Sonic Pi au o anvelopa de amplitudine controlabila, iar durata totala a anvelopei reprezinta durata sunetului. Ca urmare, controland anvelopa, controlezi durata.

en: The ADSR envelope not only controls duration, it also gives you *fine control over the amplitude of the sound*. All audible sounds start and end silent and contain some non-silent part in-between. Envelopes allow you to slide and hold the amplitude of non-silent parts of the sound. It's like giving someone instructions on how to turn up and down the volume of a guitar amplifier. For example you might ask someone to "start at silence, slowly move up to full volume, hold it for a bit, then quickly fall back to silence." Sonic Pi allows you to program exactly this behaviour with envelopes.
ro: Anvelopa ADSR nu controleaza doar durata, iti ofera si un *control fin asupra amplitudinii sunetului*. Toate sunetele audibile incep si se termina silentios si contin perioade audibile intre aceste limite. Anvelopele iti permit sa determini cum evolueaza amplitudinea partilor nesilentioase. Este ca si cum ai da cuiva instructiuni cum sa regleze in sus si in jos volumul amplificatorului de chitara. De exemplu, ai putea cere cuiva "sa inceapa in liniste, sa dea usor volumul mai tare, sa il mentina un timp, apoi sa-l coboare rapid". Sonic Pi iti permite sa programezi precis acest comportament folosind anvelopele.

en: Just to recap, as we have seen before, an amplitude of 0 is silence and an amplitude of 1 is normal volume.
ro: Ca o scurta recapitulare: asa cum am vazut mai devreme, amplitudinea 0 reprezinta lipsa sunetului, iar 1 este volumul normal.

en: Now, let us look at each of the parts of the envelopes in turn.
ro: Acum, sa luam pe rand fiecare parte a anvelopei.

en: Release Phase
ro: Faza Release

en: The only part of the envelope that's used by default is the release time. This is the time it takes for the synth's sound to fade out. All synths have a release time of 1 which means that by default they have a duration of 1 beat (which at the default BPM of 60 is 1 second):
ro: Singura parte a anvelopei care este folosita implicit este cea de release. Aceasta reprezinta timpul necesar sunetului sintetizatorului sa se stinga. Toate sintetizatoarele au un timp de release 1 care inseamna ca implicit durata este de 1 bataie (la ritmul de 60 BPM - batai pe minut - asta inseamna o secunda):

en: The note will be audible for 1 second. Go ahead and time it :-) This is short hand for the longer more explicit version:
ro: Nota se va auzi timp de 1 secunda. Incearca sa cronometrezi :) Aceasta reprezinta o prescurtare a versiunii mai lungi si mai explicite:

en: Notice how this sounds exactly the same (the sound lasts for one second). However, it's now very easy to change the duration by modifying the value of the `release:` opt:
ro: Observi ca suna exact la fel (sunetul dureaza o secunda). Totusi, acum este foarte usor sa schimbi durata modificand valoarea pentru parametrul 'release:':

en: We can make the synth sound for a very short amount of time by using a very small release time:
ro: Putem face sintetizatorul sa scoata un sunet foarte scurt folosind o valoare foarte mica pentru timpul de release:

en: The duration of the release of the sound is called the *release phase* and by default is a linear transition (i.e. a straight line). The following diagram illustrates this transition:
ro: Durata stingerii sunetului se numeste *faza de release* si implicit presupune o tranzitie liniara (adica in linie dreapta). Diagrama urmatoare ilustreaza aceasta tranzitie:

en: You can therefore change the duration of your sound by changing the release time. Have a play adding release times to your music.
ro: Vei putea deci schimba durata sunetului schimband timpul de release. Joaca-te adaugand valori pentru timpul de release la melodia ta.

en: Attack Phase
ro: Faza de atac

en: By default, the *attack phase* is 0 for all synths which means they move from 0 amplitude to 1 immediately. This gives the synth an initial percussive sound. However, you may wish to fade your sound in. This can be achieved with the `attack:` opt. Try fading in some sounds:
ro: Implicit, *faza de atac* este 0 pentru toate sintetizatoarele, ceea ce inseamna ca ele trec de la amplitudine 0 la 1 instantaneu, ceea ce da sintetizatorului un sunet intial percutant. Totusi, ai putea sa-ti doresti ca sunetul sa intre progresiv (fade in). Acest lucru se poate obtine folosind optiunea 'attack:'. Incearca sa introduci progresiv niste sunete:

en: You may use multiple opts at the same time. For example for a short attack and a long release try:
ro: Poti folosi mai multe optiuni in acelasi timp. De exemplu, pentru un atac scurt si un release lung, incearca:

en: This short attack and long release envelope is illustrated in the following diagram:
ro: Acest atac scurt urmat de release lung este ilustrat in diagrama urmatoare:

en: Of course, you may switch things around. Try a long attack and a short release:
ro: Desigur, poti incerca si invers - un atac lung si un release scurt:

en: Finally, you can also have both short attack and release times for shorter sounds.
ro: In fine, poti avea atat atac scurt, cat si release scurt, pentru sunete de scurta durata.

en: Sustain Phase
ro: Faza Sustain (mentinere)

en: In addition to specifying attack and release times, you may also specify a sustain time to control the *sustain phase*. This is the time for which the sound is maintained at full amplitude between the attack and release phases.
ro: Pe langa specificarea timpilor de atac si release, poti specifica si timpul cat sunetul este sustinut, pentru a controla *faza sustain*. Aceasta reprezinta perioada de timp in care sunetul este mentinut la amplitudine maxima intre fazele de atac si release.

en: The sustain time is useful for important sounds you wish to give full presence in the mix before entering an optional release phase. Of course, it's totally valid to set both the `attack:` and `release:` opts to 0 and just use the sustain to have absolutely no fade in or fade out to the sound. However, be warned, a release of 0 can produce clicks in the audio and it's often better to use a very small value such as 0.2.
ro: Timpul de mentinere este util pentru sunetele importante a caror prezenta in mix vreti sa fie remarcata inainte de a intra in faza optionala de release. Desigur, este corect si sa specificati atat pentru 'attack:' cat si pentru 'release:' valoarea 0 si sa folositi doar faza de sustain fara a avea intrarea si iesirea progresiva a sunetului. Totusi, trebuie sa stiti ca folosind valoarea 0 pentru release puteti avea pacanituri in sunet si este mai bine in general sa folositi o valoare foarte mica, cum ar fi 0.2.

en: Decay Phase
ro: Faza Decay (declin)

en: For an extra level of control, you can also specify a decay time. This is a phase of the envelope that fits between the attack and sustain phases and specifies a time where the amplitude will drop from the `attack_level:` to the `decay_level:` (which unless you explicitly set it will be set to the `sustain_level:`). By default, the `decay:` opt is 0 and both the attack and sustain levels are 1 so you'll need to specify them for the decay time to have any effect:
ro: Pentru si mai mult control puteti specifica si un timp de declin (Decay). Aceasta este o faza a anvelopei care este incadrata de fazele de atac si mentinere si specifica timpul in care amplitudinea coboara de la nivelul de atac - 'attack level:' la nivelul de declin - 'decay_level:' (care va fi setat automat la nivelul de mentinere - 'sustain_level:' daca nu ii dati o valoare explicita). Implicit, valoarea pentru 'decay:' este 0 si atat nivelul de atac cat si cel de mentinere au valoarea 1, deci va trebui sa le dati valori explicite pentru ca timpul de declin sa aiba efect:

en: Decay Level
ro: Nivelul de declin

en: One last trick is that although the `decay_level:` opt defaults to be the same value as `sustain_level:` you can explicitly set them to different values for full control over the envelope. This allows you to to create envelopes such as the following:
ro: Inca un truc: desi 'decay_level:' are implicit aceeasi valoare cu 'sustain_level:', poti sa le atribui valori diferite pentru a avea un control mai bun asupra anvelopei. Acest lucru iti permite sa creezi anvelope precum cea care urmeaza:

en: It's also possible to set the `decay_level:` to be higher than `sustain_level:`:
ro: Poti de asemenea sa alegi pentru 'decay_level:' o valoare mai mare decat cea pentru 'sustain_level:':

en: ADSR Envelopes
ro: Anvelope ADSR

en: So to summarise, Sonic Pi's ADSR envelopes have the following phases:
ro: In concluzie, in Sonic Pi anvelopele ADSR au urmatoarele faze:

en: *attack* - time from 0 amplitude to the `attack_level`,
ro: *attack (atac)* - timpul de la amplitudine 0 la 'attack_level' (nivelul de atac),

en: *decay* - time to move amplitude from `attack_level` to `decay_level`,
ro: *decay (declin)* - timpul de trecere de la amplitudinea nivelului de atac la cea a nivelului de declin - 'decay_level',

en: *sustain* - time to move the amplitude from `decay_level` to `sustain_level`,
ro: *sustain (sustinut)* - timpul de trecere de la amplitudinea nivelului de declin la cea a nivelului sustinut - 'sustain_level',

en: *release* - time to move amplitude from `sustain_level` to 0
ro: *release (eliberare)* - timpul de trecere de la amplitudinea nivelului sustinut la 0

en: It's important to note that the duration of a sound is the summation of the times of each of these phases. Therefore the following sound will have a duration of 0.5 + 1 + 2 + 0.5 = 4 beats:
ro: Este important de retinut ca durata sunetului este suma timpilor pentru toate aceste faze. Ca urmare, urmatorul sunet va avea o durata de 0.5 + 1 + 2 + 0.5 = 4 batai:

en: Now go and have a play adding envelopes to your sounds...
ro: Acum joaca-te adaugand anvelope sunetelor tale...

en: 3 Samples
ro: 3 Esantioane (samples)

en: Samples
ro: Esantioane

en: Another great way to develop your music is to use pre-recorded sounds. In great hip-hop tradition, we call these pre-recorded sounds *samples*. So, if you take a microphone outside, go and record the gentle sound of rain hitting canvas, you've just created a sample.
ro: O alta cale de a-ti imbogati muzica este sa folosesti sunete pre-inregistrate. In buna traditie hip-hop, aceste sunete se numesc *esantioane (samples)*. Deci, daca iesi cu microfonul afara si inregistrezi sunetul discret al ploii lovind o copertina, tocmai ai creat un esantion.

en: Sonic Pi lets you do lots of fun things with samples. Not only does it ship with 130 public domain samples ready for you to jam with, it lets you play and manipulate your own. Let's get to it...
ro: Sonic Pi iti permite sa faci o gramada de chestii interesante cu esantioanele. Nu doar ca vine cu peste 90 de esantioane din domeniul public (cu utilizare gratuita), dar iti permite si sa creezi si sa modifici propriile esantioane. Sa trecem la treaba...

en: 3.1 Triggering Samples
ro: 3.1 Activarea esantioanelor

en: Triggering Samples
ro: Activarea esantioanelor

en: Playing beeps is only the beginning. Something that's a lot of fun is triggering pre-recorded samples. Try it:
ro: Redarea de beep-uri este doar inceputul. Un lucru mult mai interesant este sa redai esantioane deja inregistrate. Incearca asta:

en: Sonic Pi includes many samples for you to play with. You can use them just like you use the `play` command. To play multiple samples and notes just write them one after another:
ro: Sonic Pi contine multe esantioane cu care te poti juca. Poti sa le folosesti la fel cum folosesti comanda 'play'. Pentru a reda mai multe esantioane si note, scrie-le unele dupa altele:

en: If you want to space them out in time, use the `sleep` command:
ro: Daca vrei sa lasi pauze intre ele, foloseste comanda 'sleep':

en: Discovering Samples
ro: Explorarea esantioanelor

en: Alternatively you can use the *auto-completion system*. Simply type the start of a sample group such as: `sample :ambi_` and you'll see a drop-down of sample names appear for you to select. Try the following category prefixes:
ro: O metoda alternativa este sa folosesti sistemul de *completare automata*. Scrie inceputul unui grup de esantioane, cum ar fi: 'sample :ambi_' si vei vedea o lista derulanta cu numele esantioanelor, din care poti alege ce doresti. Incearca aceste categorii de prefixe:

en: Now start mixing samples into your compositions!
ro: Acum poti incepe sa combini esantioanele pentru a crea compozitii!

en: 3.2 Sample Parameters
ro: 3.2. Parametri Esantioane

en: Sample Parameters: Amp and Pan
ro: Parametri Esantioane: Amplitudine (Amp) si Pozitionare (Pan)

en: As we saw with synths, we can easily control our sounds with parameters. Samples support exactly the same parameterisation mechanism. Let's revisit our friends `amp:` and `pan:`.
ro: Asa cum am vazut la sintetizatoare, putem controla cu usurinta sunetele folosind diferiti parametri. Esantioanele suporta exact acelasi model de parametri. Sa-i revedem pe vechii prieteni - 'amp:' si 'pan:'.

en: Amping samples
ro: Amplificarea esantioanelor

en: You can change the amplitude of samples with exactly the same approach you used for synths:
ro: Poti schimba amplitudinea esantioanelor folosind aceeasi metoda ca in cazul sintetizatoarelor:

en: Panning samples
ro: Pozitionarea esantioanelor

en: We're also able to use the `pan:` parameter on samples. For example, here's how we'd play the amen break in the left ear and then half way through play it again through the right ear:
ro: Putem folosi parametrul 'pan:' pentru esantioane. De exemplu, iata cum am putea reda esantionul amen in stanga,  iar la jumatatea duratei sa il redam si in dreapta:

en: Note that 0.877 is half the duration of the `:loop_amen` sample in seconds.
ro: 0.877 reprezinta jumatate din durata esantionului `:loop_amen` in secunde.

en: Finally, note that if you set some synth defaults with `use_synth_defaults` (which we will discuss later), these will be ignored by `sample`.
ro: De retinut ca daca ai setat niste valori implicite pentru sintetizatoare folosind 'use_synth_defaults' (despre care vom discuta mai tarziu), acestea vor fi ignorate de 'sample'.

en: 3.3 Stretching Samples
ro: 3.3 Comprimarea/Intinderea esantioanelor

en: Stretching Samples
ro: Comprimarea/Intinderea esantioanelor

en: Now that we can play a variety of synths and samples to create some music, it's time to learn how to modify both the synths and samples to make the music even more unique and interesting. First, let's explore the ability to *stretch* and *squash* samples.
ro: Acum, ca putem folosi o multime de sintetizatoare si esantioane pentru a crea muzica, este timpul sa invatam cum putem sa le modificam si pe unele si pe celelalte pentru a individualiza muzica si a o face mai interesanta. Mai intai, sa exploram posibilitatea de a *intinde* si a *comprima* esantioanele.

en: Sample Representation
ro: Reprezentarea esantioanelor

en: Samples are pre-recorded sounds stored as numbers which represent how to move the speaker cone to reproduce the sound. The speaker cone can move in and out, and so the numbers just need to represent how far in and out the cone needs to be for each moment in time. To be able to faithfully reproduce a recorded sound the sample typically needs to store many thousands of numbers per second! Sonic Pi takes this list of numbers and feeds them at the right speed to move your computer's speaker in and out in just the right way to reproduce the sound. However, it's also fun to change the speed with which the numbers are fed to the speaker to change the sound.
ro: Esantioanele sunt sunete deja inregistrate memorate sub forma de numere care reprezinta miscarea pe care conul difuzorului o face pentru a reproduce sunetele. Conul difuzorului se poate misca inainte si inapoi, deci aceste numere trebuie sa reprezinte cat de mult trebuie sa fie deplasat conul la fiecare moment. Pentru a putea reproduce cu fidelitate un sunet inregistrat esantionul trebuie sa contina in general mii de numere pentru fiecare secunda! Sonic Pi ia aceasta lista de numere si o trimite cu viteza potrivita pentru a misca difuzorul computerului inainte si inapoi exact in modul necesar pentru a reproduce sunetul. Totusi, poate fi distractiv sa schimbi viteza cu care aceste numere sunt trimise catre difuzor pentru a schimba sunetul.

en: Changing Rate
ro: Schimbarea vitezei de redare

en: Let's play with one of the ambient sounds: `:ambi_choir`. To play it with the default rate, you can pass a `rate:` opt to `sample`:
ro: Sa ne jucam cu unul dintre sunetele ambientale: ':ambi_choir'. Pentru a-l reda la viteza normala, puteti sa transmiteti parametrul 'rate' pentru 'sample':

en: This plays it at normal rate (1), so nothing special yet. However, we're free to change that number to something else. How about `0.5`:
ro: Aceasta linie reda esantionul cu viteza normala (1), deci nu este nimic special deocamdata. Totusi, putem schimba acest numar cu un altul. Sa zicem '0.5':

en: Woah! What's going on here? Well, two things. Firstly, the sample takes twice as long to play, secondly the sound is an octave lower. Let's explore these things in a little more detail.
ro: Oho! Ce se intampla aici? Ei bine, doua lucruri. In primul rand, esantionul va dura de doua ori mai mult, iar in al doilea rand, sunetul este cu o octava mai jos. Sa examinam aceste lucruri mai in detaliu.

en: Let's stretch
ro: Intinderea

en: A sample that's fun to stretch and compress is the Amen Break. At normal rate, we might imagine throwing it into a *drum 'n' bass* track:
ro: Un esantion cu care ne putem distra lungindu-l sau comprimandu-l este Amen. La viteza normala, am putea sa-l adaugam la o pista *toba & bass*:

en: However by changing the rate we can switch up genres. Try half speed for *old school hip-hop*:
ro: Schimbandu-i viteza insa, putem sa schimbam stilul. Incearca viteza redusa la jumatate pentru un *hip-hop de moda veche*:

en: If we speed it up, we enter *jungle* territory:
ro: Daca il facem mai rapid, intram in zona *jungle*:

en: Now for our final party trick - let's see what happens if we use a negative rate:
ro: Iar acum ultimul truc - sa vedem ce se intampla daca folosim o viteza negativa:

en: Woah! It plays it *backwards*! Now try playing with lots of different samples at different rates. Try very fast rates. Try crazy slow rates. See what interesting sounds you can produce.
ro: Hei, sunetul este redat *de la coada la cap*! Acum incearca sa te joci cu diferite esantioane la viteze diferite. Incearca viteze foarte mari. Incearca viteze enervant de mici. Vezi ce sunete interesante poti obtine.

en: A Simple Explanation of Sample Rate
ro: O explicatie simpla a vitezei de redare a esantioanelor

en: A useful way to think of samples is as springs. Playback rate is like squashing and stretching the spring. If you play the sample at rate 2, you're *squashing the spring* to half its normal length. The sample therefore takes half the amount of time to play as it's shorter. If you play the sample at half rate, you're *stretching the spring* to double its length. The sample therefore takes twice the amount of time to play as it's longer. The more you squash (higher rate), the shorter it gets, the more you stretch (lower rate), the longer it gets.
ro: Un mod de a vedea lucrurile este sa te gandesti la esantioane ca la niste arcuri. Modificarea vitezei de redare este asemanatoare cu alungirea sau comprimarea arcului. Daca redai esantionul cu o viteza dubla, *comprimi arcul* la jumatate din lungimea sa normala. Ca urmare, esantionul va dura jumatate din durata normala, fiind mai scurt. Daca redai esantionul la jumatate din viteza normala, *intinzi arcul* la o lungime dubla. Esantionul va dura de doua ori mai mult, fiind mai lung. Cu cat il comprimi mai tare (viteza mai mare), cu atat devine mai scurt. Cu cat il intinzi mai mult (viteza mai mica), cu atat devine mai lung.

en: Compressing a spring increases its density (the number of coils per cm) - this is similar to the sample sounding *higher pitched*. Stretching the spring decreases its density and is similar to the sound having a *lower pitch*.
ro: Comprimarea unui arc il face mai dens (creste numarul de spire pe cm) - acest lucru este similar cu un esantion care va contine sunete care *variaza mai des*. Intinderea arcului scade densitatea de spire si este similara cu un sunet care *variaza mai lent*.

en: The Maths Behind Sample Rate
ro: Matematica din spatele vitezei de redare a esantioanelor

en: (This section is provided for those that are interested in the details. Please feel free to skip it...)
ro: (Aceasta sectiune se adreseaza celor care sunt interesati de detalii. Poti sari peste ea daca doresti...)

en: As we saw above, a sample is represented by a big long list of numbers representing where the speaker should be through time. We can take this list of numbers and use it to draw a graph which would look similar to this:
ro: Dupa cum am vazut mai sus, un esantion este reprezentat de o lista lunga de numere care specifica unde trebuie sa se afle speakerul la fiecare moment de timp. Putem lua aceasta lista de numere si sa trasam un grafic care ar arata similar cu acesta:

en: You might have seen pictures like this before. It's called the *waveform* of a sample. It's just a graph of numbers. Typically a waveform like this will have 44100 points of data per second (this is due to the Nyquist-Shannon sampling theorem). So, if the sample lasts for 2 seconds, the waveform will be represented by 88200 numbers which we would feed to the speaker at a rate of 44100 points per second. Of course, we could feed it at double rate which would be 88200 points per second. This would therefore take only 1 second to play back. We could also play it back at half rate which would be 22050 points per second taking 4 seconds to play back.
ro: Probabil ai mai vazut imagini ca aceasta inainte. Se numeste *forma de unda* a unui esantion. Este doar un grafic pe baza unor numere.Uzual, o astfel de forma de unda va avea 44100 puncte de date pentru fiecare secunda (acest lucru este impus de Teorema eșantionării Nyquist–Shannon). Deci, daca un esantion dureaza 2 secunde, forma de unda va fi reprezentata de 88200 de numere care vor fi trimise difuzorului cu o viteza de 44100 de puncte pe secunda. Desigur, am putea sa trimitem datele cu o viteza dubla, de 88200 de puncte pe secunda. Aceasta ar face ca redarea sa dureze 1 secunda. Am putea de asemenea sa redam 22050 puncte pe secunda, durata fiind in acest caz de 4 secunde.

en: The duration of the sample is affected by the playback rate:
ro: Durata unui esantion este influentata de viteza de redare:

en: Doubling the playback rate halves the playback time,
ro: Dublarea vitezei de redare injumatateste durata,

en: Halving the playback rate doubles the playback time,
ro: Injumatatirea vitezei de redare dubleaza durata,

en: Using a playback rate of one fourth quadruples the playback time,
ro: Reducand viteza la un sfert durata creste de patru ori,

en: Using a playback rate of 1/10 makes playback last 10 times longer.
ro: Reducand viteza de 10 ori, durata va fi de 10 ori mai mare.

en: We can represent this with the formula:
ro: Putem reprezenta aceasta regula prin formula:

en: new_sample_duration = (1 / rate) * sample_duration
ro: durata_esantion_noua = ( 1 / viteza) * durata_esantion

en: Changing the playback rate also affects the pitch of the sample. The frequency or pitch of a waveform is determined by how fast it moves up and down. Our brains somehow turn fast movement of speakers into high notes and slow movement of speakers into low notes. This is why you can sometimes even see a big bass speaker move as it pumps out super low bass - it's actually moving a lot slower in and out than a speaker producing higher notes.
ro: Schimbarea vitezei de redare influenteaza si tonalitatea esantionului. Frecventa formei de unda este determinata de cat de repede se misca in sus si in jos. Creierul nostru transforma cumva miscarea rapida a difuzorului in sunete in alte si miscarea lenta in sunete joase. De aceea uneori poti vedea cum un difuzor mare de bas se misca atunci cand reda un sunet cu frecvente foarte joase - se misca mult mai lent inainte si inapoi decat un difuzor care produce sunete inalte.

en: If you take a waveform and squash it it will move up and down more times per second. This will make it sound higher pitched. It turns out that doubling the amount of up and down movements (oscillations) doubles the frequency. So, *playing your sample at double rate will double the frequency you hear it*. Also, *halving the rate will halve the frequency*. Other rates will affect the frequency accordingly.
ro: Daca iei o forma de unda si o comprimi, vor exista mai multe miscari in sus si in jos intr-o secunda. Aceasta va face sunetul sa aiba o tonalitate mai inalta. Dublarea miscarilor in sus si in jos (oscilatii) dubleaza frecventa. Deci, *redarea unui esantion cu viteza dubla va dubla frecventa pe care o auzi*. De asemenea, *injumatatirea vitezei va injumatati frecventa*. Alte viteze de redare vor modifica frecventa corespunzator.

en: 3.4 Enveloped Samples
ro: 3.4 Anvelope pentru esantioane

en: Enveloped Samples
ro: Anvelope pentru esantioane

en: It is also possible to modify the *duration* and *amplitude* of a sample using an ADSR envelope. However, this works slightly differently to the ADSR envelope available on synths. Sample envelopes only allow you to reduce the amplitude and duration of a sample - and never to increase it. The sample will stop when either the sample has finished playing or the envelope has completed - whichever is first. So, if you use a very long `release:`, it won't extend the duration of the sample.
ro: Este posibil sa modificam *durata* si *amplitudinea* unui esantion folosind o anvelopa ADSR. Totusi, functionarea va fi putin diferita fata de anvelopa ADSR folosita pentru sintetizatoare. Anvelopele pentru esantioane permit doar reducerea amplitudinii si duratei unui esantion - nu si marirea acestora. Esantionul se va opri fie cand s-a epuizat continutul sau fie cand s-a terminat anvelopa - in functie de care eveniment se produce primul. Deci, daca folosesti un 'release:' foarte lung, nu vei putea mari durata esantionului.

en: Amen Envelopes
ro: Anvelopa Amen

en: Let's return to our trusty friend the Amen Break:
ro: Sa ne intoarcem la esantionul cunoscut - Amen Break:

en: With no opts, we hear the full sample at full amplitude. If we want to fade this in over 1 second we can use the `attack:` param:
ro: Fara parametri, auzim esantionul intreg, la amplitudine intreaga. Daca vrem sa-l pornim treptat pe durata de 1 secunda, putem folosi parametrul 'attack:':

en: For a shorter fade in, choose a shorter attack value:
ro: Pentru o intrare mai rapida, alege un timp de atac mai mic:

en: Auto Sustain
ro: Auto mentinere

en: Where the ADSR envelope's behaviour differs from the standard synth envelope is in the *sustain* value. In the standard synth envelope, the sustain defaulted to 0 unless you set it manually. With samples, the sustain value defaults to an *automagical* value - the time left to play the rest of the sample. This is why we hear the full sample when we pass no defaults. If the attack, decay, sustain and release values were all 0 we'd never hear a peep. Sonic Pi therefore calculates how long the sample is, deducts any attack, decay and release times and uses the result as your sustain time. If the attack, decay and release values add up to more than the duration of the sample, the sustain is simply set to 0.
ro: Anvelopa ADSR se comporta diferit data de cea pentru sintetizatoare in ceea ce priveste valoarea *sustain* (de mentinere). In cazul anvelopei standard pentru sintetizatoare, 'sustain:' avea implicit valoarea 0 daca nu il modificai manual. In cazul esantioanelor, 'sustain:' este calculat *automagic* ca timpul ramas de redat din sample. De aceea vom auzi intregul esantion daca nu transmitem valori. Daca valorile pentru attack, decay, sustain si release ar fi toate 0 nu am auzi nimic. Sonic Pi calculeaza cat de lung este esantionul, scade valorile pentru attack, decay si release si foloseste rezultatul ca valoare pentru sustain. Daca valorile pentru attack, decay si release depasesc durata esantionului, valoarea pentru sustain va fi 0.

en: Fade Outs
ro: Stingerea sunetului (fade out)

en: To explore this, let's consider our Amen break in more detail. If we ask Sonic Pi how long the sample is:
ro: Pentru a examina acest comportament, sa privim mai cu atentie esantionul Amen break. Daca cerem Sonic Pi sa ne spuna cat este de lung:

en: It will print out `1.753310657596372` which is the length of the sample in seconds. Let's just round that to `1.75` for convenience here. Now, if we set the release to `0.75`, something surprising will happen:
ro: Va afisa `1.753310657596372` care reprezinta lungimea esantionului in secunde. Sa rotunjim valoarea la '1.75' pentru comoditate. Acum, daca setam valoarea pentru release la '0.75', se va intampla un lucru surprinzator:

en: It will play the first second of the sample at full amplitude before then fading out over a period of 0.75 seconds. This is the *auto sustain* in action. By default, the release always works from the end of the sample. If our sample was 10.75 seconds long, it would play the first 10 seconds at full amplitude before fading out over 0.75s.
ro: Va fi redata prima secunda a esantionului la amplitudine intreaga, apoi acesta se va stinge pe o durata de 0.75 secunde. Acest lucru arata cum functioneaza *auto mentinerea*. Implicit, valoarea pentru release se scade de la sfarsitul esantionului. Daca lungimea acestuia ar fi fost 10.75 secunde, ar fi fost redate primele 10 secunde la amplitudine intreaga apoi ar fi urmat stingerea pe o durata de 0.75s.

en: Remember: by default, `release:` fades out at the end of a sample.
ro: Tine minte: implicit, 'release:' actioneaza la sfarsitul esantionului.

en: Fade In and Out
ro: Intrarea progresiva (fade in) si stingerea treptata (fade out)

en: We can use both `attack:` and `release:` together with the auto sustain behaviour to fade both in and out over the duration of the sample:
ro: Putem folosi 'attack:' si 'release:' impreuna cu auto mentinerea pentru a avea atat o intrare progresiva cat si o stingere treptata pentru esantion:

en: As the full duration of the sample is 1.75s and our attack and release phases add up to 1.5s, the sustain is automatically set to 0.25s. This allows us to easily fade the sample in and out.
ro: Cum durata completa a esantionului este de 1.75s si fazele de atac si eliberare impreuna au 1.5s, durata de mentinere este stabilita automat la 0.25s. Acest lucru ne ajuta sa realizam usor intrarea progresiva si stingerea treptata a esantionului.

en: Explicit sustain
ro: Faza de mentinere specificata explicit

en: We can easily get back to our normal synth ADSR behaviour by manually setting `sustain:` to a value such as 0:
ro: Putem reveni cu usurinta la comportamentul ADSR normal pentru sintetizatoare atribuind explicit o valoare pentru 'sustain:', cum ar fi 0:

en: Now, our sample only plays for 0.75 seconds in total. With the default for `attack:` and `decay:` at 0, the sample jumps straight to full amplitude, sustains there for 0s then releases back down to 0 amplitude over the release period - 0.75s.
ro: Acum, esantionul nostru dureaza doar 0.75s in total. Cu valorile implicite pentru 'attack:' si 'decay:' egale cu 0, esantionul intra direct cu amplitudinea maxima, este mentinut astfel pentru 0s, apoi urmeaza coborarea la amplitudine 0 pe durata fazei de release - 0.75s.

en: Percussive cymbals
ro: Talere

en: We can use this behaviour to good effect to turn longer sounding samples into shorter, more percussive versions. Consider the sample `:drum_cymbal_open`:
ro: Putem folosi acest comportament pentru a transforma esantioane lungi in versiuni mai scurte si mai percutante. Sa luam ca exemplu esantionul `:drum_cymbal_open`:

en: You can hear the cymbal sound ringing out over a period of time. However, we can use our envelope to make it more percussive:
ro: Poti auzi sunetul talerului continuand o anumita perioada de timp. Totusi, putem folosi anvelopa pentru a il face mai percutant:

en: You can then emulate hitting the cymbal and then dampening it by increasing the sustain period:
ro: Poti simula lovirea unui taler si apoi amortizarea lui crescand durata de mentinere:

en: Now go and have fun putting envelopes over the samples. Try changing the rate too for really interesting results.
ro: Acum distreaza-te aplicand anvelope esantioanelor. Incearca sa schimbi si viteza de redare pentru efecte cu adevarat interesante.

en: 3.5 Partial Samples
ro: 3.5 Esantioane partiale

en: Partial Samples
ro: Esantioane partiale

en: This section will conclude our exploration of Sonic Pi's sample player. Let's do a quick recap. So far we've looked at how we can trigger samples:
ro: Aceasta sectiune va incheia explorarea player-ului de esantioane din Sonic Pi. Sa facem o scurta recapitulare. Pana acum am vazut cum putem porni esantioanele:

en: We then looked at how we can change the rate of samples such as playing them at half speed:
ro: Apoi am vazut cum putem schimba viteza de redare a esantioanelor, cum ar fi ascultandu-le la jumatate din viteza initiala:

en: Next, we looked at how we could fade a sample in (let's do it at half speed):
ro: Apoi, am vazut cum putem introduce progresiv un esantion (sa facem asta la jumatate din viteza):

en: We also looked at how we could use the start of a sample percussively by giving `sustain:` an explicit value and setting both the attack and release to be short values:
ro: Am vazut de asemenea cum putem sa folosim un start mai percutant al esantionului, dand o valoare explicita pentru 'sustain:' si atribuind valori mici pentru fazele de attack si release:

en: However, wouldn't it be nice if we didn't have to always start at the beginning of the sample? Wouldn't it also be nice if we didn't have to always finish at the end of the sample?
ro: Totusi, nu ar fi frumos daca nu ar trebui sa pornim mereu de la inceputul esantionului? Nu ar fi frumos daca nu ar trebui sa mergem mereu pana la sfarsitul esantionului?

en: Choosing a starting point
ro: Alegerea punctului de pornire

en: It is possible to choose an arbitrary starting point in the sample as a value between 0 and 1 where 0 is the start of the sample, 1 is the end and 0.5 is half way through the sample. Let's try playing only the last half of the amen break:
ro: Putem alege un punct de pornire arbitrar in esantion specificand un numar intre 0 si 1, unde 0 este inceputul acestuia, 1 sfarsitul, iar 0.5 este la jumatatea esantionului. Sa incercam sa redam doar a doua jumatate din amen break:

en: How about the last quarter of the sample:
ro: Ce-ar fi sa incercam ultimul sfert din esantion:

en: Choosing a finish point
ro: Alegerea punctului de oprire

en: Similarly, it is possible to choose an arbitrary finish point in the sample as a value between 0 and 1. Let's finish the amen break half way through:
ro: Asemanator, este posibil sa alegem un punct de oprire arbitrar in cadrul esantionului , ca o valoare intre 0 si 1. Sa oprim amen break la jumatate:

en: Specifying start and finish
ro: Precizarea inceputului si sfarsitului

en: Of course, we can combine these two to play arbitrary segments of the audio file. How about only a small section in the middle:
ro: Desigur, putem combina aceste 2 valori pentru a reda segmente arbitrare din fisierul audio. Cum ar fi doar o mica bucata de la mijloc:

en: What happens if we choose a start position after the finish position?
ro: Ce se intampla daca alegem o pozitie de inceput dupa pozitia de sfarsit?

en: Cool! It plays it backwards!
ro: Super! Este redat de la coada la cap!

en: Combining with rate
ro: In combinatie cu viteza

en: We can combine this new ability to play arbitrary segments of audio with our friend `rate:`. For example, we can play a very small section of the middle of the amen break very slowly:
ro: Putem combina aceasta posibilitate de a reda segmente audio arbitrare cu parametrul deja cunoscut 'rate:' (viteza de redare). De exemplu, putem reda o bucata foarte mica de la mijlocul esantionului amen break foarte lent:

en: Combining with envelopes
ro: In combinatie cu anvelopele

en: Finally, we can combine all of this with our ADSR envelopes to produce interesting results:
ro: In fine, putem combina toate acestea cu anvelopele ADSR pentru a produce rezultate interesante:

en: Now go and have a play mashing up samples with all of this fun stuff...
ro: Acum poti sa te joci modeland esantioanele cu ajutorul acestor chestii distractive...

en: 3.6 External Samples
ro: 3.6 Esantioane externe

en: External Samples
ro: Esantioane externe

en: Whilst the built-in samples can get you up and started quickly, you might wish to experiment with other recorded sounds in your music. Sonic Pi totally supports this. First though, let's have a quick discussion on the portability of your piece.
ro: Desi esantioanele care vin impreuna cu Sonic Pi te pot ajuta sa incepi rapid sa experimentezi, ai putea incerca si cu alte sunete inregistrate. Sonic Pi ofera suport complet pentru acest lucru. Totusi, sa discutam pe scurt despre portabilitatea creatiei tale.

en: Portability
ro: Portabilitatea

en: When you compose your piece purely with built-in synths and samples, the code is all you need to faithfully reproduce your music. Think about that for a moment - that's amazing! A simple piece of text you can email around or stick in a [Gist](https://gist.github.com) represents everything you need to reproduce your sounds. That makes it *really easy to share* with your friends as they just need to get hold of the code.
ro: Cand compui o piesa bazata doar pe sintetizatoarele si esantioanele incluse in program, codul este tot ce iti trebuie ca sa reproduci fidel muzica ta. Gandeste-te putin - asta este un lucru uimitor! O simpla bucata de text pe care o poti trimite prin email sau pe care o poti incarca intr-un [Gist](https://gist.github.com) este tot ce iti trebuie ca sa reproduci sunetele tale. Asta le face *usor de impartasit* cu prietenii tai, deoarece ei au nevoie doar de bucata de cod.

en: However, if you start using your own pre-recorded samples, you lose this portability. This is because to reproduce your music other people not only need your code, they need your samples too. This limits the ability for others to manipulate, mash-up and experiment with your work. Of course this shouldn't stop you from using your own samples, it's just something to consider.
ro: Totusi, daca incepi sa folosesti propriile esantioane, vei pierde aceasta portabilitate, deoarece pentru a reproduce piesa ta alte persoane vor avea nevoie nu doar de cod, ci si de acele esantioane. Acest lucru limiteaza posbilitatile altora de a modifica si de a face experimente cu creatia ta. Desigur, asta nu inseamna ca nu trebuie sa folosesti propriile esantioane, este doar un lucru de care trebuie sa tii cont.

en: Local Samples
ro: Esantioane salvate loca

en: Sonic Pi will automatically load and play the sample. You can also pass all the standard params you're used to passing `sample`:
ro: Sonic Pi va incarca automat si va reda acest esantion. Poti de asemenea sa folosesti toti parametrii standard pe care ai invatat sa-i folosesti cu 'sample':

en: 3.7 Sample Packs
ro: 3.7 Pachete de esantioane

en: Sample Packs
ro: Pachete de esantioane

en: **Note: this section of the tutorial covers the advanced topic of working with large directories of your own samples. This will be the case if you've downloaded or bought your own sample packs and wish to use them within Sonic Pi.**
ro: **Nota: aceasta sectiune din tutorial se refera la situatia in care vrei sa folosesti foldere mai cu propriile esantioane. Acest lucru se va intampla daca ai descarcat sau cumparat un pachet de esantioane si vrei sa-l foloseti cu Sonic Pi.**

en: **Feel free to skip this if you're happy working with the built-in samples.**
ro: **Poti sa sari peste aceasta sectiune daca esti multumit cu esantioanele deja incluse in program.**

en: When working with large folders of external samples it can be cumbersome to have to type the whole path every time to trigger an individual sample.
ro: Cand lucrezi cu foldere mari de esantioane externe poate fi dificil sa scrii de fiecare data calea completa cand vrei sa incarci un anumit esantion.

en: For example, say you have the following folder on your machine:
ro: De exemplu, sa spunem ca ai folderul de mai jos in calculatorul tau:

en: When we look inside that folder we find the following samples:
ro: Inauntrul folderului gasim urmatoarele esantioane:

en: Typically in order to play the piano sample we can use the full path:
ro: In mod normal, pentru a reda esantionul de pian putem folosi calea completa:

en: If we want to then play the guitar sample we can use its full path too:
ro: Daca vrem ca apoi sa redam esantionul de chitara putem folosi de asemenea calea completa:

en: However, both of these calls to sample requires us to *know* the names of the samples within our directory. What if we just want to listen to each sample in turn quickly?
ro: Totusi, ambele apeluri ale comenzii sample cer ca noi sa *stim* numele esantioanelor din folder. Cum ar fi daca am dori sa ascultam fiecare esantion pe rand?

en: Indexing Sample Packs
ro: Indexarea pachetelor de esantioane

en: If we want to play the first sample in a directory we just need to pass the directory's name to `sample` and the index `0` as follows:
ro: Daca vrem sa redam primul esantion dintr-un folder trebuie doar sa transmitem catre comanda 'sample' numele folderului si indexul '0' ca mai jos:

en: We can even make a shortcut to our directory path using a variable:
ro: Putem crea o scurtatura catre folder folosind o variabila:

en: Now, if we want to play the second sample in our directory, we just need to add 1 to our index:
ro: Acum, daca dorim sa redam al doilea esantion din folder, trebuie doar sa adaugam 1 la index:

en: Notice that we no longer need to know the names of the samples in the directory - we just need to know the directory itself (or have a shortcut to it). If we ask for an index which is larger than the number of samples, it simply wraps round just like Rings. Therefore, whatever number we use we're guaranteed to get one of the samples in that directory.
ro: Observi ca nu mai este nevoie sa stim numele esantioanelor din folder - trebuie doar sa stim numele folderului (sau sa avem o scurtatura catre el). Daca cerem un index mai mare decat numarul de esantioane, va relua numaratoarea de la inceputul listei. Astfel, orice numar vom folosi, avem garantia ca vom obtine un esantion din acel folder.

en: Filtering Sample Packs
ro: Filtrarea pachetelor de esantioane

en: Usually indexing is enough, but sometimes we need more power to sort and organise our samples. Luckily many sample packs add useful information in the filenames. Let's take another look at the sample file names in our directory:
ro: De obicei indexarea este suficienta, dar uneori avem nevoie de o metoda mai puternica de sortare si organizare a esantioanelor. Din fericire, multe pachete de esantioane contin informatii utile in numele fisierelor. Sa mai aruncam o privire la numele fisierelor din folderul nostru:

en: Notice that in these filenames we have quite a bit of information. Firstly, we have the BPM of the sample (beats per minute) at the start. So, the piano sample is at 120 BPM and our first three melodies are at 100 BPM. Also, our sample names contain the key. So the guitar sample is in Bb and the melodies are in A#. This information is very useful for mixing in these samples with our other code. For example, we know we can only play the piano sample with code that's in 120 BPM and in the key of Bb.
ro: Observi ca in aceste nume de fisiere avem cateva informatii. In primul rand, avem ritmul in BPM (batai pe minut) la inceput. Deci, esantionul de pian este la 120 BPM si primele trei melodii sunt la 100 BPM. De asemenea, numele esantioanelor contin cheia. Esantionul de chitara este in Bb, iar melodiile in A#. Aceasta informatie este foarte utila cand combini aceste esantioane cu restul codului. De exemplu, stim ca putem reda esantionul de pian doar cu cod care este la 120 BPM si in cheia Bb.

en: It turns out that we can use this particular naming convention of our sample sets in the code to help us filter out the ones we want. For example, if we're working at 120 BPM, we can filter down to all the samples that contain the string `"120"` with the following:
ro: Se pare ca putem folosi aceasta conventie de numire a esantioanelor in codul nostru pentru a le filtra pe cele pe care le vrem. De exemplu, daca lucram la 120 BPM, putem aplica un filtru care retine toate esantioanele al caror nume contine sirul '"120"' astfel:

en: This will play us the first match. If we want the second match we just need to use the index:
ro: Aceasta va reda primul esantion care se potriveste. Daca dorim sa il redam pe al doilea trebuie sa folosim un index:

en: Finally, we're still free to add our usual opts to the call to `sample`:
ro: Putem de asemenea sa adaugam parametrii obisnuiti pentru 'sample':

en: Sources
ro: Surse

en: The `sample` fn will first gather all sources and use them to create a large list of candidates. This list is constructed by first adding all valid paths and then by adding all the valid `.flac`, `.aif`, `.aiff`, `.wav`, `.wave` files contained within the directories.
ro: Functia 'sample' va aduna mai intai toate sursele si le va folosi pentru a crea o lista mare de candidati. Lista este construita adaugand mai intai toate caile valide si apoi adaugand toate fisierele '.flac', '.aif', '.aiff', '.wav' sau '.wave' din aceste foldere.

en: For example, take a look at the following code:
ro: De exemplu, sa aruncam o privire la codul acesta:

en: Here, we're combining the contents of the samples within two directories and adding a specific sample. If `"/path/to/my/samples/"` contained 3 samples and `"/path/to/my/samples2/"` contained 12, we'd have 16 potential samples to index and filter (3 + 12 + 1).
ro: Aici am combinat continutul a doua foldere cu esantioane, apoi am adaugat inca un esantion individual. Daca `"/path/to/my/samples/"` contine 3 esantioane, iar `"/path/to/my/samples2/"` contine 12, avem 16 esantioane de indexat si de filtrat (3 + 12 + 1).

en: By default, only the sample files within a directory are gathered into the candidate list. Sometimes you might have a number of nested folders of samples you wish to search and filter within. You can therefore do a recursive search for all samples within all subfolders of a particular folder by adding `**` to the end of the path:
ro: Implicit, doar esantioanele din folder sunt adaugate la lista de candidati. Uneori ai putea avea si subfoldere in care ai vrea sa cauti. Poti sa efectuezi o cautare recursiva a tuturor esantioanelor din toate subfolderele unui anumit folder, adaugand '**' la sfarsitul caii:

en: Take care though as searching through a very large set of folders may take a long time. However, the contents of all folder sources are cached, so the delay will only happen the first time.
ro: Ai grija totusi, cautarea printr-un set mare de foldere poate dura foarte mult. Continutul tututor folderelor este pastrat in cache, deci intarzierea sa va manifesta doar prima data.

en: Finally, note that the sources *must go first*. If no source is given, then the set of built-in samples will be selected as the default list of candidates to work with.
ro: O observatie de final - sursele *trebuie sa treaca inainte*. Daca nicio sursa nu este specificata, setul de esantioane incluse in Sonic Pi va fi selectat ca lista implicita de candidati.

en: Filters
ro: Filtre

en: Once you have a list of candidates you may use the following filtering types to further reduce the selection:
ro: Odata ce ai lista de candidati, poti folosi urmatoarele tipuri de filtre pentru a reduce selectia:

en: `"foo"` Strings will filter on substring occurrence within file name (minus directory path and extension).
ro: '"foo"' Siruri - filtrarea dupa un subsir care apare in numele fisierului (fara cale sau extensie).

en: `/fo[oO]/` Regular Expressions will filter on pattern matching of file name (minus directory path and extension).
ro: `/fo[oO]/` Expresii regulate - filtrarea se face prin compararea numelui fisierului (fara cale sau extensie) cu un sablon.

en: `:foo` - Keywords will filter candidates on whether the keyword is a direct match of the filename (minus directory path and extension).
ro: ':foo' Cuvinte cheie - se verifica daca numele fisierului (fara cale sau extensie) se potriveste cu cuvantul cheie.

en: `lambda{|a| ... }` - Procs with one argument will be treated as a candidate filter or generator function. It will be passed the list of current candidates and must return a new list of candidates (a list of valid paths to sample files).
ro: `lambda{|a| ... }` Proceduri cu un argument vor fi tratate ca filtre. Vor primi lista curenta de candidati si trebuie sa intoarca o noua lista (continand cai valide catre esantioane).

en: `1` - Numbers will select the candidate with that index (wrapping round like a ring if necessary).
ro: '1' Numere - vor selecta candidatul cu indexul respectiv (cu reluarea numararii de la inceput daca este cazul).

en: For example, we can filter over all the samples in a directory containing the string `"foo"` and play the first matching sample at half speed:
ro: De exemplu, putem filtra toate esantioanele dintr-un folder care contin sirul '"foo"' si sa redam primul esantion care se potriveste, la jumatate din viteza normala:

en: See the help for `sample` for many detailed usage examples. Note that the ordering of the filters is honoured.
ro: Cauta in help (sistemul de ajutor) exemple mai detaliate de utilizare. Observa cum este respectata ordinea filtrelor.

en: Composites
ro: Combinatii

en: Finally, you may use lists wherever you may place a source or filter. The list will be automatically flattened and the contents will be treated as regular sources and filters. Therefore the following calls to `sample` are semantically equivalent:
ro: Poti folosi liste oriunde poti folosi o sursa sau un filtru. Lista va fi normalizata automat si continutul va fi tratat ca sursele si filtrele obisnuite. Ca urmare, urmatoarele apeluri ale functiei 'sample' sunt echivalente semantic:

en: Wrapping Up
ro: Concluzie

en: This was an advanced section for people that need real power to manipulate and use sample packs. If most of this section didn't make too much sense, don't worry. It's likely you don't need any of this functionality just yet. However, you'll know when you do need it and you can come back and re-read this when you start working with large directories of samples.
ro: Aceasta a fost o sectiune avansata pentru cei care au nevoie de posibiltatea de a manevra pachete de esantioane. Daca n-ai inteles mare lucru din sectiunea asta, nu te ingrijora. Probabil inca nu ai nevoie de functionalitatea asta. Totusi, cand vei avea nevoie de ea vei sti ca exista si te vei putea intoarce sa recitesti aceasta parte cand vei lucra cu foldere mari cu esantioane.

en: 4 Randomisation
ro: 4 Randomizare

en: Randomisation
ro: Randomizare

en: A great way to add some interest into your music is using some random numbers. Sonic Pi has some great functionality for adding randomness to your music, but before we start we need to learn a shocking truth: in Sonic Pi *random is not truly random*. What on earth does this mean? Well, let's see.
ro: O modalitate de a face muzica ta mai interesanta este sa adaugi niste numere aleatoare (random). Sonic Pi ofera functii puternice pentru adaugarea unui caracter aleatoriu muzicii, dar inainte de a incepe trebuie sa aflam un lucru socant: in Sonic Pi *aleator nu inseamna cu adevarat aleator*. Ce naiba mai inseamna si asa? Ei bine, sa vedem.

en: Repeatability
ro: Repetabilitate

en: A really useful random function is `rrand` which will give you a random value between two numbers - a *min* and a *max*. (`rrand` is short for ranged random). Let's try playing a random note:
ro: O functie cu adevarat utila este 'rrand', care va intoarce o valoare aleatoare intre doua numere - un *min* si un *max*. ('rrand' este prescurtarea de la ranged random - aleator intr-un interval). Sa incercam sa redam o nota aleatoare:

en: Ooh, it played a random note. It played note `83.7527`. A nice random note between 50 and 95. Woah, wait, did I just predict the exact random note you got too? Something fishy is going on here. Try running the code again. What? It chose `83.7527` again? That can't be random!
ro: O, a cantat o nota aleatoare. A cantat nota '83.7527'. O nota draguta aleasa aleator intre 50 si 95. Hei, stai asa, tocmai am prezis nota exacta pe care ai obtinut-o si tu? Ceva nu e in regula aici. Incearca sa mai executi codul o data. Ce? A ales `83.7527` din nou? Asta nu poate fi aleator!

en: The answer is that it is not truly random, it's pseudo-random. Sonic Pi will give you random-like numbers in a repeatable manner. This is very useful for ensuring that the music you create on your machine sounds identical on everybody else's machine - even if you use some randomness in your composition.
ro: Raspunsul este ca nu este cu adevarat aleator, ci pseudo-aleator. Sonic Pi va genera numere aparent aleatoare intr-un mode repetabil. Acest lucru este util daca vrei sa te asiguri ca muzica pe care ai creat-o pe calculatorul tau va suna identica pe oricare alt calculator - chiar si atunci cand ai introdus un pic de aleatorism in compozitia ta.

en: Of course, in a given piece of music, if it 'randomly' chose `83.7527` every time, then it wouldn't be very interesting. However, it doesn't. Try the following:
ro: Desigur, intr-o piesa oarecare, daca alege mereu 'aleator' valoarea  `83.7527`, nu este prea interesant. Totusi, nu se intampla asa. Incearca asta:

en: loop do
      play rrand(50, 95)
      sleep 0.5
    end
ro: live_loop :flibble do
      sample :bd_haus, rate: 1
      sleep 0.5
    end

en: Yes! It finally sounds random. Within a given *run* subsequent calls to random functions will return random values. However, the next run will produce exactly the same sequence of random values and sound exactly the same. It's as if all Sonic Pi code went back in time to exactly the same point every time the Run button was pressed. It's the Groundhog Day of music synthesis!
ro: Da! In fine, suna aleator. In cadrul unei executii a codului, apelurile succesive ale functiilor vor intoarce valori aleatoare. Totusi, la urmatoarea rulare vor fi generate aceleasi numere aleatoare si sunetul va fi exact la fel. Este ca si cand Sonic Pi s-ar intoarce in timp exact in acelasi punct de fiecare data cand apesi butonu Executa (Run). Este Ziua Cartitei pentru compozitia muzicala!

en: Haunted Bells
ro: Clopotele bantuite

en: A lovely illustration of randomisation in action is the haunted bells example which loops the `:perc_bell` sample with a random rate and sleep time between bell sounds:
ro: Un ilustrare draguta a aleatorismului este exemplul cu clopotele bantuite care reda in bucla esantionul `:perc_bell` folosind valori aleatoare pentru viteza si pentru durata pauzelor intre sunete:

en: Random cutoff
ro: Intrerupere (cutoff) aleatoare

en: Another fun example of randomisation is to modify the cutoff of a synth randomly. A great synth to try this out on is the `:tb303` emulator:
ro: Un alt exemplu de utilizare a randomizarii este modificarea aleatoare a momentului de cutoff pentru un sintetizator. Un sintetizator potrivit pentru a incerca asta este emulatorul ':tb303':

en: use_synth :tb303
    loop do
      play 50, release: 0.1, cutoff: rrand(60, 120)
      sleep 0.125
    end
ro: ```
    live_loop :flibble do
      sample :bd_haus, rate: 1
      sleep 0.5
    end
    ```

en: Random seeds
ro: Valoarea de initializare (seed) a secventei aleatoare

en: So, what if you don't like this particular sequence of random numbers Sonic Pi provides? Well it's totally possible to choose a different starting point via `use_random_seed`. The default seed happens to be 0, so choose a different seed for a different random experience!
ro: Deci, ce faci faca nu-ti place o anumita secventa de numere aleatoare produsa de Sonic Pi? Ei bine, este posibil sa alegi un alt punct de pornire folosind 'use_random_seed'. Valoarea implicita este 0, deci alege o alta valoare pentru seed si vei avea o secventa aleatoare diferita!

en: Consider the following:
ro: Priveste aceasta bucata de cod:

en: Every time you run this code, you'll hear the same sequence of 5 notes. To get a different sequence simply change the seed:
ro: De fiecare data cand vei exexuta acest cod, vei auzi aceeasi secventa de 5 note. Pentru a obtine o secventa diferita schimba valoarea pentru seed:

en: This will produce a different sequence of 5 notes. By changing the seed and listening to the results you can find something that you like - and when you share it with others, they will hear exactly what you heard too.
ro: Aceasta va produce o alta secventa de 5 note. Schimband valoarea de initializare si ascultand rezultatul poti gasi ceva ce iti place - iar cand vei transmite altora piesa, ei vor auzi exact acelasi lucru pe care l-ai auzit si tu.

en: Let's have a look at some other useful random functions.
ro: Sa aruncam o privire si asupra altor functii utile pentru numere aleatoare.

en: choose
ro: choose (alege)

en: A very common thing to do is to choose an item randomly from a list of known items. For example, I may want to play one note from the following: 60, 65 or 72. I can achieve this with `choose` which lets me choose an item from a list. First, I need to put my numbers in a list which is done by wrapping them in square brackets and separating them with commas: `[60, 65, 72]`. Next I just need to pass them to `choose`:
ro: O situatie des intalnita este cea in care vrem sa alegem un element la intamplare dintr-o lista predefinita. De exemplu, vreau sa redau o nota dintre urmatoarele: 60, 65 sau 72. Poti face acest lucru folosind 'choose' care imi permite sa aleg un element dintr-o lista. Mai intai, trebuie sa trec numerele intr-o lista, introducandu-le intre paranteze patrate si separandu-le cu virgule: '[60, 65, 72]'. Apoi le transmit functiei 'choose':

en: Let's hear what that sounds like:
ro: Sa ascultam sunetul obtinut:

en: We've already seen `rrand`, but let's run over it again. It returns a random number between two values exclusively. That means it will never return either the top or bottom number - always something in between the two. The number will always be a float - meaning it's not a whole number but a fraction of a number. Examples of floats returned by `rrand(20, 110)`:
ro: Am discutat deja despre functia 'rrand', dar sa ne mai oprim putin asupra ei. Functia intoarce un numar aleator dintr-un interval deschis. Asta inseamna ca nu va intoarce niciodata valoarea minima sau pe cea maxima - intotdeauna va fi un numar intre cele doua. Numarul va fi intotdeauna de tipul float (cu virgula mobila) - insemnand ca nu este un numar intreg, ci are si o parte zecimala. Exemple de numere de tip float returnate de 'rrand(20, 110)':

en: Occasionally you'll want a whole random number, not a float. This is where `rrand_i` comes to the rescue. It works similarly to `rrand` except it may return the min and max values as potential random values (which means it's inclusive rather than exclusive of the range). Examples of numbers returned by `rrand_i(20, 110)` are:
ro: Vor fi si situatii in care vei dori un numar aleator intreg, nu unul cu virgula. Aici intervine 'rrand_i'. Functioneaza la fel ca 'rrand', doar ca poate returna si valorile minima sau maxima (foloseste un interval inchis de valori). Exemple de numere returnate de `rrand_i(20, 110)`:

en: This will return a random float between 0 (inclusive) and the max value you specify (exclusive). By default it will return a value between 0 and one. It's therefore useful for choosing random `amp:` values:
ro: Va returna un numar tip float intre 0 (inclusiv) si valoarea maxima pe care o specifici (exclusiv). Implicit va returna o valoare intre 0 si 1. Este deci util pentru alegerea aleatoare a valorilor pentru 'amp:':

en: Similar to the relationship between `rrand_i` and `rrand`, `rand_i` will return a random whole number between 0 and the max value you specify.
ro: Asemanator cu 'rrand_i' pentru 'rrand', exista 'rand_i' care va returna o valoare intreaga intre 0 si valoarea maxima pe care i-o transmiti.

en: Sometimes you want to emulate a dice throw - this is a special case of `rrand_i` where the lower value is always 1. A call to `dice` requires you to specify the number of sides on the dice. A standard dice has 6 sides, so `dice(6)` will act very similarly - returning values of either 1, 2, 3, 4, 5, or 6. However, just like fantasy role-play games, you might find value in a 4 sided dice, or a 12 sided dice, or a 20 sided dice - perhaps even a 120 sided dice!
ro: Uneori vrei sa simulezi ca dai cu zarul - este un caz particular pentru 'rrand_i' in care valoarea minima este mereu 1. Un apel al functiei 'dice' cere sa specifici numarul de fete ale zarului. Un zar standard are 6 fete, deci 'dice(6)' va avea un comportament asemanator - va returna valorile 1, 2, 3, 4, 5 sau 6. Totusi, la fel ca in jocurile fantasy ai putea considera util un zar cu 4 fete, sau cu 12, sau 20 - poate chiar cu 120 de fete!

en: Finally you may wish to emulate throwing the top score of a dice such as a 6 in a standard dice. `one_in` therefore returns true with a probability of one in the number of sides on the dice. Therefore `one_in(6)` will return true with a probability of 1 in 6 or false otherwise. True and false values are very useful for `if` statements which we will cover in a subsequent section of this tutorial.
ro: In fine, poate doresti sa emulezi obtinerea scorului maxim la un zar, cum ar fi 6 in cazul celui standard. 'one_in' returneaza true cu o probabilitate de 1 din numarul de fete ale zarului. Astfel, 'one_in(6)' va returna true cu probabilitate de 1 din 6 si false in celelalte cazuri. True si false (adevarat si fals) sunt valori utile pentru instructiunile 'if' (daca) despre care vom vorbi mai tarziu in acest tutorial.

en: Now, go and jumble up your code with some randomness!
ro: Acum, poti incepe sa zapacesti codul tau cu putin aleatorism!

en: 5 Programming Structures
ro: 5 Structuri de programare

en: Programming Structures
ro: Structuri de programare

en: Now that you've learned the basics of creating sounds with `play` and `sample` and creating simple melodies and rhythms by `sleep`ing between sounds, you might be wondering what else the world of code can offer you...
ro: Acum ca ai invatat bazele producerii de sunete folosind 'play' si 'sample' si crearea de melodii simple folosind 'sleep' (pauza) intre sunete, ai putea sa te intrebi ce iti mai poate oferi lumea programarii...

en: Well, you're in for an exciting treat! It turns out that basic programming structures such as looping, conditionals, functions and threads give you amazingly powerful tools to express your musical ideas.
ro: Ei bine, te asteapta lucruri interesante.Se pare ca structurile de baza din programare, cum ar fi buclele, conditiile, functiile si firele de executie iti ofera niste unelte incredibil de puternice pentru a-ti manifesta talentul muzical.

en: Let's get stuck in with the basics...
ro: Sa ramanem la elementele de baza...

en: 5.1 Blocks
ro: 5.1 Blocuri

en: Blocks
ro: Blocuri

en: A structure you'll see a lot in Sonic Pi is the block. Blocks allow us to do useful things with large chunks of code. For example, with synth and sample parameters we were able to change something that happened on a single line. However, sometimes we want to do something meaningful to a number of lines of code. For example, we may wish to loop it, to add reverb to it, to only run it 1 time out of 5, etc. Consider the following code:
ro: O structura pe care o vei intalni adesea in Sonic Pi este blocul. Blocurile iti permit sa faci lucruri utile cu bucati mari de cod. De exemplu, cu comanda synth si cativa parametri am reusit sa schimbam ceva ce a influentat o singura linie. Totusi, uneori vrem sa facem astfel de modificari care sa influenteze mai multe linii de cod. De exemplu, am putea dori sa le reluam in bucla (loop), sa adaugam un efect reverb, sa le rulam doar 1 data din 5, etc. Sa analizam codul urmator:

en: To do something with a chunk of code, we need to tell Sonic Pi where the code block *starts* and where it *ends*. We use `do` for start and `end` for end. For example:
ro: Pentru a actiona asupra unei bucati de cod, trebuie sa transmitem catre Sonic Pi unde *incepe* si unde *se termina*. Folosim 'do' pentru inceput si 'end' pentru sfarsit. De exemplu:

en: However, this isn't yet complete and won't work (try it and you'll get an error) as we haven't told Sonic Pi what we want to do with this *do/end block*. We tell Sonic Pi this by writing some special code before the `do`. We'll see a number of these special pieces of code later on in this tutorial. For now, it's important to know that wrapping your code within `do` and `end` tells Sonic Pi you wish to do something special with that chunk of code.
ro: Totusi, nu este inca suficient si bucata respectiva nu functioneaza (incearca sa o executi si vei primi un mesaj de eroare) deoarece nu am transmis Sonic Pi ce vrem sa faca cu acest *bloc do/end*. Putem transmite acest lucru catre Sonic Pi scriind comenzi specifice inainte de 'do'. Vom vedea mai multe astfele de bucati de cod mai tarziu pe parcursul tutorialului. Pentru moment este important de stiut ca delimitand o parte din cod cu 'do' si 'end' Sonic Pi va sti ca vrei sa faci ceva special cu acea bucata.

en: 5.2 Iteration and Loops
ro: 5.2 Iteratii si bucle

en: Iteration and Loops
ro: Iteratii si bucle

en: So far we've spent a lot of time looking at the different sounds you can make with `play` and `sample` blocks. We've also learned how to trigger these sounds through time using `sleep`.
ro: Pana acum am petrecut mare parte din timp analizand diferite sunete pe care le poti crea folosind comenzi 'play' si 'sample'. Am invatat de asemenea cum putem alege momentul cand pornim aceste sunete folosind 'sleep'.

en: As you've probably found out, there's a *lot* of fun you can have with these basic building blocks. However, a whole new dimension of fun opens up when you start using the power of code to structure your music and compositions. In the next few sections we'll explore some of these powerful new tools. First up is iteration and loops.
ro: Dupa cum ai observat probabil, poti face *o gramada* de chestii interesante folosind aceste blocuri de baza. Folosind puterea programarii pentru a-ti structura muzica si compozitiile ti se vor deschide insa noi perspective. In urmatoarele sectiuni vom explora cateva dintre aceste unelte noi si puternice. Sa incepem cu iteratiile si buclele.

en: Repetition
ro: Repetitia

en: Have you written some code you'd like to repeat a few times? For example, you might have something like this:
ro: Ai scris vreo bucata de cod pe care ai vrea sa o repeti de cateva ori? De exemplu, ai putea avea ceva de genul:

en: What if we wished to repeat this 3 times? Well, we could do something simple and just copy and paste it three times:
ro: Cum ar fi daca ai vrea sa se repete de 3 ori? Ei bine, putem face ceva simplu - o copiem si apoi o lipim de 3 ori:

en: Now that's a lot of code! What happens if you want to change the sample to `:elec_plip`? You're going to have to find all the places with the original `:elec_blup` and switch them over. More importantly, what if you wanted to repeat the original piece of code 50 times or 1000? Now that would be a lot of code, and a lot of lines of code to alter if you wanted to make a change.
ro: E ceva cod acolo! Ce se intampla daca vrei sa schimbi esantionul cu ':elec_plip'? Va trebui sa gasesti toate locurile in care apare cel initial - ':elec_blup' si sa il inlocuiesti peste tot. Mai mult, ce s-ar intampla daca ai vrea sa repeti bucata initiale de 50 de ori sau chiar de 1000? Atunci chiar ar fi o gramada de cod si deci o gramada de linii pe care ar trebui sa le modifici daca ai vrea sa faci o schimbare.

en: Iteration
ro: Iteratia

en: In fact, repeating the code should be as easy as saying *do this three times*. Well, it pretty much is. Remember our old friend the code block? We can use it to mark the start and end of the code we'd like to repeat three times. We then use the special code `3.times`. So, instead of writing *do this three times*, we write `3.times do` - that's not too hard. Just remember to write `end` at the end of the code you'd like to repeat:
ro: De fapt, repetarea unei bucati de cod ar trebui sa fie la fel de simpla ca a spune *fa asta de trei ori*. Cam asa si este. Iti aduci aminte de prietenul nostru - blocul de cod? Putem sa-l folosim pentru a marca inceputul si sfarsitul codului pe care vrem sa-l repetam de trei ori. Apoi vom folosi comanda speciala '3.times'. Deci, in loc sa scriem *fa asta de trei ori (do this three times)*, scriem `3.times do` - nu pare prea greu. Tine minte sa scrii 'end' la sfarsitul codului care vrei sa se repete:

en: Now isn't that much neater than cutting and pasting! We can use this to create lots of nice repeating structures:
ro: Nu-i asa ca e mult mai curat decat metoda copy/paste? Putem folosi blocurile pentru a crea  mai multe structuri repetitive:

en: Nesting Iterations
ro: Iteratii in cadrul altor iteratii

en: We can put iterations inside other iterations to create interesting patterns. For example:
ro: Putem pune iteratii inauntrul altor iteratii pentru a crea niste midele interesante. De exemplu:

en: Looping
ro: Reluarea in bucla

en: If you want something to repeat a lot of times, you might find yourself using really large numbers such as `1000.times do`. In this case, you're probably better off asking Sonic Pi to repeat forever (at least until you press the stop button!). Let's loop the amen break forever:
ro: Daca vrei ca o bucata sa se repete de multe ori, ai putea fi nevoit sa folosesti numere foarte mari, de exemplu `1000.times do`. In acest caz, probabil ca e mai bine sa ceri Sonic Pi sa repete la infinit (sau macar pana cand apesi butonul de oprire!). Sa redam amen break in bucla la infinit:

en: The important thing to know about loops is that they act like black holes for code. Once the code enters a loop it can never leave until you press stop - it will just go round and round the loop forever. This means if you have code after the loop you will *never* hear it. For example, the cymbal after this loop will never play:
ro: Un lucru de tinut minte este ca aceste bucle actioneaza ca niste gauri negre pentru cod. Odata ce codul ajunge la bucla (loop), el nu o va parasi niciodata daca nu apesi pe butonul de oprire - pur si simplu va relua la nesfarsit bucla. Asta inseamna ca daca ai cod scris dupa loop, nu il vei auzi *niciodata*. De exemplu, talerul de dupa loop nu va fi redat niciodata:

en: Now, get structuring your code with iteration and loops!
ro: Acum poti incepe sa-ti structurezi codul folosind iteratii si bucle!

en: 5.3 Conditionals
ro: 5.3 Conditii

en: Conditionals
ro: Conditii

en: A common thing you'll likely find yourself wanting to do is to not only play a random note (see the previous section on randomness) but also make a random decision and based on the outcome run some code or some other code. For example, you might want to randomly play a drum or a cymbal. We can achieve this with an `if` statement.
ro: Ai putea dori nu doar sa redai o nota aleatoare (vezi sectiunea precedenta pentru aleatorism), dar si sa iei o decizie aleatoare si pe baza rezultatului ei sa executi o bucata de cod sau alta. De exemplu, ai putea dori sa redai la intamplare o toba sau un taler. Putem obtine acest lucru folosind instructiunea 'if'.

en: Flipping a Coin
ro: Datul cu banul

en: So, let's flip a coin: if it's heads, play a drum, if it's tails, play a cymbal. Easy. We can emulate a coin flip with our `one_in` function (introduced in the section on randomness) specifying a probability of 1 in 2: `one_in(2)`. We can then use the result of this to decide between two pieces of code, the code to play the drum and the code to play the cymbal:
ro: Deci, sa dam cu banul: daca iese cap, redam toba, daca este pajura, redam talerul. Usor. Putem simula datul cu banul cu functia 'one_in' (prezentata in sectiunea despre aleatorism) specificand o probabilitate de 1 din 2: `one_in(2)`. Putem apoi folosi rezultatul pentru a decide intre doua bucati de cod, cea pentru toba si cea pentru taler:

en: Notice that `if` statements have three parts:
ro: Instructiunea 'if' are trei parti:

en: The question to ask
ro: Intrebarea care trebuie pusa

en: The first choice of code to run (if the answer to the question is yes)
ro: Prima optiune pentru codul de executat (daca raspunsul la intrebare este da)

en: The second choice of code to run (if the answer to the question is no)
ro: A doua optiune pentru codul de executat (daca raspunsul la intrebare este nu)

en: Typically in programming languages, the notion of yes is represented by the term `true` and the notion of no is represented by the term `false`. So we need to find a question that will give us a `true` or `false` answer which is exactly what `one_in` does.
ro: In general, in limbajele de programare, raspunsul da este reprezentat prin termenul 'true' (adevarat), iar raspunsul nu este reprezentat prin termenul 'false' (fals). Deci trebuie sa gasim o intrebare la care raspunsul este 'true' sau 'false', adica exact ceea ce face 'one_in'.

en: Notice how the first choice is wrapped between the `if` and the `else` and the second choice is wrapped between the `else` and the `end`. Just like do/end blocks you can put multiple lines of code in either place. For example:
ro: Prima optiune este delimitata de 'if' si 'else', in timp ce a doua este delimitata de 'else' si 'end'. La fel ca in cazul blocurilor do/end, poti pune mai multe linii de cod in oricare dintre cele doua locuri. De exemplu:

en: This time we're sleeping for a different amount of time depending on which choice we make.
ro: De data asta vom face pauze de durate diferite in functie de algerile pe care le facem.

en: Simple if
ro: If simplu

en: Sometimes you want to optionally execute just one line of code. This is possible by placing `if` and then the question at the end. For example:
ro: Uneori vrem ca o instructiune unica sa se execute optional. Acest lucru este posibil prin adaugarea unui 'if' si a conditiei la sfarsit. De exemplu:

en: This will play chords of different numbers with the chance of each note playing having a different probability.
ro: Acest cod va reda acorduri cu componente diferite, cu probabilitati diferite pentru fiecare nota de a face parte din acestea.

en: 5.4 Threads
ro: 5.5 Fire de executie

en: Threads
ro: Fire de executie

en: So you've made your killer bassline and a phat beat. How do you play them at the same time? One solution is to weave them together manually - play some bass, then a bit of drums, then more bass... However, the timing soon gets hard to think about, especially when you start weaving in more elements.
ro: Sa zicem ca ai obtinut un bass incredibil si un beat pe masura. Cum le redai in acelasi timp? O solutie este sa combini liniile manual - redai un pic de bas, apoi putin toba, iarasi bas... Dar potrivirea timpilor va deveni rapid greu de gestionat, mai ales daca mai ai de introdus si alte elemente.

en: What if Sonic Pi could weave things for you automatically? Well, it can, and you do it with a special thing called a *thread*.
ro: Dar daca Sonic Pi ar putea sa faca automat intreteserea sunetelor? Ei bine, chiar poate si acest lucru se realizeaza folosind ceea ce se numeste *thread (fir de executie)*.

en: Infinite Loops
ro: Bucle infinite

en: To keep this example simple, you'll have to imagine that this is a phat beat and a killer bassline:
ro: Pentru simplitate, vom considera ca acestea sunt basul incredibil si beatul pe masura:

en: As we've discussed previously, loops are like *black holes* for the program. Once you enter a loop you can never exit from it until you hit stop. How do we play both loops at the same time? We have to tell Sonic Pi that we want to start something at the same time as the rest of the code. This is where threads come to the rescue.
ro: Asa cum am discutat, buclele sunt *gauri negre* pentru program. Odata intrat intr-o bucla (loop) nu mai poti sa iesi decat apasand pe stop. Cum redam cele doua bucle in acelasi timp? Trebuie sa instruim Sonic Pi sa porneasca ceva in acelasi timp cu restul codului. Aici intervin firele de executie.

en: Threads to the Rescue
ro: Salvarea oferita de firele de executie (threads)

en: By wrapping the first loop in an `in_thread` do/end block we tell Sonic Pi to run the contents of the do/end block at *exactly* the same time as the next statement after the do/end block (which happens to be the second loop). Try it and you'll hear both the drums and the bassline weaved together!
ro: Introducand prima bucla intr-un bloc do/end 'in_thread', spunem Sonic Pi sa ruleze continutul blocului do/end *exact* in acelasi timp cu instructiunea care urmeaza dupa blocul respectiv (care se intampla sa fie a doua bucla). Incearca si vei auzi atat tobele cat si basul in acelasi timp!

en: Now, what if we wanted to add a synth on top. Something like:
ro: Cum ar fi daca am vrea sa adaugam si un sintetizator pe deasupra? Ceva gen:

en: Now we have the same problem as before. The first loop is played at the same time as the second loop due to the `in_thread`. However, *the third loop is never reached*. We therefore need another thread:
ro: Avem aceeasi problema ca mai inainte. Prima bucla este redata in acelasi timp cu a doua datorita instructiunii 'in_thread'. Totusi, *a treia bucla nu este redata niciodata*. Trebuie deci sa folosim un nou thread:

en: Runs as threads
ro: Rularea ca fire de executie

en: What may surprise you is that when you press the Run button, you're actually creating a new thread for the code to run. This is why pressing it multiple times will layer sounds over each other. As the runs themselves are threads, they will automatically weave the sounds together for you.
ro: S-ar putea sa te surprinda faptul ca atunci cand apesi butonul Executa (Run), de fapt creezi un nou fir de executie pentru cod. De aceea, apasarea repetata a butonului va face ca sunetele sa se suprapuna. Cum rularile codului sunt fire de executie, ele vor imbina automat sunetele pentru tine.

en: Scope
ro: Domeniu

en: As you learn how to master Sonic Pi, you'll learn that threads are the most important building blocks for your music. One of the important jobs they have is to isolate the notion of *current settings* from other threads. What does this mean? Well, when you switch synths using `use_synth` you're actually just switching the synth in the *current thread* - no other thread will have their synth switched. Let's see this in action:
ro: Pe masura ce inveti cum sa stapanesti Sonic Pi, vei invata ca firele de executie sunt cele mai importante blocuri din care este construita muzica. Unul dintre cele mai importante roluri pe care le au este sa izoleze *setarile curente* de celelalte fire. Ce inseamna asta? Ei bine, cand schimbi sintetizatorul folosind 'use_synth', acest lucru se refera doar la *firul curent* - in niciun alt thread sintetizatorul nu va fi schimbat. Sa vedem un exemplu:

en: Notice how the middle sound was different to the others? The `use_synth` statement only affected the thread it was in and not the outer main run thread.
ro: Ai observat ca sunetul de la jumatate este diferit de celelalte? Comanda 'use_synth' a afectat doar thread-ul din care face parte, nu si thread-ul principal.

en: Inheritance
ro: Mostenire

en: When you create a new thread with `in_thread`, the new thread will automatically inherit all of the current settings from the current thread. Let's see that:
ro: Cand creezi un nou thread folosind 'in_thread', acesta va mosteni automat toate setarile de la thread-ul curent. Sa vedem:

en: Notice how the second note is played with the `:tb303` synth even though it was played from a separate thread? Any of the settings modified with the various `use_*` functions will behave in the same way.
ro: Ai observat ca a doua nota a fost redata folosind sintetizatorul ':tb303' desi a fost redata intr-un thread separat? Oricare dintre parametrii modificati cu diferitele functii 'use*' se va comporta in acelasi mod.

en: When threads are created, they inherit all the settings from their parent but they don't share any changes back.
ro: Cand un thread este creat, va mosteni toate setarile de la thread-ul parinte, dar nu va transmite inapoi nicio modificare.

en: Naming Threads
ro: Numele thread-urilor

en: Finally, we can give our threads names:
ro: Putem da nume thread-urilor noastre:

en: Look at the log pane when you run this code. See how the log reports the name of the thread with the message?
ro: Priveste panoul continand jurnalul cand executi codul acesta. Ai observat ca in jurnal apare numele thread-ului?

en: Only One Thread per Name Allowed
ro: Un singur thread poate avea un anumit nume

en: One last thing to know about named threads is that only one thread of a given name may be running at the same time. Let's explore this. Consider the following code:
ro: Un ultim lucru de retinut despre thread-uri este ca un singur thread cu un anumit nume poate rula la un moment dat. Sa exprimentam folosind urmatorul cod:

en: Go ahead and paste that into a buffer and press the Run button. Press it again a couple of times. Listen to the cacophony of multiple amen breaks looping out of time with each other. Ok, you can press Stop now.
ro: Incearca sa copiezi codul asta intr-un buffer si apasa pe butonul Run. Apasa din nou de mai multe ori. Asculta cacofonia de amen break care se reiau si se suprapun. Ok, acum apasa pe Stop.

en: This is the behaviour we've seen again and again - if you press the Run button, sound layers on top of any existing sound. Therefore if you have a loop and press the Run button three times, you'll have three layers of loops playing simultaneously.
ro: Acesta este comportamentul pe care l-am vazut de mai multe ori - apesi pe Run si sunetele se suprapun peste cele deja existente. Deci daca ai o bucla si apesi pe Run de trei ori, vei avea trei randuri de bucle care sunt redate concomitent.

en: However, with named threads it is different:
ro: Totusi, folosind thread-urile cu nume, lucrurile stau diferit:

en: Try pressing the Run button multiple times with this code. You'll only ever hear one amen break loop. You'll also see this in the log:
ro: Incearca sa apesi butonul Run de mai multe ori pentru acest cod. Vei auzi o singura bucla cu amen break. De asemenea, vei observa asta in jurnal:

en: Sonic Pi is telling you that a thread with the name `:amen` is already playing, so it's not creating another.
ro: Sonic Pi iti spune ca exista deja un thread cu numele ':amen' care ruleaza, deci nu va crea un altul.

en: This behaviour may not seem immediately useful to you now - but it will be very handy when we start to live code...
ro: Acest comportament poate ca nu pare util pentru moment, dar va fi folositor cand vei incepe sa programezi in direct...

en: 5.5 Functions
ro: 5.5 Functii

en: Functions
ro: Functii

en: Once you start writing lots of code, you may wish to find a way to organise and structure things to make them tidier and easier to understand. Functions are a very powerful way to do this. They give us the ability to give a name to a bunch of code. Let's take a look.
ro: Dupa ce vei incepe sa scrii serios la cod, vei dori sa gasesti o cale sa organizezi si sa structurezi lucrurile astfel incat sa arate mai curat si sa fie usor de inteles. Functiile ofera o unealta foarte utila pentru aceasta. Ele ne ofera posibilitatea sa dam un nume unei bucati de cod. Sa aruncam o privire.

en: Defining functions
ro: Definirea functiilor

en: Here, we've defined a new function called `foo`. We do this with our old friend the do/end block and the magic word `define` followed by the name we wish to give to our function. We didn't have to call it `foo`, we could have called it anything we want such as `bar`, `baz` or ideally something meaningful to you like `main_section` or `lead_riff`.
ro: Aici am definit o functie noua, numita 'foo'. Pentru asta folosim blocul do/end si cuvantul magic 'define' (defineste) urmat de numele pe care vrem sa-l dam functiei. Nu suntem obligati sa o numim 'foo', puteam sa ii spunem si 'bar, 'baz' sau, mai bine, un nume care chiar inseamna ceva, gen 'sectiune_principala' sau 'lead_riff'.

en: Remember to prepend a colon `:` to the name of your function when you define it.
ro: Tine minte sa treci intotdeauna doua puncte ':' inaintea numelui functiei cand o definesti.

en: Calling functions
ro: Apelarea functiilor

en: Once we have defined our function we can call it by just writing its name:
ro: Odata ce am definit o functie, putem sa o apelam doar scriindu-i numele:

en: We can even use `foo` inside iteration blocks or anywhere we may have written `play` or `sample`. This gives us a great way to express ourselves and to create new meaningful words for use in our compositions.
ro: Putem folosi 'foo' in interiorul unor iteratii sau oriunde am fi folosit 'play' sau 'sample'. Aceasta ne ofera un mod interesat de a ne exprima si de a crea cuvinte noi pe care sa le folosim in compozitii.

en: Functions are remembered across runs
ro: Functiile sunt memorate intre executii

en: So far, every time you've pressed the Run button, Sonic Pi has started from a completely blank slate. It knows nothing except for what is in the buffer. You can't reference code in another buffer or another thread. However, functions change that. When you define a function, Sonic Pi *remembers* it. Let's try it. Delete all the code in your buffer and replace it with:
ro: Pana acum, de fiecare data cand ai apasat butonul Run, Sonic Pi a pornit de la zero. Nu stie nimic in afara de ceea ce se afla in buffer. Nu poti sa faci referire la codul din alt buffer sau din alt thread. Functiile schimba acest lucru. Cand definesti o functie, Sonic Pi *o tine minte*. Sa incercam. Sterge tot codul din buffer si inlocuieste-l cu:

en: Press the Run button - and hear your function play. Where did the code go? How did Sonic Pi know what to play? Sonic Pi just remembered your function - so even after you deleted it from the buffer, it remembered what you had typed. This behaviour only works with functions created using `define` (and `defonce`).
ro: Apasa butonul Run si vei auzi functia cantand. Unde s-a dus codul? Cum a stiut Sonic Pi ce sa cante? Sonic Pi a memorat functia ta - deci si dupa ce ai sters-o din buffer, tine minte ce ai scris acolo. Acest comportament este valabil doar pentru functiile create folosind 'define' (si 'defonce').

en: Parameterised functions
ro: Functii cu parametri

en: You might be interested in knowing that just like you can pass min and max values to `rrand`, you can teach your functions to accept arguments. Let's take a look:
ro: Asa cum poti transmite functiei 'rrand' valorile pentru min si max, poti invata functiile tale sa accepte argumente. Sa aruncam o privire:

en: This isn't very exciting, but it illustrates the point. We've created our own version of `play` called `my_player` which is parameterised.
ro: Nu e prea palpitant, dar ilustreaza ce am spus. Am creat propria versiune pentru 'play', numita 'my_player', care accepta un argument.

en: The parameters need to go after the `do` of the `define` do/end block, surrounded by vertical goalposts `|` and separated by commas `,`. You may use any words you want for the parameter names.
ro: Argumentele (parametrii functiei) trebuie sa urmeze dupa 'do' din blocul do/end 'define', incadrati de bare verticale '|' si separati de virgule ','. Poti utiliza ce cuvinte vrei pentru numele parametrilor.

en: The magic happens inside the `define` do/end block. You may use the parameter names as if they were real values. In this example I'm playing note `n`. You can consider the parameters as a kind of promise that when the code runs, they will be replaced with actual values. You do this by passing a parameter to the function when you call it. I do this with `my_player 80` to play note 80. Inside the function definition, `n` is now replaced with 80, so `play n` turns into `play 80`. When I call it again with `my_player 90`, `n` is now replaced with 90, so `play n` turns into `play 90`.
ro: Partea magica se afla in interiorul blocului do/end 'define'. Poti folosi numele parametrilor ca si cum ar fi valori reale. In acest exemplu, redau nota 'n'. Poti considera parametrii ca un fel de promisiune ca la momentul executiei codului ei vor fi inlocuiti cu valori reale. Acest lucru se face transmitand parametrii functiei cand o apelezi. Eu am facut asta in linia 'my_player 80' pentru a reda nota 80. In cadrul definitiei functiei, 'n' este acum inlocuit cu 80, deci 'play n' se transforma in 'play 80'. Cand voi apela din nou functia cu 'my_player 90', 'n' va fi inlocuit cu 90, deci 'play n' va deveni 'play 90'.

en: Let's see a more interesting example:
ro: Sa vedem un exemplu mai interesant:

en: Here I used `repeats` as if it was a number in the line `repeats.times do`. I also used `root` as if it was a note name in my call to `play`.
ro: Aici am folosit 'repeats' ca si cum ar fi fost un numar in linia 'repeats.times do'. De asemenea am folosit 'root' ca si cand ar fi fost numele unei note cand am apelat 'play'.

en: See how we're able to write something very expressive and easy to read by moving a lot of our logic into a function!
ro: Iata cum am reusit sa scriem ceva foarte expresiv si usor de citit mutand o parte din cod intr-o functie!

en: 5.6 Variables
ro: 5.6 Variabile

en: Variables
ro: Variabile

en: A useful thing to do in your code is to create names for things. Sonic Pi makes this very easy: you write the name you wish to use, an equal sign (`=`), then the thing you want to remember:
ro: Un lucru util pe care il putem face in cadrul codului nostru este sa cream nume pentru obiecte. In Sonic Pi asta se face foarte usor, scrii un nume pe care vrei sa-l folosesti, semnul egal ('='), apoi obiectul pe care vrei sa-l memorezi:

en: Here, we've 'remembered' the symbol `:loop_amen` in the variable `sample_name`. We can now use `sample_name` everywhere we might have used `:loop_amen`. For example:
ro: Aici, am 'memorat' simbolul ':loop_amen' in variabila 'sample_name'. Putem folosi 'sample_name' oriunde am fi folosit ':loop_amen'. De exemplu:

en: There are three main reasons for using variables in Sonic Pi: communicating meaning, managing repetition and capturing the results of things.
ro: Exista trei motive principale pentru utilizarea variabilelor in Sonic Pi: comunicarea rolului, gestiunea repetitiilor si stocarea rezultatului unor actiuni.

en: Communicating Meaning
ro: Comunicarea rolului

en: When you write code it's easy to just think you're telling the computer how to do stuff - as long as the computer understands it's OK. However, it's important to remember that it's not just the computer that reads the code. Other people may read it too and try to understand what's going on. Also, you're likely to read your own code in the future and try to understand what's going on. Although it might seem obvious to you now - it might not be so obvious to others or even your future self!
ro: Cand scrii cod e usor sa te gandesti doar ca tu ii spui calculatorului sa faca un anumit lucru - cat timp computerul intelege este OK. Totusi, e important sa te gandesti ca nu doar computerul citeste codul. Alte persoane ar putea sa il citeasca de asemenea si sa incerce sa inteleaga despre ce este vorba. De asemenea, e posibil ca tu sa iti recitesti propriul cod mai tarziu si sa vrei sa intelegi cum functioneaza. Desi ar putea sa ti se para evident acum, acest lucru ar putea sa nu fie valabil pentru altii sau chiar pentru tine in viitor!

en: One way to help others understand what your code is doing is to write comments (as we saw in a previous section). Another is to use meaningful variable names. Look at this code:
ro: Un mod de a-i ajuta pe altii sa inteleaga ce face codul tau este sa scrii comentarii (asa cum am vazut intr-o sectiune anterioare). Alt mod este sa folosesti variabile cu nume alese conform rolului lor. Priveste acest cod:

en: Why does it use the number `1.7533`? Where did this number come from? What does it mean? However, look at this code:
ro: De ce foloseste acest numar,  `1.7533`? De unde vine acest numar? Ce inseamna? Priveste acum acest cod:

en: Now, it's much clearer what `1.7533` means: it's the duration of the sample `:loop_amen`! Of course, you might say why not simply write:
ro: Acum este mult mai clar ce inseamna  `1.7533`: este durata esantionului ':loop_amen'! Desigur, ai putea spune ca e mai simplu sa scrii:

en: Which, of course, is a very nice way of communicating the intent of the code.
ro: Care este, desigur, un mod potrivit de a comunica scopul codului respectiv.

en: Managing Repetition
ro: Gestionarea repetitiilor

en: Often you see a lot of repetition in your code and when you want to change things, you have to change it in a lot of places. Take a look at this code:
ro: Adesea poti vedea multe repetitii in cod si cand vrei sa schimbi ceva trebuie sa schimbi intr-o multime de locuri. Priveste acest cod:

en: We're doing a lot of things with `:loop_amen`! What if we wanted to hear what it sounded like with another loop sample such as `:loop_garzul`? We'd have to find and replace all `:loop_amen`s with `:loop_garzul`. That might be fine if you have lots of time - but what if you're performing on stage? Sometimes you don't have the luxury of time - especially if you want to keep people dancing.
ro: Folosim in multe locuri ':loop_amen!' Sa presupunem ca vrem sa auzim cum ar suna daca am folosi un alt esantion, cum ar fi ':loop_garzul'. Ar trebui sa inlocuim peste tot  `:loop_amen` cu `:loop_garzul`. Ar putea fi OK daca ai avea o gramada de timp la dispozitie, dar daca interpretezi live pe scena? Uneori nu iti permiti luxul de a pierde timpul, mai ales cand vrei ca lumea sa danseze in continuu.

en: What if you'd written your code like this:
ro: Daca ai fi scris codul astfel:

en: Now, that does exactly the same as above (try it). It also gives us the ability to just change one line `sample_name = :loop_amen` to `sample_name = :loop_garzul` and we change it in many places through the magic of variables.
ro: Codul ar face acelasi lucru ca cel de mai sus (poti incerca). Dar ne da si posibilitatea de a modifica o singura linie din `sample_name = :loop_amen` in `sample_name = :loop_garzul`, ceea ce va schimba esantionul redat in mai multe locuri folosind magia variabilelor.

en: Capturing Results
ro: Stocarea rezultatelor

en: Finally, a good motivation for using variables is to capture the results of things. For example, you may wish to do things with the duration of a sample:
ro: In fine, un motiv bun pentru a utiliza variabilele este acela ca ajuta la stocarea rezultatelor. De exemplu, ai putea dori sa faci anumite lucruri cu durata esantionului:

en: We can now use `sd` anywhere we need the duration of the `:loop_amen` sample.
ro: Acum putem folosi 'sd' oriunde avem nevoie de durata esantionului ':loop_amen'.

en: Perhaps more importantly, a variable allows us to capture the result of a call to `play` or `sample`:
ro: Poate mai important, o variabila ne permite sa stocam rezultatul unui apel al unei functii 'play' sau 'sample':

en: Now we have caught and remembered `s` as a variable, which allows us to control the synth as it is running:
ro: Acum am memorat 's' ca o variabila, ceea ce ne permite sa controlam sintetizatorul in timpul functionarii:

en: We'll look into controlling synths in more detail in a later section.
ro: Vom intra in detalii privind controlul sintetizatoarelor intr-o sectiune ulterioara.

en: Whilst variables are great for giving things names and capturing the results of things, it is important to know that they should typically only be used locally within a thread. For example, *don't do this*:
ro: Variabilele sunt foarte utile pentru a atribui nume diferitelor obiecte si pentru a pastra rezultatul unor calcule, dar este important sa stiti ca ele ar trebui in general sa fie folosite doar local in cadrul unui thread. De exemplu, *nu faceti asta*:

en: In the above example we assign a ring of numbers to a variable `a` and then used it within two separate `live_loop`s. In the first live loop every `0.5`s we sort the ring (to `(ring 1, 2, 3, 4, 5, 6)`) and then print it out to the log. If you run the code, you'll find that the printed list *is not always sorted!*. This may surprise you - especially that sometimes the list is printed as sorted, and sometimes it is not. This is called non-deterministic behaviour and is the result of a rather nasty problem called a race-condition. The problem is due to the fact that the second live loop is also manipulating the list (in this case shuffling it) and by the time the list is printed, sometimes it has just been sorted and sometimes it has just been shuffled. Both live loops are racing to do something different to the same variable and every time round a different loop 'wins'.
ro: In exemplul de mai sus am atribuit unei variabile `a` o lista circulara de numere si apoi am folosit-o in doua `live-loop`-uri separate. In prima bucla sortam lista (la `(ring 1, 2, 3, 4, 5, 6)`) si apoi o afisam in jurnal. Daca rulezi codul, vei vedea ca lista printata *nu este intotdeauna sortata!*. Lucrul acesta ar putea sa te surprinda - mai ales ca uneori lista este sortata, iar alteori nu. Acesta comportament este denumit nedeterminist si este rezultatul unei probleme neplacute cunoscuta ca race-condition. Aceasta problema apare datorita faptului ca a doua bucla incearca de asemenea sa manipuleze lista (in acest caz prin aleatorizarea ei), iar in momentul in care aceasta este tiparita, uneori tocmai a fost sortata iar alteori tocmai a fost amestecata. Cele doua bucle sunt in competitie pentru a efectua operatii diferite cu aceeasi variabila si de fiecare data o alta bucla 'castiga'.

en: There are two solutions to this. Firstly, *don't use the same variable in multiple live loops or threads*. For example, the following code will always print a sorted list as each live loop has its own separate variable:
ro: Exista doua solutii pentru aceasta problema. Prima ar fi *nu utiliza aceeasi variabila in mai multe bucle live sau thread-uri*. De exemplu, codul de mai jos va afisa intotdeauna lista sortata deoarece fiecare bucla are propria variabila:

en: However, sometimes we do want to share things across threads. For example, the current key, BPM, synth etc. In these cases, the solution is to use Sonic Pi's special thread-safe state system via the fns `get` and `set`. This is discussed later on in section 10.
ro: Totusi, uneori chiar vrem sa folosim in comun diferite obiecte in cadrul unor thread-uri diferite. De exemplu: cheia curenta, ritmul, sintetizatorul etc. In aceste cazuri, solutia este folosirea sistemului de stari din Sonic Pi, folosind functiile `get` si `set` care asigura consistenta la nivel de thread. Acesta va fi prezentat in sectiunea 10.

en: 5.7 Thread Synchronisation
ro: 5.7 Sincronizarea firelor de executie

en: Thread Synchronisation
ro: Sincronizarea firelor de executie

en: Once you have become sufficiently advanced live coding with a number of functions and threads simultaneously, you've probably noticed that it's pretty easy to make a mistake in one of the threads which kills it. That's no big deal, because you can easily restart the thread by hitting Run. However, when you restart the thread it is now *out of time* with the original threads.
ro: Cand ai devenit suficient de avansat sa programezi live cu un numar de functii si thread-uri simultane, ai observat probabil ca este destul de usor sa faci o greseala intr-un thread astfel incat sa il blochezi. Asta nu e o mare problema, fiindca poti reporni usor thread-ul apasand pe Run. Totusi, daca repornesti un thread el va fi *decalat* fata de thread-urile originale.

en: Inherited Time
ro: Mostenirea pozitiei in timp

en: As we discussed earlier, new threads created with `in_thread` inherit all of the settings from the parent thread. This includes the current time. This means that threads are always in time with each other when started simultaneously.
ro: Asa cum am discutat anterior, thread-urile noi create cu 'in_thread' mostenesc toti parametrii de la thread-ul parinte. Asta include si pozitia in timp. Acest lucru inseamna ca thread-urile sunt mereu aliniate in timp daca au pornit simultan.

en: However, when you start a thread on its own it starts with its own time which is unlikely to be in sync with any of the other currently running threads.
ro: Totusi, daca pornesti un thread de sine statator, el va porni cu timpul sau propriu care este putin probabil sa fie sincronizat cu cel al altor thread-uri care ruleaza la momentul respectiv.

en: Cue and Sync
ro: Marcaje de timp si sincronizare

en: Sonic Pi provides a solution to this problem with the functions `cue` and `sync`.
ro: Sonic Pi ofera o solutie pentru aceast problema cu functiile 'cue' (marcaj de timp) si 'sync' (sincronizare).

en: `cue` allows us to send out heartbeat messages to all other threads. By default the other threads aren't interested and ignore these heartbeat messages. However, you can easily register interest with the `sync` function.
ro: 'cue' ne permite sa transmitem mesaje referitoare la tact catre alte thread-uri. Implicit celelalte thread-uri nu sunt interesate si vor ignora aceste mesaje. Totusi, poti sa le determini cu usurinta sa devina interesate folosind functia 'sync'.

en: The important thing to be aware of is that `sync` is similar to `sleep` in that it stops the current thread from doing anything for a period of time. However, with `sleep` you specify how long you want to wait while with `sync` you don't know how long you will wait - as `sync` waits for the next `cue` from another thread which may be soon or a long time away.
ro: Trebuie sa fii constient ca 'sync' este oarecum similar cu 'sleep' prin aceea ca opreste thread-ul curent sa faca orice pentru o anumita perioada de timp. Totusi, cu 'sleep' tu decizi cat vrei sa dureze pauza, in timp ce cu 'sync' nu stii cat timp va dura asteptare, deoarece 'sync' asteapta urmatorul 'cue' de la alt thread, care poate sosi mai devreme sau mai tarziu.

en: Let's explore this in a little more detail:
ro: Sa examinam acest lucru mai in detaliu:

en: Here we have two threads - one acting like a metronome, not playing any sounds but sending out `:tick` heartbeat messages every beat. The second thread is synchronising on `tick` messages and when it receives one it inherits the time of the `cue` thread and continues running.
ro: Aici avem doua thread-uri, unul actionand ca un metronom, fara sa redea vreun sunet, dar trimitand mesaje ':tick' corespunzator tactului la fiecare bataie. Al doilea thread este sincronizat cu mesajele 'tick' si cand primeste unul mosteneste timpul din thread-ul 'cue' continuand sa ruleze.

en: As a result, we will hear the `:drum_heavy_kick` sample exactly when the other thread sends the `:tick` message, even if the two threads didn't start their execution at the same time:
ro: Ca urmare, vom auzi esantionul `:drum_heavy_kick` exact cand cealalt thread trimite mesajul ':tick', chiar daca cele doua thread-uri nu au fost pornite in acelasi timp:

en: That naughty `sleep` call would typically make the second thread out of phase with the first. However, as we're using `cue` and `sync`, we automatically sync the threads bypassing any accidental timing offsets.
ro: Acel apel buclucas al functiei 'sleep' ar face in mod normal ca al doilea thread sa fie defazat fata de primul. Totusi, folosind 'cue' si 'sync', putem sincroniza automat thread-urile trecand peste decalajele accidentale.

en: Cue Names
ro: Nume pentru marcajele de timp

en: You are free to use whatever name you'd like for your `cue` messages - not just `:tick`. You just need to ensure that any other threads are `sync`ing on the correct name - otherwise they'll be waiting for ever (or at least until you press the Stop button).
ro: Esti liber sa folosesti ce nume doresti pentru mesajele 'cue', nu doar ':tick'. Trebuie doar sa te asiguri ca celelalte thread-uri se sincronizeaza dupa numele corect - in caz contrar ar putea astepta la infinit (sau pana cand apesi butonul Stop).

en: Let's play with a few `cue` names:
ro: Sa ne jucam putin cu numele pentru marcajele 'cue':

en: Here we have a main `cue` loop which is randomly sending one of the heartbeat names `:foo`, `:bar` or `:baz`. We then also have three loop threads syncing on each of those names independently and then playing a different sample. The net effect is that we hear a sound every 0.5 beats as each of the `sync` threads is randomly synced with the `cue` thread and plays its sample.
ro: Aici avem o bucla 'cue' principala care trimite aleator un tact dintre `:foo`, `:bar` si `:baz`. Avem apoi trei thread-uri de tip bucla care se sincronizeaza fiecare cu unul dintre cele trei nume si redau fiecare un alt esantion. Efectul final este ca auzim un sunet la fiecare 0.5 batai deoarece de fiecare data unul dintre thread-urile 'sync' se va sincroniza cu thread-ul 'cue' si va reda propriul esantion.

en: This of course also works if you order the threads in reverse as the `sync` threads will simply sit and wait for the next `cue`.
ro: Acest lucru va fi valabil desigur si daca schimbi ordinea thread-urilor, deoarece thread-urile 'sync' vor sta si vor astepta pur si simplu urmatorul 'cue'.

en: 6 FX
ro: 6 Efecte

en: Studio FX
ro: Efecte de studio

en: One of the most rewarding and fun aspects of Sonic Pi is the ability to easily add studio effects to your sounds. For example, you may wish to add some reverb to parts of your piece, or some echo or perhaps even distort or wobble your basslines.
ro: Una dintre caracteristicile cele mai atractive ale Sonic Pi este posibilitatea de a adauga cu usurinta efecte de studio sunetelor. De exemplu, ai putea dori sa adaugi un efect de reverb anumitor parti din piesa ta, sau un ecou, sau chiar distort sau wobble asupra basului.

en: Sonic Pi provides a very simple yet powerful way of adding FX. It even allows you to chain them (so you can pass your sounds through distortion, then echo and then reverb) and also control each individual FX unit with opts (in a similar way to giving params to synths and samples). You can even modify the opts of the FX whilst it's still running. So, for example, you could increase the reverb on your bass throughout the track...
ro: Sonic Pi ofera o cale foarte simpla dar foarte puternica pentru adaugarea efectelor. Iti permite chiar sa le inlantuiesti (astfel incat poti sa aplici sunetelor tale o distorsiune, apoi un ecou, apoi o reverberatie si sa controlezi fiecare efect individual folosind parametri (intr-un mod similar cu transmiterea parametrilor pentru sintetizatoare si esantioane). Poti chiar modifica parametrii pentru efecte in timp ce ruleaza. De exemplu, poti creste reverberatia pentru bas pe durata unui track...

en: Guitar Pedals
ro: Pedala de chitara

en: If all of this sounds a bit complicated, don't worry. Once you play around with it a little, it will all become quite clear. Before you do though, a simple analogy is that of guitar FX pedals. There are many kinds of FX pedals you can buy. Some add reverb, others distort etc. A guitarist will plug his or her guitar into one FX pedal - i.e. distortion -, then take another cable and connect (chain) a reverb pedal. The output of the reverb pedal can then be plugged into the amplifier:
ro: Daca suna putin complicat, nu te ingrijora. Dupa ce te vei juca putin cu ele va deveni destul de clar. Inainte sa faci asta, putem sa facem o analogie cu pedalele pentru chitara. Exista multe feluri de pedale pentru efecte pe care le poti cumpara. Unele adauga reverb, altele distort, etc. Un chitarist va conecta chitara sa la o pedala de efecte - sa zicem la cea de distorsiune - , apoi va lua alt cablu si va conecta (inlantui) si o pedala de reverb. Iesirea de la pedala reverb poate fi conectata la amplificator:

en: Guitar -> Distortion -> Reverb -> Amplifier
ro: Chitara -> Distorsiune -> Reverberatie -> Amplificator

en: This is called FX chaining. Sonic Pi supports exactly this. Additionally, each pedal often has dials and sliders to allow you to control how much distortion, reverb, echo etc. to apply. Sonic Pi also supports this kind of control. Finally, you can imagine a guitarist playing whilst someone plays with the FX controls whilst they're playing. Sonic Pi also supports this - but instead of needing someone else to control things for you, that's where the computer steps in.
ro: Aceasta se numeste o inlanuire de efecte. Sonic Pi suporta acest mod de lucru. In plus, fiecare pedala are adesea butoane si potentiometre pentru a-ti permite controlul asupra efectului pe care il aplici. Sonic Pi suporta si acest tip de control. Acum sa ne imaginam un chitarist care canta in timp ce cineva se joaca cu controlul efectelor chiar in timp ce acestea actioneaza. Sonic Pi suporta si acest mod, dar in loc sa fie nevoie de altcineva care sa controleze lucrurile pentru tine, computerul este cel care preia acest rol.

en: Let's explore FX!
ro: Sa exploram efectele (FX)!

en: 6.1 Adding FX
ro: 6.1 Adaugarea de efecte

en: Adding FX
ro: Adaugarea de efecte

en: In this section we'll look at a couple of FX: reverb and echo. We'll see how to use them, how to control their opts and how to chain them.
ro: In aceasta sectiune vom discuta despre doua efecte: reverb si echo. Vom vedea cum le putem folosi, cum sa le controlam parametrii si cum sa le inlantuim.

en: Sonic Pi's FX system uses blocks. So if you haven't read section 5.1 you might want to take a quick look and then head back.
ro: Sonic Pi foloseste blocuri pentru efecte. Deci, daca nu ai citit sectinea 5.1, ar fi bine sa arunci o privire asupra ei si apoi sa revii.

en: Reverb
ro: Reverb (reverberatie)

en: If we want to use reverb we write `with_fx :reverb` as the special code to our block like this:
ro: Daca vrem sa folosim efectul reverb adaugam codul special 'with_fx :reverb' la inceputul blocului:

en: Now play this code and you'll hear it played with reverb. It sounds good, doesn't it! Everything sounds pretty nice with reverb.
ro: Acum executa acest cod si vei auzi cum este redat cu efectul reverb. Suna bine, nu? Aproape orice suna bine cu reverb.

en: Now let's look what happens if we have code outside the do/end block:
ro: Acum sa vedem ce se intampla daca avem cod in afara blocului do/end:

en: Notice how the final `play 55` isn't played with reverb. This is because it is *outside* the do/end block, so it isn't captured by the reverb FX.
ro: Observi ca la sfarsit 'play 55' este redat fara reverb. Asta se intmpla deoarece este *in afara* blocului do/end, deci nu este influentat de efectul reverb.

en: Similarly, if you make sounds before the do/end block, they also won't be captured:
ro: La fel, daca ai sunete generate inainte de blocul do/end, nici ele nu sunt influentate:

en: Echo
ro: Echo (ecou)

en: There are many FX to choose from. How about some echo?
ro: Exista multe efecte pe care le poti aplica. Ce-ar fi sa incercam putin ecou?

en: One of the powerful aspects of Sonic Pi's FX blocks is that they may be passed opts similar to opts we've already seen with `play` and `sample`. For example a fun echo opt to play with is `phase:` which represents the duration of a given echo in beats. Let's make the echo slower:
ro: Una dintre caracteristicile importante ale efectelor din Sonic Pi este ca permit specificarea de parametri asemanatori cu cei pentru 'play' sau 'sample'. De exemplu, un parametru interesant pentru echo este 'phase:' care reprezinta durata ecoului in batai. Sa facem ecoul mai lent:

en: Let's also make the echo faster:
ro: Acum sa facem ecoul mai rapid:

en: Let's make the echo take longer to fade away by setting the `decay:` time to 8 beats:
ro: Sa facem acum ca ecoul sa se atenueze mai lent adaugand parametrul 'decay:' cu durata de 8 batai:

en: Nesting FX
ro: Efecte in efecte

en: One of the most powerful aspects of the FX blocks is that you can nest them. This allows you to very easily chain FX together. For example, what if you wanted to play some code with echo and then with reverb? Easy, just put one inside the other:
ro: Un aspect important legat de blocurile de efecte este poti fi continute unele in altele. Asta inseamna ca efectele pot fi inlantuite cu usurinta. De exemplu, daca vrei sa redai o parte din cod cu echo apoi cu reverb, poti face asta foarte simplu, punandu-le unul in interiorul celuilalt:

en: Think about the audio flowing from the inside out. The sound of all the code within the inner do/end block such as `play 50` is first sent to the echo FX and the sound of the echo FX is in turn sent out to the reverb FX.
ro: Imagineaza-ti fluxul audio dinspre interior spre exterior. Sunetul din toata bucata de cod din blocul do/end din interior, cum ar fi 'play 50', este trimis mai intai catre efectul echo, iar sunetul efectului echo este apoi trimis catre efectul reverb.

en: We may use very deep nestings for crazy results. However, be warned, the FX can use a lot of resources and when you nest them you're effectively running multiple FX simultaneously. So be sparing with your use of FX especially on low powered platforms such as the Raspberry Pi.
ro: Putem folosi inlantuirea pe mai multe niveluri pentru rezultate cat mai surprinzatoare. Dar, ai grija, efectele consuma multe resurse, iar atunci cand le inlantuiesti de fapt se executa mai multe efecte in acelasi timp. Deci, fii grijuliu cu folosirea efectelor mai ales pe platforme hardware mai putin puternice, cum ar fi Raspberry Pi.

en: Discovering FX
ro: Explorarea efectelor

en: Sonic Pi ships with a large number of FX for you to play with. To find out which ones are available, click on FX in the far left of this help system and you'll see a list of available options. Here's a list of some of my favourites:
ro: Sonic Pi vine cu un mare numar de efecte cu care te poti juca. Pentru a vedea care sunt cele disponibile, fa click pe Efecte in marginea din stanga a sistemului de ajutor si vei vedea lista de optiuni. Iata o lista cu preferatele mele:

en: Now go crazy and add FX everywhere for some amazing new sounds!
ro: Acum te poti dezlantui adaugand efecte peste tot, pentru sunete incredibile!

en: 6.2 FX in Practice
ro: 6.2 Efectele in viata reala

en: FX in Practice
ro: Efectele in viata reala

en: Although they look deceptively simple on the outside, FX are actually quite complex beasts internally. Their simplicity often entices people to overuse them in their pieces. This may be fine if you have a powerful machine, but if - like me - you use a Raspberry Pi to jam with, you need to be careful about how much work you ask it to do if you want to ensure the beats keep flowing.
ro: Desi par simple vazute din afara, efectele sunt niste unelte foarte complexe la interior. Simplitatea lor determina adesea utilizatorii sa exagereze cu folosirea lor in piese. Asta nu e o mare problema daca ai o masina puternica, dar daca folosesti ca mine un Raspberry Pi pentru improvizatii pe scena, trebuie sa ai grija cat de multe ii ceri daca vrei sa fii sigur ca poate tine pasul.

en: Consider this code:
ro: Sa ne uitam la codul de mai jos:

en: In this code we're playing note 60 with a very short release time, so it's a short note. We also want reverb so we've wrapped it in a reverb block. All good so far. Except...
ro: Aici redam nota 60 cu un release foarte scurt, deci este o nota scurta. Vrem sa aiba reverberatie, deci am inclus-o intr-un bloc reverb. Toate bune pana aici. Numai ca...

en: Let's look at what the code does. First we have a `loop` which means everything inside of it is repeated forever. Next we have a `with_fx` block. This means we will create a new reverb FX *every time we loop*. This is like having a separate FX reverb pedal for every time you pluck a string on a guitar. It's cool that you can do this, but it's not always what you want. For example, this code will struggle to run nicely on a Raspberry Pi. All the work of creating the reverb and then waiting until it needs to be stopped and removed is all handled by `with_fx` for you, but this takes CPU power which may be precious.
ro: Sa privim ce face codul. Mai intai avem o bucla ('loop'), ceea ce inseamna ca tot ce se afla in interiorul ei este repetat la nesfarsit. Apoi avem un bloc 'with_fx'. Asta inseamna ca vom crea un nou efect reverb *de fiecare data cand bucla se reia*. E ca si cand ai avea o pedala de efecte separata pentru fiecare ciupire a corzii unei chitare. E tare ca poti face asta, dar nu e ce-ti doresti intotdeauna. De exemplu, acest cod va fi redat cu dificultate de un Raspberry Pi. Toata munca de crearea a efectului reverb si apoi asteptarea pana cand trebuie oprit si anulat este gestionata de 'with_fx' pentru tine, dar consuma din timpul pretios al procesorului.

en: How do we make it more similar to a traditional setup where our guitarist has just *one* reverb pedal which all sounds pass through? Simple:
ro: Cum putem face sa se comporte similar cu o configuratie uzuala in care chitaristul are *o singura* pedala pentru reverb care controleaza toate sunetele? Simplu:

en: We put our loop *inside* the `with_fx` block. This way we only create a single reverb for all notes played in our loop. This code is a lot more efficient and would work fine on a Raspberry Pi.
ro: Punem bucla *in interiorul* blocului 'with_fx'. In felul asta cream un singur reverb pentru toate notele redate in bucla. Acest cod este mult mai eficient si va functiona fara probleme pe un Raspberry Pi.

en: A compromise is to use `with_fx` over an iteration within a loop:
ro: O solutie de compromis este sa folosim 'with_fx' cu un bloc de iteratii in cadrul unei bucle:

en: This way we've lifted the `with_fx` out of the inner part of the `loop` and we're now creating a new reverb every 16 notes.
ro: In felul asta am ridicat cu un nivel 'with_fx' din interiorul buclei si cream un reverb nou la fiecare 16 note.

en: This is such a common pattern that `with_fx` supports an opt to do exactly this but without having to write the `16.times` block:
ro: Este un lucru atat de des intalnit, incat 'with_fx' ofera suport pentru un parametru care face exact asta, fara a fi nevoie sa scrii blocul '16.times':

en: Both the `reps: 16` and `16.times do` examples will behave identically. The `reps: 16` essentially repeats the code in the `do/end` block 16 times so you can use them both interchangeably and choose the one that feels best for you.
ro: Ambele exemple, cel cu `reps: 16` si cel cu `16.times do`, se comporta la fel. In mare, `reps: 16`codul din blocul do/end de 16 ori, deci poti folosi oricare dintre cele doua forme in functie de preferintele personale.

en: Remember, there are no mistakes, just possibilities. However, some of these approaches will have a different sound and also different performance characteristics. So play around and use the approach that sounds best to you whilst also working within the performance constraints of your platform.
ro: Cum spuneam, nu exista greseli, ci doar posibilitati. Totusi, unele dintre abodari pot crea sunete diferite si pot avea un impact diferit asupra performantelor. Deci te poti juca incercand sa gasesti metoda care suna cel mai bine pentru tine, tinand cont in acelasi timp de constrangerile legate de performantele sistemului.

en: 7 Control
ro: 7 Controlul

en: Controlling running sounds
ro: Controlul sunetelor in timpul redarii

en: So far we've looked at how you can trigger synths and samples, and also how to change their default opts such as amplitude, pan, envelope settings and more. Each sound triggered is essentially its own sound with its own list of options set for the duration of the sound.
ro: Pana acum am vazut cum putem porni sintetizatoare sau esantioane si cum le putem modifica valorile implicite pentru parametri ca amplitudine, pozitionare, anvelopa si altele. Fiecare sunet in curs de redare este independent, avand propria lista de parametri valabili pe toata durata lui.

en: Wouldn't it also be cool if you could change a sound's opts whilst it's still playing, just like you might bend a string of a guitar whilst it's still vibrating?
ro: N-ar fi interesant daca ai putea schimna parametrii unui sunet in timp ce este redat, exact cum ai putea apasa pe o coarda de la chitara in timp ce inca vibreaza?

en: You're in luck - this section will show you how to do exactly this.
ro: Se pare ca ai noroc - exact despre asta vom vorbi in aceasta sectiune.

en: 7.1 Controlling Running Synths
ro: 7.1 Controlul sintetizatorului in timpul redarii

en: Controlling Running Synths
ro: Controlul sintetizatorului in timpul redarii

en: So far we've only concerned ourselves with triggering new sounds and FX. However, Sonic Pi gives us the ability to manipulate and control currently running sounds. We do this by using a variable to capture a reference to a synth:
ro: Pana acum ne-am concentrat doar pe pornirea sunetelor si efectelor. Totusi, Sonic Pi ne da posibilitatea sa manipulam sunetele si in timpul redarii. Vom face asta folosind o variabila care memoreaza o referinta la un sintetizator:

en: Here, we have a run-local variable `s` which represents the synth playing note 60. Note that this is *run-local* - you can't access it from other runs like functions.
ro: Aici avem o variabila locala (in cadrul unui Run) 's' care reprezinta sintetizatorul ce reda nota 60. Aceasta variabila *locala* nu poate fi accesata din alte blocuri, cum ar fi functii.

en: Once we have `s`, we can start controlling it via the `control` function:
ro: Din momentul in care il avem pe 's', putem incepe sa il controlam folosind functia 'control':

en: The thing to notice is that we're not triggering 4 different synths here - we're just triggering one synth and then change the pitch 3 times afterwards, while it's playing.
ro: Un amanunt important este ca nu pornim 4 sintetizatoare diferite, ci pornim doar unul apoi ii schimbam tonalitatea de 3 ori, in timp ce canta.

en: We can pass any of the standard opts to `control`, so you can control things like `amp:`, `cutoff:` or `pan:`.
ro: Putem transmite orice parametru standard catre 'control', deci poti controla valori ca 'amp:', 'cutoff:', sau 'pan:'.

en: Non-controllable Options
ro: Parametri care nu pot fi controlati

en: Some of the opts can't be controlled once the synth has started. This is the case for all the ADSR envelope parameters. You can find out which opts are controllable by looking at their documentation in the help system. If the documentation says *Can not be changed once set*, you know it's not possible to control the opt after the synth has started.
ro: Unii parametri nu pot fi controlati odata ce sintetizatorul a fost pornit. Asa sta treaba pentru toti parametrii anvelopei ADSR. Poti vedea ce poate fi controlat cautand in documentatia pentru fiecare parametru in sistemul de ajutor. Daca documentatia spune *Nu poate fi schimbat odata setat*, vei sti ca nu este posibil sa controlezi acest parametru dupa pornirea sintetizatorului.

en: 7.2 Controlling FX
ro: 7.2 Controlul efectelor

en: Controlling FX
ro: Controlul efectelor

en: It is also possible to control FX, although this is achieved in a slightly different way:
ro: Este posibil sa controlezi si efectele, dar acest lucru se face intr-un mod usor diferit:

en: Instead of using a variable, we use the goalpost parameters of the do/end block. Inside the `|` bars, we need to specify a unique name for our running FX which we then reference from the containing do/end block. This behaviour is identical to using parameterised functions.
ro: In loc sa folosim o variabila, folosim parametrii delimitati de bare - '|' - din cadrul blocurilor do/end. Trebuie sa specificam intre bare un nume unic pentru efectul care se executa, putand apoi folosi acest nume in cadrul blocului do/end care-l contine. Acest comportament este identic cu cel al functiilor cu parametri.

en: Now go and control some synths and FX!
ro: Acum poti sa te joci controland niste sintetizatoare si efecte in timpul redarii!

en: 7.3 Sliding Options
ro: 7.3 Optiuni de modificare progresiva sau alunecare (sliding)

en: Sliding Opts
ro: Optiuni de modificare progresiva sau alunecare (sliding)

en: Whilst exploring the synth and FX opts, you might have noticed that there are a number of opts ending with `_slide`. You might have even tried calling them and seeing no effect. This is because they're not normal parameters, they're special opts that only work when you control synths as introduced in the previous section.
ro: Cand am discutat despre sintetizatoare si efecte ai observat probabil ca exista anumiti parametri al caror nume se termina cu '_slide'. Poate chiar ai incercat sa ii folosesti si nu ai remarcat niciun efect. Asta se intampla pentru ca nu sunt parametri normali, ci optiuni speciale care sunt active doar cand controlezi sintetizatoarele asa cum am explicat in sectiunea precedenta.

en: Consider the following example:
ro: Sa analizam exemplul urmator:

en: Here, you can hear the synth pitch changing immediately on each `control` call. However, we might want the pitch to slide between changes. As we're controlling the `note:` parameter, to add slide, we need to set the `note_slide` parameter of the synth:
ro: Aici, poti auzi tonalitatea sintetizatorului schimbandu-se imediat dupa fiecare apel al functiei 'control'. Totusi, am dori ca tonalitatea sa alunece (slide) intre schimbari. Deoarece controlam parametrul 'note:', pentru a adauga alunecarea, trebuie sa modificam parametrul 'note_slide' al sintetizatorului:

en: Now we hear the notes being bent between the `control` calls. It sounds nice, doesn't it? You can speed up the slide by using a shorter time such as `note_slide: 0.2` or slow it down by using a longer slide time.
ro: Acum vom auzi notele deformate intre apelurile 'control'. Suna bine, nu? Poti grabi alunecarea folosind un timp mai scurt, cum ar fi 'note_slide: 0.2' sau sa o incetinesti folosind un timp mai mare.

en: Every parameter that can be controlled has a corresponding `_slide` parameter for you to play with.
ro: Fiecare parametru care poate fi controlat are asociat si un parametru '_slide' cu care te poti juca.

en: Sliding is sticky
ro: Alunecarea este persistenta

en: Once you've set a `_slide` parameter on a running synth, it will be remembered and used every time you slide the corresponding parameter. To stop sliding you must set the `_slide` value to 0 before the next `control` call.
ro: Odata ce ai setat un parametru '_slide' pentru un sintetizator care canta, el va fi retinut de fiecare data cand faci sa alunece resprectivul parametru. Pentru a opri alunecarea trebuie sa setezi '_slide' la 0 inainte de urmatorul apel 'control'.

en: Sliding FX Opts
ro: Modificarea progresiva a parametrilor efectelor

en: It is also possible to slide FX opts:
ro: Si parametrii efectelor pot fi modificati progresiv:

en: Now have fun sliding things around for smooth transitions and flowing control...
ro: Acum te poti juca cu alunecarea pentru tranzitii line...

en: 8 Data Structures
ro: 8 Structuri de date

en: Data Structures
ro: Structuri de date

en: A very useful tool in a programmer's toolkit is a data structure.
ro: O unealta foarte utila din trusa oricarui programator este structura de date.

en: Sometimes you may wish to represent and use more than one thing. For example, you may find it useful to have a series of notes to play one after another. Programming languages have data structures to allow you do exactly this.
ro: Uneori ai putea dori sa reprezinti si sa folosesti mai mult decat o singura valoare. De exemplu, ti-ar fi util sa ai un sir de note pe care sa le redai una dupa alta. Limbajele de programare au structuri de date care permit acest lucru.

en: There are many exciting and exotic data structures available to programmers - and people are always inventing new ones. However, for now we only really need to consider a very simple data structure - the list.
ro: Exista multe structuri de date care mai de care mai exotice si mai interesante si altele noi continua sa apara. Totusi, pentru moment ne vom opri la una foarte simpla - lista.

en: Let's look at it in more detail. We'll cover its basic form and then also how lists can be used to represent scales and chords.
ro: Sa privim mai in detaliu. Vom discuta intai despre forma sa uzuala iar apoi vom vede cum poate fi folosita pentru a reprezenta game si acorduri.

en: 8.1 Lists
ro: 8.1 Listele

en: Lists
ro: Listele

en: In this section we'll take a look at a data structure which is very useful - the list. We met it very briefly before in the section on randomisation when we randomly chose from a list of notes to play:
ro: In aceasta sectiune vom discuta despre o structura de date foarte utila - lista. Am intalnit-o in treacat in sectiunea despre aleatorism cand am ales pentru redare o nota la intamplare dintr-o lista:

en: In this section we'll explore using lists to also represent chords and scales. First let's recap how we might play a chord. Remember that if we don't use `sleep`, sounds all happen at the same time:
ro: In aceasta sectiune vom vedea cum putem folosi listele pentru a reprezenta acorduri si game. Mai intai sa ne amintim cum putem canta un acord. Retine ca in lipsa comenzii 'sleep', toate sunetele sunt redate in acelasi timp:

en: Let's look at other ways to represent this code.
ro: Sa vedem si alte moduri de a scrie aceste instructiuni.

en: Playing a List
ro: Redarea unei liste

en: One option is to place all the notes in a list: `[52, 55, 59]`. Our friendly `play` function is smart enough to know how to play a list of notes. Try it:
ro: O varianta ar fi sa punem toate notele intr-o lista: `[52, 55, 59]`. Functia 'play' este suficient de desteapta sa stie cum sa redea o lista de note. Incearca:

en: Ooh, that's already nicer to read. Playing a list of notes doesn't stop you from using any of the parameters as normal:
ro: Oho, deja este mai placut de citit. Redarea unei liste de note nu te impiedica sa folosesti parametrii cu care esti obisnuit:

en: Of course, you can also use the traditional note names instead of the MIDI numbers:
ro: Desigur, poti sa folosesti si numele notelor in loc de numere MIDI:

en: Now those of you lucky enough to have studied some music theory might recognise that chord as *E Minor* played in the 3rd octave.
ro: Cei dintre voi care au fost suficient de norocosi sa studieze teorie muzicala au recunoscut probabil acordul *E Minor* redat in octava a treia.

en: Accessing a List
ro: Accesul la o lista

en: Another very useful feature of a list is the ability to get information out of it. This may sound a bit strange, but it's no more complicated than someone asking you to turn a book to page 23. With a list, you'd say, what's the element at index 23? The only strange thing is that in programming indexes usually start at 0 not 1.
ro: O alta caracteristica utila a unei liste este posibilitatea de a extrage informatia din ea. Asta suna putin cam ciudat, dar nu este mai complicat decat ar fi daca cineva ti-ar cere sa deschizi o carte la pagina 23. In cazul listei ai intreba ce element este la indexul 23. Singurul lucru cu adevara ciudat este ca in programare indexul porneste de la 0, nu de la 1.

en: With list indexes we don't count 1, 2, 3... Instead we count 0, 1, 2...
ro: In cazul indexului unei liste nu numaram 1, 2, 3..., ci 0, 1, 2...

en: Let's look at this in a little more detail. Take a look at this list:
ro: Sa analizam acest lucru mai in detaliu. Priveste lista aceasta:

en: There's nothing especially scary about this. Now, what's the second element in that list? Yes, of course, it's `55`. That was easy. Let's see if we can get the computer to answer it for us too:
ro: Nu e nimic de speriat aici. Acum, spune care este al doilea element din lista. Desigur, este '55'. A fost usor. Sa vedem daca putem sa facem computerul sa ne raspunda:

en: OK, that looks a bit weird if you've never seen anything like it before. Trust me though, it's not too hard. There are three parts to the line above: the word `puts` , our list `52, 55, 59` and our index `[1]`. Firstly we're saying `puts` because we want Sonic Pi to print the answer out for us in the log. Next, we're giving it our list, and finally our index is asking for the second element. We need to surround our index with square brackets and because counting starts at `0`, the index for the second element is `1`. Look:
ro: OK, poate parea putin ciudat daca nu ai mai vazut asa ceva inainte. Dar ai incredere in mine, nu e chiar asa de greu. Exista trei parti in linia de mai sus: cuvantul 'puts', lista `52, 55, 59` si indexul nostru '[1]'. Mai intai spunem 'puts' care inseamna ca vrem ca Sonic Pi sa afiseze rezultatul in jurnal. Apoi, transmitem lista noastra si la final indexul care cere al doilea element. Indexul se trece incadrat de paranteze patrate, iar deoarece numaratoarea incepe de la '0'. indexul pentru cel de-al doilea element este '1'. Priveste:

en: Try running the code `puts [52, 55, 59][1]` and you'll see `55` pop up in the log. Change the index `1` to other indexes, try longer lists and think about how you might use a list in your next code jam. For example, what musical structures might be represented as a series of numbers...
ro: Incearca sa executi `puts [52, 55, 59][1]` si vei vedea ca in jurnal apare '55'. Schimba indexul din '1' in alta valoare, incearca liste mai lungi si gandeste-te cum ai putea utiliza o lista data viitoare cand improvizezi. De exemplu, ce structuri muzicale pot fi reprezentate ca serii de numere...

en: 8.2 Chords
ro: 8.2 Acorduri

en: Sonic Pi has built-in support for chord names which will return lists. Try it for yourself:
ro: Sonic Pi ofera suport pentru denumirile standard ale acordurilor. Incearca singur:

en: Now, we're really getting somewhere. That looks a lot more pretty than the raw lists (and is easier to read for other people). So what other chords does Sonic Pi support? Well, a *lot*. Try some of these:
ro: Asa mai merge. Acum arata mai bine decat o lista bruta (si e mai usor de citit pentru altii). Ce alte acorduri mai suporta Sonic Pi? Ei bine, *o multime*. Incearca-le pe acestea:

en: Arpeggios
ro: Arpegii

en: We can easily turn chords into arpeggios with the function `play_pattern`:
ro: Putem transforma usor acordurile in arpegii cu functia 'play_pattern':

en: Ok, that's not so fun - it played it really slowly. `play_pattern` will play each note in the list separated with a call to `sleep 1` between each call to `play`. We can use another function `play_pattern_timed` to specify our own timings and speed things up:
ro: Ok, n-a sunat prea bine, a cantat prea incet. 'play_pattern' reda toate notele din lista cu pauze de 1 secunda intre ele. Putem folosi o alta functie - 'play_pattern_timed' pentru a specifica propriul nostru ritm si a grabi putin lucrurile:

en: We can even pass a list of times which it will treat as a circle of times:
ro: Putem sa ii transmitem o lista de intervale de timp care va fi citita circular (dupa ultima valoare o reia de la inceput):

en: This is the equivalent to:
ro: Aceasta linie este echivalenta cu:

en: Which would you prefer to write?
ro: Cum preferi sa scrii?

en: 8.3 Scales
ro: 8.3 Game

en: Scales
ro: Game

en: Sonic Pi has support for a wide range of scales. How about playing a C3 major scale?
ro: Sonic Pi ofera suport pentru o multime de game. Hai sa cantam gama C3 major.

en: We can even ask for more octaves:
ro: Putem chiar cere mai multe octave:

en: How about all the notes in a pentatonic scale?
ro: Sau toate notele dintr-o gama pentatonica.

en: Random notes
ro: Note aleatoare

en: Chords and scales are great ways of constraining a random choice to something meaningful. Have a play with this example which picks random notes from the chord E3 minor:
ro: Acordurile si gamele ajuta la restrangerea domeniului din care se face o selectie aleatoare la valori utile. Incearca acest exemplu care alege note aleatoare din acordul E3 minor:

en: Try switching in different chord names and cutoff ranges.
ro: Incearca sa schimbi numele acordului si intervalul pentru cutoff.

en: Discovering Chords and Scales
ro: Explorarea acordurilor si gamelor

en: To find out which scales and chords are supported by Sonic Pi simply click the Lang button on the far left of this tutorial and then choose either chord or scale in the API list. In the information in the main panel, scroll down until you see a long list of chords or scales (depending on which you're looking at).
ro: Pentru a vedea ce game si acorduri sunt suportate de Sonic Pi apasa pe butonul Lang din marginea din stanga a acestui tutorial apoi alege fie chord fie scale din lista. In panoul principal deruleaza informatiile pana cand ajungi la o lunga lista de acorduri sau scale (in functie de ce ai ales).

en: Have fun and remember: there are no mistakes, only opportunities.
ro: Exploreaza si tine minte: nu exista greseli, doar oportunitati.

en: 8.4 Rings
ro: 8.4 Liste circulare

en: Rings
ro: Liste circulare

en: An interesting spin on standard lists are rings. If you know some programming, you might have come across ring buffers or ring arrays. Here, we'll just go for ring - it's short and simple.
ro: Un tip special de lista este lista circulara. Daca stii ceva programare, ai intalnit probabil buffere circulare sau siruri circulare. Aici vor fi numite doar ring (inel) - un nume scurt si simplu.

en: In the previous section on lists we saw how we could fetch elements out of them by using the indexing mechanism:
ro: In sectiunile precedente referitoare la liste am vazut cum putem citi elemente din ele folosind mecanismul de indexare:

en: Now, what happens if you want index `100`? Well, there's clearly no element at index 100 as the list has only three elements in it. So Sonic Pi will return you `nil` which means nothing.
ro: Ce se intampla daca doresti indexul '100'? Ei bine, este evident ca nu exista un element la indexul 100 deoarece lista are doar trei elemente in ea. Deci Sonic Pi va returna 'nil' adica nimic.

en: However, consider you have a counter such as the current beat which continually increases. Let's create our counter and our list:
ro: Sa ne imaginam insa ca ai un contor cum ar fi bataia curenta, care creste continnuu. Sa cream contorul si lista:

en: We can now use our counter to access a note in our list:
ro: Putem acum folosi contorul pentru a citi o nota din lista:

en: Great, we got `52`. Now, let's increment our counter and get another note:
ro: Super, am obtinut '52'. Acum, sa incrementam contorul si sa citim o alta nota:

en: Super, we now get `55` and if we do it again we get `59`. However, if we do it again, we'll run out of numbers in our list and get `nil`. What if we wanted to just loop back round and start at the beginning of the list again? This is what rings are for.
ro: Am obtinut '55' si daca mai incercam o data obtinem '59'. Totusi, daca incercam din nou vom ramane fara numere in lista si vom obtine 'nil'. Dar daca am dori sa o luam pur si simplu de la inceputul listei din nou? Pentru asta exista listele circulare.

en: Creating Rings
ro: Crearea listelor circulare

en: We can create rings one of two ways. Either we use the `ring` function with the elements of the ring as parameters:
ro: Putem crea liste circulare in doua moduri. Fie folosim functia 'ring' cu elementele din lista ca parametri:

en: Or we can take a normal list and convert it to a ring by sending it the `.ring` message:
ro: Sau putem lua o lista normala si sa o transformam intr-una circulara trimitandu-i mesajul '.ring':

en: Indexing Rings
ro: Indexarea listelor circulare

en: Once we have a ring, you can use it in exactly the same way you would use a normal list with the exception that you can use indexes that are negative or larger than the size of the ring and they'll wrap round to always point at one of the ring's elements:
ro: Putem folosi o lista circulara la fel ca pe una normala cu diferenta ca putem folosi indecsi negativi sau mai mari decat lungimea listei si vom obtine intotdeauna un element din lista:

en: Using Rings
ro: Folosirea listelor circulare

en: Let's say we're using a variable to represent the current beat number. We can use this as an index into our ring to fetch notes to play, or release times or anything useful we've stored in our ring regardless of the beat number we're currently on.
ro: Sa presupunem ca folosim o variabila care reprezinta numarul bataii curente. Putem folosi acest numar ca index in lista circulare pentru a aduce nota care urmeaza sa fie redata, sau timpul de release sau orice altceva ce am memorat in lista respectiva, indiferent de bataia la care s-a ajuns.

en: Scales and Chords are Rings
ro: Gamele si acordurile sunt liste circulare

en: A useful thing to know is that the lists returned by `scale` and `chord` are also rings and allow you to access them with arbitrary indexes.
ro: E util de stiut ca listele returnate de 'scale' si 'chord' sunt liste circulare si pot fi citite folosind orice valori pentru indecsi.

en: Ring Constructors
ro: Constructori pentru listele circulare

en: In addition to `ring` there are a number of other functions which will construct a ring for us.
ro: Pe langa 'ring' exista si alte functii care pot construi o lista circulara pentru noi.

en: `range` invites you specify a starting point, end point and step size.
ro: 'range' iti cere sa specifici un punct de inceput, unul de sfarsit si dimensiunea pasului.

en: `bools` allows you to use `1`s and `0`s to succinctly represent booleans.
ro: 'bools' iti permite sa folosesti '0' si '1' pentru a reprezenta valori booleene.

en: `knit` allows you to knit a sequence of repeated values.
ro: 'knit' iti permite sa tesi o secventa de valori care se repeta.

en: `spread` creates a ring of bools with a Euclidean distribution.
ro: 'spread' creeaza o lista circulara cu distributie euclidiana.

en: Take a look at their respective documentation for more information.
ro: Poti cauta mai multe informatii in documentatia pentru functiile respective.

en: 8.5 Ring Chains
ro: 8.5 Definirea listelor circulare folosind comenzi inlantuite

en: Ring Chains
ro: Definirea listelor circulare folosind comenzi inlantuite

en: In addition to the constructors such as `range` and `spread` another way of creating new rings is to manipulate existing rings.
ro: Pe langa utilizarea constructorilor gen 'range' sau 'spread', o alta metoda de a crea noi liste circulare se bazeaza pe folosirea unora deja existente.

en: Chain Commands
ro: Comenzi inlantuite

en: To explore this, take a simple ring:
ro: Pentru explorarea lor, luam ca exemplu o lista circulara simpla:

en: What if we wanted it backwards? Well we'd use the chain command `.reverse` to take the ring and turn it around:
ro: Daca dorim sa obtinem o lista circulara intoarsa pe dos, putem folosi comanda '.reverse' pentru a obtine elementele in ordine inversa,:

en: Now, what if we wanted the first three values from the ring?
ro: Dar daca dorim primele trei valori din lista?

en: Finally, what if we wanted to shuffle the ring?
ro: In fine, ce facem daca dorim sa amestecam valorile din lista?

en: Multiple Chains
ro: Inlantuiri multiple

en: This is already a powerful way of creating new rings. However, the *real* power comes when you chain a few of these commands together.
ro: Deja avem o metoda foarte buna pentru a crea noi liste circulare. Totusi, lucrurile devin cu *adevarat* interesante cand inlantuim mai multe comenzi de acest fel.

en: How about shuffling the ring, dropping 1 element and then taking the next 3?
ro: Cum facem sa amestecam lista, sa eliminam primul element si apoi sa le oprim pe primele 3?

en: Let's take this in stages:
ro: Vom face asta in etape:

en: `(ring 10, 20, 30, 40, 50)` - our initial ring
ro: `(ring 10, 20, 30, 40, 50)` - lista circulara initiala

en: `(ring 10, 20, 30, 40, 50).shuffle` - shuffles - `(ring 40, 30, 10, 50, 20)`
ro: `(ring 10, 20, 30, 40, 50).shuffle` - o amestecam - `(ring 40, 30, 10, 50, 20)`

en: `(ring 10, 20, 30, 40, 50).shuffle.drop(1)` - drop 1 - `(ring 30, 10, 50, 20)`
ro: `(ring 10, 20, 30, 40, 50).shuffle.drop(1)` - eliminam 1 - `(ring 30, 10, 50, 20)`

en: `(ring 10, 20, 30, 40, 50).shuffle.drop(1).take(3)` - take 3 - `(ring 30, 10, 50)`
ro: `(ring 10, 20, 30, 40, 50).shuffle.drop(1).take(3)` - oprim 3 - `(ring 30, 10, 50)`

en: Can you see how we can just create a long chain of these methods by just *sticking them together*. We can combine these in any order we want creating an extremely rich and powerful way of generating new rings from existing ones.
ro: Am creat un lant cu aceste metode doar *punandu-le una dupa alta*. Putem combina aceste metode in orice ordine dorim obtinand astfel o metoda foarte puternica de a genera noi liste circulare pe baza unora deja existente.

en: Immutability
ro: Invariabilitatea

en: These rings have a powerful and important property. They are immutable which means that they can not change. This means that the chaining methods described in this section *do not change rings* rather they *create new rings*. This means you're free to share rings across threads and start chaining them within a thread knowing you won't be affecting any other thread using the same ring.
ro: Aceste liste circulare au o proprietate importanta. Ele sunt invariante, ceea ce inseamna ca nu pot fi schimbate. Metodele inlantuite descrise in aceasta sectiune *nu schimba listele* ci *creeaza noi liste*. Astfel, poti folosi acelease liste in diferite thread-uri si poti adauga comenzi inlantuite in cadrul unui thread stiind ca nu va exista un impact asupra altui thread care foloseste aceeasi lista inlantuita.

en: Available Chain Methods
ro: Metode disponibile pentru transformari inlantuite

en: Here's a list of the available chain methods for you to play with:
ro: Iata o lista a metodelor disponibile pentru aceste transformari inlantuite:

en: `.reverse` - returns a reversed version of the ring
ro: `.reverse` - intoarce o versiune a listei cu elementele in ordine inversa

en: `.sort` - creates a sorted version of the ring
ro: `.sort` - creeaza o versiune sortata a listei

en: `.shuffle` - creates a shuffled version of the ring
ro: `.shuffle` - creeaza o versiune amestecata a listei

en: `.pick(3)` - returns a ring with the results of calling `.choose` 3 times
ro: `.pick(3)` - intoarce o lista cu rezultatul apelarii metodei `.choose` de 3 ori

en: `.take(5)` - returns a new ring containing only the first 5 elements
ro: `.take(5)` - returneaza o lista noua continand doar primele 5 elemente

en: `.drop(3)` - returns a new ring with everything but the first 3 elements
ro: `.drop(3)` - returneaza o lista noua cu toate elementele in afara de primele 3

en: `.butlast` - returns a new ring with the last element missing
ro: `.butlast` - returneaza o lista noua fara ultimul element

en: `.drop_last(3)` - returns a new ring with the last 3 elements missing
ro: `.drop_last(3)` - returneaza o lista noua fara ultimele 3 elemente

en: `.take_last(6)`- returns a new ring with only the last 6 elements
ro: `.take_last(6)`- returneaza o lista doar cu ultimele 6 elemente

en: `.stretch(2)` - repeats each element in the ring twice
ro: `.stretch(2)` - repeta fiecare element din lista de 2 ori

en: `.repeat(3)` - repeats the entire ring 3 times
ro: `.repeat(3)` - repeta toata lista de 3 ori

en: `.mirror` - adds the ring to a reversed version of itself
ro: `.mirror` - adauga la lista o versiune inversata a acesteia

en: `.reflect` - same as mirror but doesn't duplicate middle value
ro: `.reflect` - la fel ca mirror, dar valoarea din mijoc nu este duplicata

en: `.scale(2)` - returns a new ring with all elements multiplied by 2 (assumes ring contains numbers only)
ro: `.scale(2)` - returneaza o lista cu toate elementele inmultite cu 2 (presupune ca lista contine doar numere)

en: Of course, those chain methods that take numbers can take other numbers too! So feel free to call `.drop(5)` instead of `.drop(3)` if you want to drop the first 5 elements.
ro: Desigur, acele metode care accepta parametri, pot primi si alte numere decat cele din exemplu! Deci poti incerca de exemplu sa apelezi .'drop(5)' in loc de '.drop(3)' daca vrei sa elimini primele 5 elemente.

en: 9 Live Coding
ro: 9 Programarea live

en: One of the most exciting aspects of Sonic Pi is that it enables you to write and modify code live to make music, just like you might perform live with a guitar. One advantage of this approach is to give you more feedback whilst composing (get a simple loop running and keep tweaking it till it sounds just perfect). However, the main advantage is that you can take Sonic Pi on stage and gig with it.
ro: Una dintre cele mai interesante caracteristici ale Sonic Pi este ca iti prmite sa scrii si sa modifici codul live pentru a crea muzica, asa cum ai interpreta live la chitara. Un avantaj al acestei abordari este ca poti avea feedback pe masura ce compui (porneste o bucla simpla si fa reglajele pana cand suna perfect). Cel mai mare avantaj este insa ca poti sa iei Sonic Pi pe scena si sa improvizezi cu ajutorul lui.

en: In this section we'll cover the fundamentals of turning your static code compositions into dynamic performances.
ro: In aceasta sectiune vom studia bazele transformarii codului static in interpretari dinamice.

en: Hold on to your seats...
ro: Tineti-va bine...

en: 9.1 Live Coding Fundamentals
ro: 9.1 Bazele programarii live

en: Now we've learned enough to really start having some fun. In this section we'll draw from all the previous sections and show you how you can start making your music compositions live and turning them into a performance. For that we'll need 3 main ingredients:
ro: Acum stim deja suficient pentru a incepe cu adevarat sa facem ceva interesant. In aceasta sectiune vom construi pe baza a ceea ce am invatat in sectiunile precedente si iti voi arata cum poti incepe sa compui muzica live si sa o transformi in interpretare pe scena. Pentru asta avem nevoie de 3 lucruri:

en: An ability to write code that makes sounds - CHECK!
ro: Priceperea de a scrie cod care produce sunete - PREZENTA!

en: An ability to write functions - CHECK!
ro: Priceperea de a scrie functii - PREZENTA!

en: An ability to use (named) threads - CHECK!
ro: Priceperea de a folosi thread-uri (cu nume) - PREZENTA!

en: Alrighty, let's get started. Let's live code our first sounds. We first need a function containing the code we want to play. Let's start simple. We also want to loop calls to that function in a thread:
ro: In regula, sa-i dam bataie! Sa programam live primele noastre sunete. Mai intai avem nevoie de o functie care contine codul pe care vrem sa-l executam. Sa incepem cu ceva simplu. Vrem de asemenea sa reluam in bucla apelurile catre aceasta functie intr-un thread:

en: If that looks a little too complicated to you, go back and re-read the sections on functions and threads. It's not too complicated if you've already wrapped your head around these things.
ro: Daca ti se pare putin complicat, te poti intoarce sa recitesti sectiunile despre functii si thread-uri. Nu este prea complicat daca deja ai studiat aceste lucruri.

en: If you run this code, you'll hear note 50 repeating again and again...
ro: Daca rulezi acest cod, vei auzi nota 50 repetata iar si iar...

en: Changing it up
ro: Sa schimbam putin

en: Now, this is where the fun starts. Whilst the code is *still running* change 50 to another number, say 55, then press the Run button again. Woah! It changed! Live!
ro: Acum incepe partea distractiva. In timp ce codul *inca ruleaza* schimba 50 cu alt numar, sa zicem 55, apoi apasa pe butonul Run din nou. S-a schimbat! In direct!

en: Try changing it again, change the note, change the sleep time. How about adding a `use_synth` statement? For example, change it to:
ro: Incearca sa-l schimbi din nou, schimba nota, schimba timpul pentru pauza. Ce-ar fi sa adaugi o instructiune 'use_synth'? De exemplu, schimba cu:

en: Now it sounds pretty interesting, but we can spice it up further. Instead of playing the same note again and again, try playing a chord:
ro: Acum suna destul de interesant, dar putem sa-l facem si mai colorat. In loc sa redam aceeasi nota iar si iar, incerca sa redai un acord:

en: How about playing random notes from the chord:
ro: Ce-ar fi sa redam aleator notele dintr-un acord:

en: Or using a random cutoff value:
ro: Sau sa alegem o valoare aleatoare pentru cutoff:

en: Finally, add some drums:
ro: La final, sa adaugam niste tobe:

en: Now things are getting exciting!
ro: Acum lucrurile devin incitante!

en: However, before you jump up and start live coding with functions and threads, stop what you're doing and read the next section on `live_loop` which will change the way you code in Sonic Pi forever...
ro: Totusi, inainte sa incepi sa programezi live folosind functii si thread-uri, opreste-te putin si citeste sectiunea urmatoare despre 'live_loop' care va schimba pentru totdeauna modul in care programezi cu Sonic Pi...

en: 9.2 Live Loops
ro: 9.2 Bucle live

en: Live Loops
ro: Bucle live

en: Ok, so this section of the tutorial is the real gem. If you only read one section, it should be this one. If you read the previous section on Live Coding Fundamentals, `live_loop` is a simple way of doing exactly that but without having to write so much.
ro: Ok, deci aceasta sectiune a tutorialului este adevarata nestemata. Daca ai citi o singura sectiune, aceasta ar trebui sa fie. Daca ai cititi sectiunea precedenta, despre Bazele programarii live, 'live_loop' reprezinta o cale simpla de a face exact acelasi lucru, fara insa a scrie le fel de mult.

en: If you didn't read the previous section, `live_loop` is the best way to jam with Sonic Pi.
ro: Daca nu ai citit sectiunea precedenta, 'live_loop' este cel mai bun mode de a improviza folosind Sonic Pi.

en: Let's play. Write the following in a new buffer:
ro: Sa ne jucam acum. Scrie codul acesta intr-un buffer nou:

en: Now press the Run button. You hear a basic beep every beat. Nothing fun there. However, don't press Stop just yet. Change the `60` to `65` and press Run again.
ro: Acum apasa butonul Run. Vei auzi un beep obisnuit la fiecare bataie. Nimic interesant deocamdata. Totusi, nu apasa pe Stop inca. Schimba '60' cu '65' si apasa pe Run din nou.

en: Woah! It changed *automatically* without missing a beat. This is live coding.
ro: Hei, s-a schimbat *automat* fara sa piarda nicio bataie. Aceasta este programarea live.

en: Why not change it to be more bass like? Just update your code whilst it's playing:
ro: Hai sa schimbam sa fie mai spre bas. Schimba codul in timp ce se executa:

en: Then hit Run.
ro: Apoi apasa Run.

en: Let's make the cutoff move around:
ro: Sa facem valoarea pentru cutoff sa se schimbe:

en: Hit Run again.
ro: Apasa Run din nou.

en: Add some drums:
ro: Adauga niste tobe:

en: Change the note from `e1` to `c1`:
ro: Schimba nota din 'e1' in 'c1':

en: Now stop listening to me and play around yourself! Have fun!
ro: Acum nu mai tine cont de sfaturile mele si joaca-te cum vrei! Distreaza-te!

en: 9.3 Multiple Live Loops
ro: 9.3 Bucle live multiple

en: Multiple Live Loops
ro: Bucle live multiple

en: Consider the following live loop:
ro: Sa privim bucla live de mai jos:

en: You may have wondered why it needs the name `:foo`. This name is important because it signifies that this live loop is different from all other live loops.
ro: Te-ai putea intreba de ce trebuie sa se numeasca ':foo'. Acest nume este important deoarece ne spune ca aceasta bucla live este diferita de toate celelalte.

en: *There can never be two live loops running with the same name*.
ro: *Nu pot exista doua bucle live cu acelasi nume care ruleaza in acelasi timp*.

en: This means that if we want multiple concurrently running live loops, we just need to give them different names:
ro: Asta inseamna ca daca vrem sa avem mai multe bucle live care ruleaza in acelasi timp, trebuie sa le dam nume diferite:

en: You can now update and change each live loop independently and it all just works.
ro: Acum poti modifica fiecare bucla live in mod independent si totul va continua sa functioneze.

en: Syncing Live Loops
ro: Sincronizarea buclelor live

en: One thing you might have already noticed is that live loops work automatically with the thread cue mechanism we explored previously. Every time the live loop loops, it generates a new `cue` event with the name of the live loop. We can therefore `sync` on these cues to ensure our loops are in sync without having to stop anything.
ro: Un lucru pe care poate l-ai remarcat este ca buclele live folosesc automat mecanismul de marcaje pentru thread-uri pe care l-am vazut anterior. De fiecare data cand bucla live se reia, genereaza un nou eveniment 'cue' cu numele buclei. Putem deci sa ne sincronizam ('sync') cu aceste marcaje pentru a ne asigura ca buclele noastre sunt in faza fara sa oprim ceva.

en: Consider this badly synced code:
ro: Sa analizam acest cod sincronizat gresit:

en: Let's see if we can fix the timing and sync without stopping it. First, let's fix the `:foo` loop to make the sleep a factor of 1 - something like `0.5` will do:
ro: Sa vedem cum putem repara timing-ul si sa facem sincronizarea fara sa il oprim. Mai intai sa corectam bucla ':foo' astfel incat pentru pauza sa avem o valoare care intra de un numar intreg de ori in 1 - ceva gen '0.5' ar merge:

en: We're not quite finished yet though - you'll notice that the beats don't quite line up correctly. This is because the loops are *out of phase*. Let's fix that by syncing one to the other:
ro: Nu am terminat, totusi. Vei observa ca bataile nu se aliniaza corect. Asta se intampla deoarece buclele *sunt defazate*. Sa corectam aceasta problema sincronizandu-le una cu alta:

en: Wow, everything is now perfectly in time - all without stopping.
ro: Totul este acum perfect sincronizat - fara sa fim nevoiti sa ne oprim.

en: Now, go forth and live code with live loops!
ro: Acum, mergi mai departe si programeaza live cu bucle live!

en: 9.4 Ticking
ro: Tactul

en: Ticking
ro: Tactul

en: Something you'll likely find yourself doing a lot when live coding is looping through rings. You'll be putting notes into rings for melodies, sleeps for rhythms, chord progressions, timbral variations, etc. etc.
ro: Un lucru pe care il vei face adesea cand vei programa live va fi sa parcurgi in bucla liste circulare. Vei pune in aceste liste note pentru melodii, pauze pentru ritm, progresii ale acordurilor, variatii de timbru, etc.

en: Ticking Rings
ro: Tactul pentru liste circulare

en: Sonic Pi provides a *very* handy tool for working with rings within `live_loop`s. It's called the tick system. In the section about the rings we were talking about the counter that is constantly increasing, like a current beat number. Tick just implements this idea. It provides you with the ability to *tick through rings*. Let's look at an example:
ro: Sonic Pi ofera o unealta *foarte* la indemana pentru folosirea listelor circulare in bucle live. Este sistemul de tact. In sectiunea despre listele circulare am discutat despre contorul care creste constant, la fel ca numarul bataii curente. Tactul implementeaza aceasta idee. El iti ofera posibilitatea de a *parcurge listele circulare in ritm*. Sa privim un exemplu:

en: This is equivalent to:
ro: Acesta este echivalent cu:

en: Here, we're just grabbing the scale E3 minor pentatonic and ticking through each element. This is done by adding `.tick` to the end of the scale declaration. This tick is local to the live loop, so each live loop can have its own independent tick:
ro: Aici am ales gama pentatonica E3 minor si redam fiecare element. Acest lucru este realizat adaugand '.tick' la sfarsitul declaratiei gamei. Acest tact este local pentru bucla live, deci fiecare bucla poate avea tactul sau independent:

en: Tick
ro: Tactul (tick)

en: You can also call `tick` as a standard fn and use the value as an index:
ro: Poti apela 'tick' la fel ca o functie standard si sa folosesti valoare ca index:

en: However, it is much nicer to call `.tick` at the end. The `tick` fn is for when you want to do fancy things with the tick value and for when you want to use ticks for other things than indexing into rings.
ro: Totusi, e mai dragut sa apelezi '.tick' la sfarsit. Functia 'tick' poate fi folosita cand vrei sa faci chestii exotice cu valoarea pentru tick si pentru cand vrei sa folosesti aceasta valoare pentru altceva decat pentru indexul dintr-o lista circulara.

en: Look
ro: Look (priveste)

en: The magical thing about tick is that not only does it return a new index (or the value of the ring at that index) it also makes sure that next time you call tick, it's the next value. Take a look at the examples in the docs for `tick` for many ways of working with this. However, for now, it's important to point out that sometimes you'll want to just look at the current tick value and *not increase* it. This is available via the `look` fn. You can call `look` as a standard fn or by adding `.look` to the end of a ring.
ro: Partea magica legata de tick este ca nu reda doar un index nou (sau valoarea din lista de la indexul respectiv) ci are grija ca data viitoare cand apelezi functia sa intoarca valoarea urmatoare. Citeste exemplele din documentatia pentru 'tick' pentru mai multe moduri de a-l folosi. Totusi, pentru moment este important sa remarcam ca uneori ai putea dori sa vezi care este valoarea curenta *fara sa o incrementezi*. Acest lucru se poate face folosind functia 'look'. Poti apela 'look' ca pe o functie standard sau adaugand '.look' la sfarsitul listei circulare.

en: Naming Ticks
ro: Nume pentru tact

en: Finally, sometimes you'll need more than one tick per live loop. This is achieved by giving your tick a name:
ro: Uneori vei avea nevoie de mai mult de un tact intr-o bucla live. Acest lucru se poate realiza dandu-i un nume tactului:

en: Here we're using two ticks one for the note to play and another for the sleep time. As they're both in the same live loop, to keep them separate we need to give them unique names. This is exactly the same kind of thing as naming `live_loop`s - we just pass a symbol prefixed with a `:`. In the example above we called one tick `:foo` and the other `:bar`. If we want to `look` at these we also need to pass the name of the tick to `look`.
ro: Aici folosim doua tacturi, unul pentru nota care va fi redata si un altul pentru durata pauzei. Cum ambele sunt in aceeasi bucla live, pentru a le delimita trebuie sa le dam nume unice. Este la fel cu numele pentru buclele live - scriem un nume cu ':' la inceput. In exemplul de mai sus am denumit un tact ':foo' iar pe celalalt ':bar'. Daca vrem sa vedem valorile acestora trebuie sa transmitem numele tactului catre functia 'look'.

en: Don't make it too complicated
ro: Nu complica lucrurile

en: Most of the power in the tick system isn't useful when you get started. Don't try and learn everything in this section. Just focus on ticking through a single ring. That'll give you most of the joy and simplicity of ticking through rings in your `live_loop`s.
ro: Multe dintre avantajele sistemului de tacturi nu sunt evidente de la inceput. Nu incerca sa inveti totul din aceasta sectiune. Concentreaza-te pe tactul pentru o singura lista circulara. Asta iti va permite sa beneficiezi de cea mai mare parte din placerea de a folosi un tact pentru parcurgerea listelor circulare in buclele live.

en: Take a look at the documentation for `tick` where there are many useful examples and happy ticking!
ro: Studiaza documentatia pentru 'tick' unde vei gasi multe exemple folositoare. Spor la ticait!

en: Conclusions
ro: Concluzii

en: This concludes the Sonic Pi introductory tutorial. Hopefully you've learned something along the way. Don't worry if you feel you didn't understand everything - just play and have fun and you'll pick things up in your own time. Feel free to dive back in when you have a question that might be covered in one of the sections.
ro: Aici se incheie tutorialul introductiv pentru Sonic Pi. Sper ca ai invatat ceva pe parcursul lui. Nu fi ingrijorat daca este ceva ce nu ai inteles - foloseste programul, distreaza-te si sigur vei ajunge sa il stapanesti in timp. Te poti intoarce oricand ai o nelamurire legata de ceva ce este descris intr-una dintre aceste sectiuni.

en: Finally, I also invite you to take a deeper look at the rest of the documentation in this help system. There are a number of features that haven't been covered in this tutorial that are waiting for your discovery.
ro: Te invit de asemenea sa zabovesti asupra restului documentatiei din sistemul de ajutor. Exista mai multe functionalitati care nu au fost descrise in acest tutorial si care asteapta sa le descoperi.

en: So play, have fun, share your code, perform for your friends, show your screens and remember:
ro: Deci joaca-te, distreaza-te, impartaseste si altora creatiile tale, canta impreuna cu prietenii tai, arata imaginea de pe ecran si, mai ales, tine minte:

en: *There are no mistakes, only opportunities.*
ro: *Nu exista erori, doar oportunitati*

en: A Appendix A - MagPi Articles
ro: A Anexa A - articole din MagPi

en: MagPi Articles
ro: Articole din MagPi

en: Appendix A collects all the Sonic Pi articles written for the MagPi magazine.
ro: Anexa A regrupeaza toate articolele despre Sonic Pi scrise pentru revista MagPi.

en: Dive into Topics
ro: Concentreaza-te pe subiect

en: These articles aren't meant to be read in any strict order and contain a lot of cross-over material from the tutorial itself. Rather than try and teach you all of Sonic Pi, they instead each focus on a specific aspect of Sonic Pi and cover it in a fun and accessible way.
ro: Aceste articole nu sunt gandite sa fie citite intr-o ordine stricta si contin informatii care se refera la subiecte inrudite extrase chiar din acest tutorial. Ele nu-si propun sa te invete totul despre Sonic Pi, ci se concentreaza fiecare pe un domeniu specific pe care incearca sa-l prezinte intr-un mod amuzant si accesibil.

en: Read the MagPi
ro: Citeste MagPi

en: You can see them in their glorious professionally typeset form in the free PDF downloads of The MagPi here: https://www.raspberrypi.org/magpi/
ro: Le poti vedea intr-o forma spectaculoasa pregatite pentru tipar in PDF-uri care pot fi descarcate gratuit de aici: https://www.raspberrypi.org/magpi/

en: Suggest a Topic
ro: Sugereaza un subiect

en: If you don't see a topic that interests you covered in these articles - why not suggest one? The easiest way to do that is to tweet your suggestion to [@Sonic_Pi](http://twitter.com/sonic_pi). You never know - your suggestion might be the subject of the next article!
ro: Daca nu vezi nimic interesant in aceste articole, poti sugera tu un subiect. Cel mai simplu este sa trasnmiti sugestia ta prin twitter la  [@Sonic_Pi](http://twitter.com/sonic_pi). Nu se stie niciodata, poate sugestia ta va fi la baza urmatorului articol!

en: A.1 Tips for Sonic Pi
ro: A.1 Trucuri pentru Sonic Pi

en: Five Top Tips
ro: Cele mai bune 5 trucuri

en: 1. There are no mistakes
ro: 1. Nu exista greseli

en: The most important lesson to learn with Sonic Pi is that there really are no mistakes. The best way to learn is to just try and try and try. Try lots of different things out, stop worrying whether your code sounds good or not and start experimenting with as many different synths, notes, FX and opts as possible. You'll discover a lot of things that make you laugh because they sound just awful and some real gems that sound truly amazing. Simply drop the things you don't like and keep the things you do. The more 'mistakes' you allow yourself to make the quicker you'll learn and discover your personal coding sound.
ro: Cea mai importanta lectie pe care trebuie sa o inveti despre Sonic Pi este ca nu exista greseli. Cea mai buna metoda de a invata este sa incerci iar si iar. Incerca diferite variante, nu te concentra pe cum arata codul si experimenteaza cu cat mai multe sintetizatoare, note, efecte si parametri pentru acestea. Vei descoperi o gramada de combinatii care te vor face sa razi pentru ca suna caraghios dar si adevarate nestemate care suna incredibil. Arunca la cos ce nu-ti place si pastreaza ce e reusit. Cu cat indraznesti sa faci mai multe 'greseli' cu atat mai repede vei invata si-ti vei descoperi stilul personal.

en: 2. Use the FX
ro: 2 Foloseste efectele

en: Say you've already mastered the Sonic Pi basics of making sounds with `sample`, `play`? What's next? Did you know that Sonic Pi supports over 27 studio FX to change the sound of your code? FX are like fancy image filters in drawing programs except that instead of blurring or making something black and white, you can add things like reverb, distortion and echo to your sound. Think of it like sticking the cable from your guitar to an effects pedal of your choice and then into the amplifier. Luckily, Sonic Pi makes using FX really easy and requires no cables! All you need to do is to choose which section of your code you'd like the FX added to and wrap it with the FX code. Let's look at an example. Say you had the following code:
ro: Stapanesti deja bazele Sonic Pi pentru a crea sunete cu 'sample' si 'play'? Ce urmeaza? Stiai ca Sonic Pi ofera suport pentru mai mult de 27 de efecte de studio pentru a schimba felul in care suna programul tau? Efectele sunt ca niste filtre de imagine fanteziste, doar ca in loc sa incetosezi imaginea sau sa o faci alb/negru poti adauga sunetului reverberatii, distorsiuni sau ecou. E ca si cum ai conecta iesirea de la chitara la pedala de efecte preferata si apoi la amplificator. Din fericire, Sonic Pi face aplicarea efectelor si mai simpla, fara cabluri! Tot ce trebuie sa faci este sa decizi la ce bucata de cod vrei sa aplici efectul si sa o incadrezi cu codul speficic pentru acesta. Sa vedem un exemplu. Sa spunem ca ai urmatorul cod:

en: If you wanted to add FX to the `:loop_garzul` sample, you'd just tuck it inside a `with_fx` block like this:
ro: Daca vrei sa adaugi un efect la esantionul  `:loop_garzul`, trebuie doar sa-l introduci in interiorul unui bloc 'with_fx' ca mai jos:

en: Now, if you wanted to add FX to the bass drum, go and wrap that with `with_fx` too:
ro: Acum, daca vrei sa adaugi un efect la toba bas, introdu-o si pe aceasta intr-un 'with_fx':

en: Remember, you can wrap *any* code within `with_fx` and any sounds created will pass through that FX.
ro: Retine, poti impacheta *orice* cod intr-un bloc 'with_fx' si toate sunetele create vor fi transformate de acel efect.

en: 3. Parameterise your synths
ro: 3. Modifica parametrii sintetizatoarelor

en: In order to really discover your coding sound you'll soon want to know how to modify and control synths and FX. For example, you might want to change the duration of a note, add more reverb, or change the time between echoes. Luckily, Sonic Pi gives you an amazing level of control to do exactly this with special things called optional parameters or opts for short. Let's take a quick look. Copy this code into a workspace and hit run:
ro: Pentru a-ti descoperi stilul personal vei dori desigur sa afli cum sa modifici si sa controlezi sintetizatoarele si efectele. De exemplu, ai putea dori sa modifici durata unei note, sa adaugi mai mult reverb sau sa schimbi duratele dintre ecouri. Din fericire, Sonic Pi iti ofera un nivel de control incredibil pentru a realiza exact aceste lucruri folosind parametrii optionali (opts). Sa aruncam o privire rapida. Copiaza acest cod intr-un buffer si apasa Run:

en: Ooh, a lovely guitar sound! Now, let's start playing with it. How about changing its rate?
ro: O, un minunat sunet de chitara. Acum, sa ne jucam cu el. Ce-ar fi sa-i schimbam viteza de redare?

en: Hey, what's that `rate: 0.5` bit I just added at the end? That's called an opt. All of Sonic Pi's synths and FX support them and there's loads to play around with. They're also available for FX too. Try this:
ro: Hei, ce e chestia aia de la sfarsit - 'rate: 0.5'? Acesta este un parametru optional. Toate sintetizatoarele si efectele suporta astfel de parametri si exista o multime din care poti alege. Iata cum ii poti folosi pentru un efect:

en: Now, try increasing that feedback to 1 to hear some crazy sounds! Read the docs for full details on all the many opts available to you.
ro: Acum incearca sa modifici in 1 valoarea pentru feedback, ca sa auzi niste sunete traznite! Citeste documentatia pentru mai multe detalii despre multimea de parametri disponibili.

en: The best way to quickly experiment and explore Sonic Pi is to live code. This allows you to start off some code and continually change and tweak it whilst it's still playing. For example, if you don't know what the cutoff parameter does to a sample, just play around. Let's have a try! Copy this code into one of your Sonic Pi workspaces:
ro: Cea mai buna metoda de a exersa este sa programezi live. Asta iti permite sa incepi de la o bucata oarecare de cod si sa o modifici si sa o reglezi in timp ce ruleaza. De exemple, daca nu stii ce face parametrul cutoff pentru un esantion, joaca-te cu el. Sa incercam! Copiaza acest cod intrun buffer din Sonic Pi:

en: Now, hit run and you'll hear a slightly muffled drum break. Now, change the `cutoff:` value to `80` and hit run again. Can you hear the difference? Try `90`, `100`, `110`...
ro: Acum apasa pe Run si vei auzi o bataie de toba infundata. Acum, schimba valoarea pentru 'cutoff:' la '80' si apasa din nou pe Run. Auzi diferenta? Incearca `90`, `100`, `110`...

en: Once you get the hang of using `live_loop`s you'll not turn back. Whenever I do a live coding gig I rely on `live_loop` as much as a drummer relies on their sticks. For more information about live coding check out Section 9 of the built-in tutorial.
ro: Odata ce ai prins miscarea cu 'live_loop' nu vei mai renunta la el. De cate ori improvizez live ma bazez pe 'live_loop' la fel cum un tobosar se bazeaza pe betele lui. Pentru mai multe informatii despre programarea live vezi sectiunea 9 din tutorial.

en: 5. Surf the random streams
ro: 5. Lasa-te purtat de curenti la intamplare

en: Finally, one thing I love doing is cheating by getting Sonic Pi to compose things for me. A really great way to do this is using randomisation. It might sound complicated but it really isn't. Let's take a look. Copy this into a spare workspace:
ro: Un alt lucru pe care imi place sa-l fac este sa trisez putin lasand Sonic Pi sa compuna pentru mine. Un mod foarte interesant de a face asta este sa folosesti randomizarea. Poate suna complicat, dar chiar nu este. Sa aruncam o privire. Copiaza asta intr-un buffer:

en: Now, when you play this, you'll hear a constant stream of random notes from the scale `:e2 :minor_pentatonic` played with the `:dsaw` synth. "Wait, wait! That's not a melody", I hear you shout! Well, here's the first part of the magic trick. Every time we go round the `live_loop` we can tell Sonic Pi to reset the random stream to a known point. This is a bit like going back in time in the TARDIS with the Doctor to a particular point in time and space. Let's try it - add the line `use_random_seed 1` to the `live_loop`:
ro: Acum, cand vei reda asta, vei auzi un sir constant de note din gama `:e2 :minor_pentatonic`redate de sintetizatorul `:dsaw`. "Stai, stai! Asta nu este o melodie", parca te aud strigand! Ei bine, asta este prima parte a unui truc magic. De fiecare data cand reluam bucla 'live_loop' putem cere Sonic Pi sa readuca sirul aleator la un punct prestabilit. E ca si cum te-ai intoarce in timp folosind TARDIS - masina timpului din Doctor Who - la un anumit punct in timp si spatiu. Sa incercam: adauga linia `use_random_seed 1` la `live_loop`:

en: Now, every time the `live_loop` loops around, the random stream is reset. This means it chooses the same 16 notes every time. Hey presto! An instant melody. Now, here's the really exciting bit. Change the seed value from `1` to another number. Say `4923`. Wow! Another melody! So, just by changing one number (the random seed), you can explore as many melodic combinations as you can imagine! Now, that's the magic of code.
ro: Acum, de fiecare data cand se reia bucla 'live_loop', sirul aleator este resetat. Asta inseamna ca va alege aceleasi 16 note de fiecare data. A fost rapid! Am obtinut instantaneu o melodie. Acum urmeaza partea si mai incitanta. Schimba valoarea pentru seed din '1' in alt numar. Sa zicem '4923'. Uau! Alta melodie! Deci schimband un singur numar (cel care initializeaza secventa aleatoare) poti explora atatea combinatii melodice cate iti poti imagina! Aceasta este magia programarii.

en: A.2 Live Coding
ro: A.2 Programarea live

en: The laser beams sliced through the wafts of smoke as the subwoofer pumped bass deep into the bodies of the crowd. The atmosphere was ripe with a heady mix of synths and dancing. However something wasn't quite right in this nightclub. Projected in bright colours above the DJ booth was futuristic text, moving, dancing, flashing. This wasn't fancy visuals, it was merely a projection of Sonic Pi running on a Raspberry Pi. The occupant of the DJ booth wasn't spinning disks, he was writing, editing and evaluating code. Live. This is Live Coding.
ro: Fasciculele laser taiau norii grosi de fum in timp ce subwooferul pompa injecta un bas puternic in multime. Atmosfera era incalzita de un mix de sintetizatoare si de dansatori. Totusi ceva nu era chiar in regula in club. Proiectat in culori stralucitoare deasupra cabinei DJ-ului era un text care se schimba, clipea si dansa. Nu erau niste efecte vizuale traznite, ci proiectia ecranului Sonic Pi ruland pe un Raspberry Pi. Ocupantul cabinei DJ-ului nu invartea discuri ci scria, modifica si evalua codul. In direct. Asta e Programarea Live.

en: This may sound like a far fetched story from a futuristic night club but coding music like this is a growing trend and is often described as Live Coding (http://toplap.org). One of the recent directions this approach to music making has taken is the Algorave (http://algorave.com) - events where artists like myself code music for people to dance to. However, you don't need to be in a nightclub to Live Code - with Sonic Pi v2.6+ you can do it anywhere you can take your Raspberry Pi and a pair of headphones or some speakers. Once you reach the end of this article, you'll be programming your own beats and modifying them live. Where you go afterwards will only be constrained by your imagination.
ro: Poate parea o poveste trasa de par dintr-un club din viitor, dar crearea muzicii prin cod ca mai sus este pe un trend crescator si este adesea descrisa ca Programare Live (http://toplap.org). Una dintre directiile spre care se indreapta in prezent acest mode de a face muzica este Algorave (http://algorave.com) - spectacole in care artisti ca mine programeaza muzica pe care lumea danseaza. Totusi, nu trebuie sa fii neaparat intr-un club ca sa programezi live - cu Sonic Pi poti sa faci asta oriunde poti sa iei cu tine un Raspberry Pi si o pereche de casti sau niste difuzoare. Cand vei fi ajuns la sfarsitul acestui articol, vei fi in stare sa programezi propriile ritmuri si sa le modifici pe viu. Ce vei face dupa aceea depinde doar de imaginatia ta.

en: Live Loop
ro: Bucla live

en: The key to live coding with Sonic Pi is mastering the `live_loop`. Let's look at one:
ro: Cheia programarii live este sa stapanesti 'live_loop'. Sa aruncam o privire:

en: There are 4 core ingredients to a `live_loop`. The first is its name. Our `live_loop` above is called `:beats`. You're free to call your `live_loop` anything you want. Go crazy. Be creative. I often use names that communicate something about the music they're making to the audience. The second ingredient is the `do` word which marks where the `live_loop` starts. The third is the `end` word which marks where the `live_loop` finishes, and finally there is the body of the `live_loop` which describes what the loop is going to repeat - that's the bit between the `do` and `end`. In this case we're repeatedly playing a bass drum sample and waiting for half a beat. This produces a nice regular bass beat. Go ahead, copy it into an empty Sonic Pi buffer and hit run. Boom, Boom, Boom!.
ro: Exista 4 elemente de baza intr-un 'live_loop'. Primul este numele. Bucla noastra de mai sus se numeste ':beats'. Poti sa denumesti bucla cum vrei. Lasa-te purtat de imaginatie, fii creativ. Eu folosesc adesea nume care transmit ceva audientei despre muzica pe care o produc. Al doilea element este cuvantul cheie 'do' care marcheaza inceputul buclei. Al treilea este cuvantul cheie 'end' care marcheaza sfarsitul buclei si, in fine, exista continutul care arata ceea ce se va repeta in bucla respectiva - partea dintre 'do' so 'end'. In acest caz am redat in mod repetat un esantion de toba bas si am asteptat jumatate de bataie. Asta produce  un bas regulat. Copiaza textul intr-un buffer Sonic Pi si apasa Run. Boom, Boom, Boom!

en: Redefining On-the-fly
ro: Redefinirea din mers

en: Ok, so what's so special about the `live_loop`? So far it just seems like a glorified `loop`! Well, the beauty of `live_loop`s is that you can redefine them on-the-fly. This means that whilst they're still running, you can change what they do. This is the secret to live coding with Sonic Pi. Let's have a play:
ro: Ok, deci ce e asa special la o bucla 'live_loop'? Pana acum pare sa fie doar o bucla obisnuita cu un nume mai pompos. Ei bine, frumusetea buclelor de tip 'live_loop' este ca pot fi redefinite din mers. Asta inseamna ca poti schimba ce fac in timp ce ele se executa. Acesta este secretul programarii live cu Sonic Pi. Sa ne jucam putin:

en: Sleeping is important
ro: Pauzele sunt importante

en: One of the most important lessons about `live_loop`s is that they need rest. Consider the following `live_loop`:
ro: Una dintre cele mai importante lectii despre 'live_loop' este ca are nevoie de pauze. Sa luam urmatorul 'live_loop':

en: If you try running this code, you'll immediately see Sonic Pi complaining that the `live_loop` did not sleep. This is a safety system kicking in! Take a moment to think about what this code is asking the computer to do. That's right, it's asking the computer to play an infinite amount of choir samples in zero time. Without the safety system the poor computer will try and do this and crash and burn in the process. So remember, your `live_loop`s must contain a `sleep`.
ro: Daca incerci sa rulezi acest cod, vei observa imediat ca Sonic Pi se plange ca 'live_loop' nu a facut nicio pazua (sleep). Acesta este sistemul de siguranta care s-a activat! Sa ne gandim putin ce cere codul respectiv computerului. Asa e, ii cere computerului sa redea la nesfarsit esantioane corale de lungime zero. Fara sistemul de siguranta bietul computer ar incerca sa redea o infinitate de esantioane si ar lua-o razna. Deci, tine minte, orice 'live_loop' trebuie sa contina un 'sleep'.

en: Combining Sounds
ro: Combinarea sunetelor

en: Music is full of things happening at the same time. Drums at the same time as bass at the same time as vocals at the same time as guitars... In computing we call this concurrency and Sonic Pi provides us with an amazingly simple way of playing things at the same time. Simply use more than one `live_loop`!
ro: Muzica inseamna multe lucruri care se intampla in acelasi timp. Tobele in acelasi timp cu basul, in acelasi timp cu vocea, in acelasi timp cu chitarele... In lumea computerelor acestea se numesc procese concurente iar Sonic Pi ne ofera o cale uimitor de simpla pentru a face mai multe lucruri in acelasi timp. Pur si simplu folosim mai multe 'live_loop' in acelasi timp!

en: Here, we have two `live_loop`s, one looping quickly making beats and another looping slowly making a crazy bass sound.
ro: Aici avem doua bucle 'live_loop', una rapida care genereaza batai de taler si alta mai lenta cu un sunet dement de bas.

en: One of the interesting things about using multiple `live_loop`s is that they each manage their own time. This means it's really easy to create interesting polyrhythmical structures and even play with phasing Steve Reich style. Check this out:
ro: Interesant cu buclele 'live_loop' multiple este ca fiecare isi gestioneaza separat timpul. Asta insemana ca este foarte usoe sa creezi structuri poliritmice interesante si chiar sa te joci cu fazele in stilul Steve Reich. Asculta asta:

en: Bringing it all together
ro: Sa punem totul cap la cap

en: In each of these tutorials, we'll end with a final example in the form of a new piece of music which draws from all of the ideas introduced. Read this code and see if you can imagine what it's doing. Then, copy it into a fresh Sonic Pi buffer and hit Run and actually hear what it sounds like. Finally, change one of the numbers or comment and uncomment things out. See if you can use this as a starting point for a new performance, and most of all have fun! See you next time...
ro: In fiecare dintre aceste tutoriale incheiem cu un exemplu final sub forma unei noi piese muzicale care se bazeaza pe ideile prezentate. Citeste codul acesta si incearca sa-ti imaginezi ce face. Apoi, copiaza-l intr-un buffer nou in Sonic Pi si apasa Run ca sa vezi cum suna de fapt. Schimba apoi unul dintre numere sau transforma o parte din cod in comentariu. Vezi daca poti folosi rezultatul ca un punct de plecare pentru o noua piesa si, in primul rand, simte muzica! Ne vedem data viitoare...

en: A.3 Coded Beats
ro: A.3 Beat-uri programate

en: Coded Beats
ro: Beat-uri programate

en: One of the most exciting and disrupting technical developments in modern music was the invention of samplers. These were boxes that allowed you to record any sound into them and then manipulate and play back those sounds in many interesting ways. For example, you could take an old record, find a drum solo (or break), record it into your sampler and then play it back on repeat at half-speed to provide the foundation for your latest beats. This is how early hip-hop music was born and today it's almost impossible to find electronic music that doesn't incorporate samples of some kind. Using samples is a really great way of easily introducing new and interesting elements into your live coded performances.
ro: Una dintre cele mai incitante si mai revolutionare inventii in muzica moderna a fost sampler-ul. Acesta este o cutie care iti permite sa inregistrezi orice sunet pe car apoi il poti manipula si reda in diferite moduri interesante. De exemplu, poti sa iei o inregistrare veche, sa gasesti un solo de toba (break), sa o memorezi in sampler si apoi sa o redai in bucla la viteza injumatatita ca sa ai baza pentru cel mai nou beat al tau. Asa s-a nascut muzica hip-hop iar astazi este aproape imposibil sa gasesti muzica electronica in care nu exista macar un tip de esantion (sample). Folosirea esantioanelor este o metoda foarte buna de a introduce elemente noi si interesante in interpretarea bazata pe programare live.

en: So where can you get a sampler? Well you already have one - it's your Raspberry Pi! The built-in live coding app Sonic Pi has an extremely powerful sampler built into its core. Let's play with it!
ro: De unde putem lua un sampler? Ai deja unul - este Raspberry Pi! Aplicatia Sonic Pi pentru programare live care vine preinstalata are inclus in nucleu un sampler foarte puternic. Sa ne jucam cu el!

en: The Amen Break
ro: Amen Break

en: One of the most classic and recognisable drum break samples is called the Amen Break. It was first performed in 1969 in the song "Amen Brother" by the Winstons as part of a drum break. However, it was when it was discovered by early hip-hop musicians in the 80s and used in samplers that it started being heavily used in a wide variety of other styles such as drum and bass, breakbeat, hardcore techno and breakcore.
ro: Unul dintre solourile de toba cele mai usor de recunoscut se numeste Amen Break. A fost interpretat prima data in 1969 in piesa "Amen Brother" de Winstons ca parte a soloului de toba. Dar abia cand a fost descoperit de muzicienii de la inceputurile hip-hop-ului in anii 80 si a fost fost folosit in samplere a inceput sa fie folosit din greu in multe alte stiluri, cum ar fi drum & bass, breakbeat, hardcore techno sau breakcore.

en: I'm sure you're excited to hear that it's also built right into Sonic Pi. Clear up a buffer and throw in the following code:
ro: Sunt sigur ca te bucuri sa afli ca este inclus si in Sonic Pi. Goleste un buffer si pune acolo urmatorul cod:

en: Hit *Run* and boom! You're listening to one of the most influential drum breaks in the history of dance music. However, this sample wasn't famous for being played as a one-shot, it was built for being looped.
ro: Apasa *Run* si boom! Asculti unul dintre solourile de toba cu cea mai mare influenta din istoria muzicii dance. Totusi, acest esantion nu a devenit faimos pentru redarea normala, el a fost construit pentru redarea in bucla.

en: Beat Stretching
ro: Intinderea unui beat

en: Let's loop the Amen Break by using our old friend the `live_loop` introduced in this tutorial last month:
ro: Sa redam in bucla Amen Break folosind vechea noastra cunostinta 'live_loop' prezentata in acest tutorial:

en: OK, so it is looping, but there's an annoying pause every time round. That is because we asked it to sleep for `2` beats and with the default BPM of 60 the `:loop_amen` sample only lasts for `1.753` beats. We therefore have a silence of `2 - 1.753 = 0.247` beats. Even though it's short, it's still noticeable.
ro: Ok, acum se repeta, dar exista o pauza deranjanta de fiecare data. Asta se intampla deoarece am cerut o pauza de '2' batai iar la ritmul implicit de 60 BPM esantionul ':loop_amen' dureaza '1.753' batai. Avem deci liniste timp de '2 - 1.753 = 0.247' batai. Desi dureaza putin, este sesizabila.

en: To fix this issue we can use the `beat_stretch:` opt to ask Sonic Pi to stretch (or shrink) the sample to match the specified number of beats.
ro: Pentru a rezolva aceasta problema putem folosi parametrul 'beat_strecth: pentru a cere Sonic Pi sa intinda (sau sa comprime) esantionul astfel incat sa aiba numarul specificat de batai.

en: Sonic Pi's `sample` and `synth` fns give you a lot of control via optional parameters such as `amp:`, `cutoff:` and `release:`. However, the term optional parameter is a real mouthful so we just call them *opts* to keep things nice and simple.
ro: Functiile 'sample' si 'synth' din Sonic Pi iti ofera un control puternic prin intermediul parametrilor optionali ca `amp:`, `cutoff:` si `release:`. Totusi, numele de parametru optional este destul de lung si il putem prescurta folosind *opt* pentru simplitate.

en: Now we're dancing! Although, perhaps we want to speed it up or slow it down to suit the mood.
ro: Acum dansam! S-ar putea totusi sa dorim sa marim sau sa scadem viteza pentru a se potrivi cu atmosfera.

en: Playing with Time
ro: Sa ne jucam cu timpul

en: OK, so what if we want to change styles to old school hip hop or breakcore? One simple way of doing this is to play with time - or in other words mess with the tempo. This is super easy in Sonic Pi - just throw in a `use_bpm` into your live loop:
ro: Ce facem daca vrem sa schimbam stilul in hip hop clasic sau breakcore? O metoda simpla este sa ne jucam cu timpul - cu alte cuvinte sa umblam la tempo. E foarte usor sa faci asta in Sonic Pi - doar adaugi o comanda 'use_bpm' in bucla live:

en: Whilst you're rapping over those slow beats, notice that we're still sleeping for 2 and our BPM is 30, yet everything is in time. The `beat_stretch` opt works with the current BPM to make sure everything just works.
ro: Cat timp asculti ritmul asta lent, ai timp sa remarci ca pauza este tot de 2, dar acum avem 30 BPM si totusi totul este sincronizat. Parametrul 'beat_stretch' tine cont de noul ritm pentru a se asigura ca totul functioneaza.

en: Now, here's the fun part. Whilst the loop is still live, change the `30` in the `use_bpm 30` line to `50`. Woah, everything just got faster yet *kept in time*! Try going faster - up to 80, to 120, now go crazy and punch in 200!
ro: Acum urmeaza partea cu adevarat interesanta. In timp ce bucla este inca live, schimba '30' din linia 'use_bpm 30' in '50'. Uau, totul a devenit mai rapdi dar *a ramas sincronizat*. Incearca ceva mai rapid - urca la 80, la 120, fa o nebunie si pune 200!

en: Filtering
ro: Filtrarea

en: Now we can live loop samples, let's look at some of the most fun opts provided by the `sample` synth. First up is `cutoff:` which controls the cutoff filter of the sampler. By default this is disabled but you can easily turn it on:
ro: Acum putem reda esantioane in bucle live, sa vedem care sunt cei mai interesanti parametri pentru 'sample'. Primul este 'cutoff:' care controleaza filtrul de cutoff al sampler-ului (care taie frecventele mai inalte decat limita stabilita). Implicit este dezactiva, dar il poti porni cu usurinta:

en: Go ahead and change the `cutoff:` opt. For example, increase it to 100, hit *Run* and wait for the loop to cycle round to hear the change in the sound. Notice that low values like 50 sound mellow and bassy and high values like 100 and 120 are more full-sounding and raspy. This is because the `cutoff:` opt will chop out the high frequency parts of the sound just like a lawn-mower chops off the top of the grass. The `cutoff:` opt is like the length setting - determining how much grass is left over.
ro: Modifica parametrul 'cutoff'. De exemplu, mareste-l la 100, apasa *Run* si asteapta ca bucla sa se reia ca sa auzi care este efectul modificarii. Vei observa ca valori mici, ca 50, suna infundat si mai spre bas, iar valorile gen 100 sau 120 au un sunet mai complet si mai clar. Asta deoarece parametrul 'cutoff:' va duce la tairea partilor de frecventa inalta din sunet, asa cum masina de tuns taie varful firelor de iarba. Parametrul 'cutoff:' este asemanator cu lungimea la care este setata masina de tuns - spune cat sa ramana din firele de iarba.

en: Another great tool to play with is the slicer FX. This will chop (slice) the sound up. Wrap the `sample` line with the FX code like this:
ro: O alta unealta cu care ne putem juca este efectul slicer. Acest taie (slice) sunetul in bucatele. Incadreaza linia 'sample' cu codul pentru efect ca mai jos:

en: Notice how the sound bounces up and down a little more. (You can hear the original sound without the FX by changing the `mix:` opt to `0`.) Now, try playing around with the `phase:` opt. This is the rate (in beats) of the slicing effect. A smaller value like `0.125` will slice faster and larger values like `0.5` will slice more slowly. Notice that successively halving or doubling the `phase:` opts val tends to always sound good. Finally, change the `wave:` opt to one of 0, 1, or 2 and hear how it changes the sound. These are the various wave shapes. 0 is a saw wave, (hard in, fade out) 1 is a square wave (hard in, hard out) and 2 is a triangle wave (fade in, fade out).
ro: Observi ca sunetul variaza in sus si in jos ceva mai mult. (Poti asculta sunetul original, fara efect, schimband valoarea pentru 'mix:' cu '0'). Acum, incearca sa te joci cu parametrul 'phase:'. Acesta reprezinta frecventa (in batai) cu care se aplica efectul slicing. O valoare mai mica, gen '0.125', va taia sunetul mai rapid, iar valori mai mari, gen '0.5' vor face taierea mai lenta. Observi ca injumatatind sau dubland de mai multe ori valoarea pentru 'phase:' sunetul va suna mereu bine. La final, schimba valoarea 'wave:' in 0, 1 sau 2 pentru a auzi cum schimba sunetul. Acestea sunt diferite forme pentru semnal. 0 inseamna forma de fierastrau (crestere brusca, scadere lenta), 1 inseamna patrat (crestere brusca, scadere brusca), iar 2 inseamna triunghi (crester lenta, scadere lenta).

en: Finally, let's go back in time and revisit the early Bristol drum and bass scene with this month's example. Don't worry too much about what all this means, just type it in, hit Run, then start live coding it by changing opt numbers and see where you can take it. Please do share what you create! See you next time...
ro: Acum sa facem o calatorie in timp si sa ne intoarcem in Bristol la inceputurile curentului drum and bass cu exemplul de luna aceasta. Nu-ti bate capul cu ce inseamna asta, doar introdu codul, apasa Run si incepe sa-l modifici live jucandu-te cu valorile pentru parametri ca sa vezi ce iese. Te rog sa arati si altora ce ai reusit sa creezi. Pe data viitoare...

en: A.4 Synth Riffs
ro: A.4 Riff-uri (fraze melodice) pentru sintetizatoare

en: Synth Riffs
ro: Riff-uri (fraze melodice) pentru sintetizatoare

en: Whether it's the haunting drift of rumbling oscillators or the detuned punch of saw waves piercing through the mix, the lead synth plays an essential role on any electronic track. In last month's edition of this tutorial series we covered how to code our beats. In this tutorial we'll cover how to code up the three core components of a synth riff - the timbre, melody and rhythm.
ro: Fie ca este vorba de sunetul obsedant al unui oscilator sau de punch-ul unei unde in dinti de fierastrau care razbate din mix, sintetizatorul principal are un rol esential in orice piesa electronica. Luna trecuta am vorbit in acest tutorial despre cum putem coda un beat. Acum vom vorbi despre cum putem coda cele trei componente de baza ale riff-ului pentru sintetizator: timbrul, melodia si ritmul.

en: OK, so power up your Raspberry Pi, crack open Sonic Pi v2.6+ and let's make some noise!
ro: Asadar, porneste Raspberry Pi, deschide Sonic Pi v2.6+ si sa facem galagie!

en: Timbral Possibilities
ro: Controlul timbrului

en: An essential part of any synth riff is changing and playing with the timbre of the sounds. We can control the timbre in Sonic Pi in two ways - choosing different synths for a dramatic change and setting the various synth opts for more subtle modifications. We can also use FX, but that's for another tutorial...
ro: O parte esentiala a unui riff pentru sintetizator este modificarea timbrului sunetelor. Putem controla timbrul in Sonic Pi in doua feluri - alegand sintetizatoare diferite pentru o schimbare masiva sau modificand diferiti parametri ai sintetizatorului pentru schimbari mai subtile. Putem folosi si efectele, dar acesta este subiectul altui tutorial...

en: Let's create a simple live loop where we continually change the current synth:
ro: Sa cream o bucla live simple in care schimbam in continuu sintetizatorul curent:

en: Take a look at the code. We're simply ticking through a ring of synth names (this will cycle through each of these in turn repeating the list over and over). We pass this synth name to the `use_synth` fn (function) which will change the `live_loop`'s current synth. We also play note `:e2` (E at the second octave), with a release time of 0.5 beats (half a second at the default BPM of 60) and with the `cutoff:` opt set to 100.
ro: Arunca o privire asupra codului. Pur si simplu parcurgem ritmic o lista circulara de nume de sintetizatoare (fiecare dintre acestea va fi selectat pe rand, reluand lista de la inceput cand se termina).  Acest nume de sintetizator este transmis functiei 'use_synth' care schimba sintetizatorul curent din bucla live. De asemenea, redam nota ':e2' (E din a doua octava), cu un timp de release de 0.5 batai (jumatate de secunda la viteza implicita de 60 BPM) si cu un 'cutoff:' setat la 100.

en: Hear how the different synths have very different sounds even though they're all playing the same note. Now experiment and have a play. Change the release time to bigger and smaller values. For example, change the `attack:` and `release:` opts to see how different fade in/out times have a huge impact on the sound. Finally change the `cutoff:` opt to see how different cutoff values also massively influence the timbre (values between 60 and 130 are good). See how many different sounds you can create by just changing a few values. Once you've mastered that, just head to the Synths tab in the Help system for a full list of all the synths and all the available opts each individual synth supports to see just how much power you have under your coding fingertips.
ro: Poti auzi cum diferite sintetizatoare au sunete foarte diferite chiar daca redau toate aceeasi nota. Acum experimenteaza si distreaza-te. Schimba timpul de release cu valori mai mici sau mai mari. Schimba parametrii 'attack:' si 'release:' pentru a vedea cum timpi diferiti de fade in/fade out pot avea un impact foarte mare asupra sunetului. Apoi schimba valoarea pentru 'cutoff:' si vei vede ca are o influenta foarte importanta asupra timbrului (iti recomand valori intre 60 si 130). Vei vedea cat de multe sunete diferite poti crea schimband doar cateva valori. Odata ce stapanesti aceste schimbari mergi la panoul Sintetizatoare (Synths) din sistemul de ajutor pentru o lista completa a sintetizatoarelor si a tuturor parametrilor pe care ii suporta fiecare dintre acestea pentru a vedea ce puteri magice poti controla cu degetele tale de programator.

en: Timbre
ro: Timbrul

en: Timbre is just a fancy word describing the sound of a sound. If you play the same note with different instruments such as a violin, guitar, or piano, the pitch (how high or low it sounds) would be the same, but the sound quality would be different. That sound quality - the thing which allows you to tell the difference between a piano and a guitar is the timbre.
ro: Timbru este un nume pompos pentru un cuvant care descrie sunetul unui sunet. Daca redai aceeasi nota cu instrumente diferite, cum ar fi o vioara, o chitara sau un pian, inaltimea sunetului va fi aceeasi, dar calitatea sunetului va fi diferita. Aceasta calitate a sunetului - lucrul care iti permite sa sesizezi diferenta dintre un pian si o chitara este timbrul.

en: Melodic Composition
ro: Compozitia melodica

en: Another important aspect to our lead synth is the choice of notes we want to play. If you already have a good idea, then you can simply create a ring with your notes in and tick through them:
ro: Un alt element important pentru sintetizatorul principal este alegerea notelor pe care vrem sa le redea. Daca ai deja o idee, poti sa creezi pur si simplu o lista circulare cu notele si sa o parcurgi pas cu pas:

en: Here, we've defined our melody with a ring which includes both notes such as `:e3` and rests represented by `:r`. We're then using `.tick` to cycle through each note to give us a repeating riff.
ro: Aici am definit melodia printr-o lista care contine atat note, cum ar fi ':e3', cat si pauze, cum ar fi ':r'. Apoi folosim '.tick' pentru a parcurge toate notele ciclic, obtinand un riff care se repeta.

en: Auto Melody
ro: Generarea automata a melodiei

en: It's not always easy to come up with a nice riff from scratch. Instead it's often easier to ask Sonic Pi for a selection of random riffs and to choose the one you like the best. To do that we need to combine three things: rings, randomisation and random seeds. Let's look at an example:
ro: Nu e mereu simplu sa produci un riff interesant pornind de la zero. E mai usor uneori sa ceri Sonic Pi o selectie de riff-uri aleatoare dintre care sa-l alegi pe cel care iti place cel mai mult. Pentru asta vom combina 3 lucruri: liste circulare, randomizarea si initializarea unui sir aleator folosind un seed. Sa vedem un exemplu:

en: There's a few things going on - let's look at them in turn. First, we specify that we're using random seed 3. What does this mean? Well, the useful thing is that when we set the seed, we can predict what the next random value is going to be - it's the same as it was last time we set the seed to 3! Another useful thing to know is that shuffling a ring of notes works in the same way. In the example above we're essentially asking for the 'third shuffle' in the standard list of shuffles - which is also the same every time as we're always setting the random seed to the same value right before the shuffle. Finally we're just ticking through our shuffled notes to play the riff.
ro: Aici se petrec mai multe lucruri. Sa le luam pe rand. In primul rand am ales pentru initializarea sirului valoarea 3. Ce inseamna asta? Cand alegem valoarea de initializare (seed = samanta) putem prezice care va fi urmatoarea valoare aleatoare dintr-un sir - va fi la fel ca si ultima data cand am folosit numarul 3 pentru seed! Alt lucru de retinut este ca amestecarea notelor dintr-o lista functioneaza la fel. In exemplul de mai sus cerem de fapt 'a treia varianta de amestecare' in lista predefinita de variante - care va fi de asemenea la fel de fiecare data cand vom alege acelasi seed. La final, parcurgem ciclic notele amestecate pentru a canta riff-ul.

en: Now, here's where the fun starts. If we change the random seed value to another number, say 3000, we get an entirely different shuffling of the notes. So now it's extremely easy to explore new melodies. Simply choose the list of notes we want to shuffle (scales are a great starting point) and then choose the seed we want to shuffle with. If we don't like the melody, just change one of those two things and try again. Repeat until you like what you hear!
ro: Acum incepe partea distractiva. Daca schimbam valoare pentru seed cu alta valoare, sa zicem 3000, obtinem o varianta complet diferita de amestecare a notelor. Deci este extrem de usor sa incercam noi melodii. Pur si simplu alegem lista de note pe care vrem sa le amestecam (gamele sunt un bun punct de pornire)  si apoi alegem seed-ul pentre amestecare. Daca nu ne place melodia, doar schimbam unul dintre aceste lucruri si incercam din nou. Repetam pana ne place ce auzim!

en: Pseudo Randomisation
ro: Pseudo-randomizarea

en: Sonic Pi's randomisation is not actually random it's what's called pseudo random. Imagine if you were to roll a dice 100 times and write down the result of each roll onto a piece of paper. Sonic Pi has the equivalent of this list of results which it uses when you ask for a random value. Instead of rolling an actual dice, it just picks the next value from the list. Setting the random seed is just jumping to a specific point in that list.
ro: Randomizarea in Sonic Pi nu da rezultate cu adevarat aleatoare, ci pseudo-aleatoare. Imagineaza-ti ca dai cu zarul de 100 de ori si scrii rezultatul de fiecare data pe o foaie de hartie. Sonic Pi foloseste ceva echivalent cu aceste liste de rezultate atunci cand ceri o valoare aleatoare. In loc sa dea cu zarul, doar alege urmatoarea valoare din lista. Alegerea seed-ului pentru sirul aleator inseamna deplasarea la o anumita pozitie din lista.

en: Finding your Rhythm
ro: Gaseste-ti ritmul

en: Another important aspect to our riff is the rhythm - when to play a note and when not to. As we saw above we can use `:r` in our rings to insert rests. Another very powerful way is to use spreads which we'll cover in a future tutorial. Today we'll use randomisation to help us find our rhythm. Instead of playing every note we can use a conditional to play a note with a given probability. Let's take a look:
ro: Alt element important al riff-ului este ritmul - cand a redai si cand sa nu redai o nota. Dupa cum am vazut mai sus, putem folosi ':r' in listele de note pentru a insera pauze. Alta metoda foarte versatila este folosirea spread-urilor pe care o vom prezenta intr-un tutorial viitor. Astazi vom folosi randomizarea care ne va ajuta sa ne gasim ritmul dorit. In loc sa redam fiecare nota, putem folosi o instructiune conditionala pentru a reda o nota cu probabilitatea aleasa. Sa aruncam o privire:

en: A really useful fn to know is `one_in` which will give us a `true` or `false` value with the specified probability. Here, we're using a value of 2 so on average one time every two calls to `one_in` it will return `true`. In other words, 50% of the time it will return `true`. Using higher values will make it return `false` more often introducing more space into the riff.
ro: O functie pe care este foarte util sa o stii este 'one_in' care va returna o valoare de adevar ('true' sau 'false') cu probabilitatea ceruta de noi. Aici folosim valoarea 2, deci in medie functia 'one_in' va returna 'true' o data la fiecare doua apeluri. Cu alte cuvinte, in 50% dintre cazuri va returna 'true'. Folosind valori mai mari, vom obtine rezultatul 'false' mai des, introducand mai multe pauza in riff.

en: Notice that we've added some iteration in here with `16.times`. This is because we only want to reset our random seed value every 16 notes so our rhythm repeats every 16 times. This doesn't affect the shuffling as that is still done immediately after the seed is set. We can use the iteration size to alter the length of the riff. Try changing the 16 to 8 or even 4 or 3 and see how it affects the rhythm of the riff.
ro: Ai observat ca am adaugat o iteratie folosind '16.times'. Asta deoarece vrem sa resetam sirul pseudoaleator doar o data la fiecare 16 note, astfel incat ritmul nostru sa se repete de 16 ori. Aceasta nu influenteaza amestecarea notelor deoarecea aceasta este realizata imediat dupa ce valoarea de initializare pentru sirul plseudoaleator este stabilita. Putem folosi dimensiunea iteratiei pentru a modifica lungimea riff-ului. Schimba din 16 in 8 sau chiar 4 sau 3 pentru a vedea cum afecteaza ritmul riff-ului.

en: OK, so let's combine everything we've learned together into one final example. See you next time!
ro: OK, sa punem cap la cap ce am invatat intr-un exemplu final. Ne vedem data viitoare!

en: A.5 Acid Bass
ro: A. Basul acid

en: Acid Bass
ro: Basul acid

en: It's impossible to look through the history of electronic dance music without seeing the enormous impact of the tiny Roland TB-303 synthesiser. It's the secret sauce behind the original acid bass sound. Those classic squealing and squelching TB-303 bass riffs can be heard from the early Chicago House scene through to more recent electronic artists such as Plastikman, Squarepusher and Aphex Twin.
ro: Este imposibil sa treci in revista istoria muzicii dance electronice fara sa remarci impactul major al micutului sintetizator Roland TB-303. Este ingredientul secret din sunetul acid bass original. Acele clasice riff-uri de bas scartaite produse de TB-303 pot fi intalnite de la inceputurile Chicago House pana mai aproape de zilele noastre la artisti ca Plastikman, Squarepusher si Aphex Twin.

en: Interestingly, Roland never intended for the TB-303 to be used in dance music. It was originally created as a practice aid for guitarists. They imagined that people would program them to play bass lines to jam along to. Unfortunately there were a number of problems: they were a little fiddly to program, didn't sound particularly good as a bass-guitar replacement and were pretty expensive to buy. Deciding to cut their losses, Roland stopped making them after 10,000 units were sold and after a number of years sitting on guitarist's shelves, they soon could be found in the windows of second hand shops. These lonely discarded TB-303s were waiting to be discovered by a new generation of experimenters who started using them in ways that Roland didn't imagine to create new crazy sounds. Acid House was born.
ro: Este interesant de stiut ca Roland nu a a gandit TB-303 pentru a fi utilizat in muzica dance. A fost creat initial ca un ajutor pentru chitaristii care exerseaza. Ei si-au imaginat ca utilizatorii vor programa sintetizatorul sa redea linia de bas si vor improviza alaturi de el. Din nefericie, au existat o serie de probleme: erau cam complicat de programat, nu sunau foarte bine ca inlocuitor de chitara bas si erau destul de scumpe. Ca sa-si limiteze pierderile, Roland a decis sa opreasca productia duoa ce a vandut 10000 de bucati si dupa ce au zacut cativa ani nefolosite prin dulapurile chitaristilor au inceput sa apara in vitrinele magazinelor second hand. Aceste TB-303 abandonat asteptau sa fie descoperite de o noua generatie de inovatori care au inceput sa le foloseasca in moduri la care Roland nu se gandise si sa creeze sunete noi incitante. Asa s-a nascut Acid House.

en: Although getting your hands on an original TB-303 is not so easy you will be pleased to know that you can turn your Raspberry Pi into one using the power of Sonic Pi. Behold, fire up Sonic Pi and throw this code into an empty buffer and hit Run:
ro: Daca sa pui mana pe un TB-303 nu e prea usor, te vei bucura sa afil ca poti sa iti transformi Raspberry Pi intr-un astfel de sintetizatori folosind puterea Sonic Pi. Pornest Sonic Pi si copiaza codul asta intr-un buffer gol, apoi apasa Run:

en: Instant acid bass! Let's play around...
ro: Am obtinut pe loc acid bass. Sa ne jucam putin...

en: Squelch that Bass
ro: Sa scartaie basul

en: First, let's build a live arpeggiator to make things fun. In the last tutorial we looked at how riffs can just be a ring of notes that we tick through one after another, repeating when we get to the end. Let's create a live loop that does exactly that:
ro: Mai intai, sa construim un generator live de arpegii pentru a face lucrurile mai distractive. In tutorialul precedent am vazut cum riff-urile pot fi doar liste de note care se repeta una cate una, luand-o de la capat cand ajungem la sfarsit. Sa cream o bucla live care face exact acest lucru:

en: Take a look at each line.
ro: Sa privim fiecare linie.

en: On the first line we set the default synth to be `tb303` with the `use_synth` fn.
ro: Pe prima linie alegem ca sintetizatorul implicit sa fie 'tb303', folosind functia 'use_synth'.

en: On line two we create a live loop called `:squelch` which will just loop round and round.
ro: Pe linia a doua cream o bucla live numita ':squelch' care se va relua iar si iar.

en: Line three is where we create our riff - a ring of notes (E in octaves 1, 2, and 3) which we simply tick through with `.tick`. We define `n` to represent the current note in the riff. The equals sign just means to assign the value on the right to the name on the left. This will be different every time round the loop. The first time round, `n` will be set to `:e1`. The second time round it will be `:e2`, followed by `:e3`, and then back to `:e1`, cycling round forever.
ro: Linia a treia este locul unde cream riff-ul - o lista de note (E in octavele 1, 2 si 3) pe care o parcurgem ciclic folosind '.tick'. Definim 'n' pentru a reprezenta nota curent din riff. Semnul egal inseamna ca atribuim valoarea din drepata numelui din stanga sa. Aceasta va fi diferita la fiecare trecere. Prima data, 'n' va avea valoarea ':e1'. A doua oara va fi ':e2;, urmata de ':e3' si apoi iar ':e1', reluandu-se la infinit.

en: Line four is where we actually trigger our `:tb303` synth. We're passing a few interesting opts here: `release:`, `cutoff:`, `res:` and `wave:` which we'll discuss below.
ro: Linia patru este locul in care pornim cu adevarat ':tb303' Sunt folositi cativa parametri interesanti aici: 'release:', 'cutoff:, 'res:' si 'wave:', pe care ii discutam in continuare.

en: Line five is our `sleep` - we're asking the live loop to loop round every `0.125`s or 8 times a second at the default BPM of 60.
ro: Linia 5 este cea in care cerem pauza ('sleep') - cerem buclei sa se reia la fiecare '0.125'secunde sau de 8 ori pe secunda la viteza implicita de 60 BPM.

en: Line six is the `end` to the live loop. This just tells Sonic Pi where the end of the live loop is.
ro: Linia 6 este sfarsitul ('end') buclei live. Ea spune Sonic Pi unde se termina partea care se repeta in bucla.

en: Whilst you're still figuring out what's going on, type in the code above and hit the Run button. You should hear the `:tb303` kick into action. Now, this is where the action is: let's start live coding.
ro: Cat timp incerci sa intelegi ce se intampla, scrie codul de mai sus si apasa butonul Run. Ar trebui sa auzi cum ':tb303' intra in actiune. Aici este toata distractia, sa incepem sa programam live!

en: Whilst the loop is still live, change the `cutoff:` opt to `110`. Now hit the Run button again. You should hear the sound become a little harsher and more squelchy. Dial in `120` and hit run. Now `130`. Listen how higher cutoff values make it sound more piercing and intense. Finally, drop it down to `80` when you feel like a rest. Then repeat as many times as you want. Don't worry, I'll still be here...
ro: In timp ce se executa bucla, schimba valoarea pentru 'cutoff:' la '110'. Acum apasa pe Run din nou. Ar trebui sa auzi cum sunetul devine putin mai dur si mai scartait. Scrie '120' si apasa pe Run. Apoi '130'. Asculta cum o valoare mai mare pentru cutoff face sunetul mai intens si mai patrunzator. Coboara valoarea la '80' cand simti ca e nevoie de o pauza. Apoi repeta de cate ori doresti. Nu te teme, voi fi tot aici...

en: Another opt worth playing with is `res:`. This controls the level of resonance of the filter. A high resonance is characteristic of acid bass sounds. We currently have our `res:` set to `0.8`. Try cranking it up to `0.85`, then `0.9`, and finally `0.95`. You might find that a cutoff such as `110` or higher will make the differences easier to hear. Finally go crazy and dial in `0.999` for some insane sounds. At a `res` this high, you're hearing the cutoff filter resonate so much it starts to make sounds of its own!
ro: Un alt parametru cu care te poti juca este'res:'. Acesta controleaza nivelul de rezonanta al filtrului. O rezonanta inalta este o caracteristica a sunetelor acid bass. Acum avem valoarea pentru 'res:' setata la '0.8'. Incearca sa o maresti putin la '0.85', apoi la '0.9' si in final la 0.95'. Vei constata ca o valoare pentru cutoff gen '110' sau mai ridicata va face diferentele mai usor de auzit. Fa o nebunie si introdu '0.999' pentru niste sunete traznite. La o valoare atat de ridicata pentru 'res' vei auzi cum filtrul cutoff rezoneaza atata de mult incat incepe sa scoata propriile sunete!

en: Finally, for a big impact on the timbre try changing the `wave:` opt to `1`. This is the choice of source oscillator. The default is `0` which is a sawtooth wave. `1` is a pulse wave and `2` is a triangle wave.
ro: In fine, un impact puternic asupra timbtului il are schimbarea valorii pentru 'wave:' in '1'. Aceasta este alegerea oscilatorului sursa. Valoarea '0' este pentru unda dinte de fierastrau, '1' este pentru impulsuri rectangulare, iar '2' pentru o forma de unda triunghiulara.

en: Of course, try different riffs by changing the notes in the ring or even picking notes from scales or chords. Have fun with your first acid bass synth.
ro: Desigur, poti incerca diferite riff-uri schimband notele din lista sau chiar alegand notele din game sau acorduri. Distreaza-te cu primul tau sintetizator acid bass.

en: Deconstructing the TB-303
ro: Disectia TB-303

en: The design of the original TB-303 is actually pretty simple. As you can see from the following diagram there's only 4 core parts.
ro: Designul TB-303 original este de fapt destul de simplu. Dupa cum vezi in diagrama urmatoare sunt doar 4 componente de baza.

en: First is the oscillator wave - the raw ingredients of the sound. In this case we have a square wave. Next there's the oscillator's amplitude envelope which controls the amp of the square wave through time. These are accessed in Sonic Pi by the `attack:`, `decay:`, `sustain:` and `release:` opts along with their level counterparts. For more information read Section 2.4 'Duration with Envelopes' in the built-in tutorial. We then pass our enveloped square wave through a resonant low pass filter. This chops off the higher frequencies as well as having that nice resonance effect. Now this is where the fun starts. The cutoff value of this filter is also controlled by its own envelope! This means we have amazing control over the timbre of the sound by playing with both of these envelopes. Let's take a look:
ro: Prima este unda produsa de oscilator - materia prima pentru sunet. In cazul acesta avem o unda rectangulara. Apoi este anvelopa de amplitudine a oscilatorului care controleaza amplitudineea undei rectangulare in timp. Acestea sunt accesibile in Sonic Pi folosind 'attack:', 'decay:', 'sustain:' si 'release:' impreuna cu nivelele lor. Pentru mai multe informatii citeste sectiunea 2.4 'Anvelopa de timp' din tutorialul inclus in program. Trecem apoi unda rectangulara careia i-a fost aplicata anvelopa printr-un filtru rezonant 'trece jos' (low pass). Acesta taie frecventele inalte si are si un efect placut de rezonanta. Aici incepe partea interesanta. Valoarea de cutoff pentru acest filtrul are propria sa anvelopa. Aste ne ofera un control incredibil asupra timbrului sunetului prin modificarea ambelor anvelope. Sa aruncam o privire:

en: For each standard envelope opt, there's a `cutoff_` equivalent opt in the `:tb303` synth. So, to change the cutoff attack time we can use the `cutoff_attack:` opt. Copy the code above into an empty buffer and hit Run. You'll hear a crazy sound warble in and out. Now start to play. Try changing the `cutoff_attack:` time to `1` and then `0.5`. Now try `8`.
ro: Pentru fiecare parametru al anvelopei standard exista un echivalent pentru 'cutoff_' in cazul sintetizatorului ':tb303'. Deci, pentru a shimba timpul de atac pentru cuttof putem folosi parametrul 'cutoff_attack'. Copiaza codul de mai sus intr-un buffer gol si apasa Run. Vei auzi un sunet ca un ciripit. Incearca sa schimbi timpul pentru 'cutoff_attack' in '1' si apoi in '0.5'. Acum incearca '8'.

en: Notice that I've passed everything through a `:reverb` FX for extra atmosphere - try other FX to see what works!
ro: Observi ca am trecut totul printr-un efect ':reverb' pentru atmosfera. Incearca alte efecte pentru a vedea ce se intampla!

en: Finally, here's a piece I composed using the ideas in this tutorial. Copy it into an empty buffer, listen for a while and then start live coding your own changes. See what crazy sounds you can make with it! See you next time...
ro: La final iata o piesa pe care am compus-o folosind ideile prezentate in acest tutorial. Copiaz-o intr-un buffer gol, asculta pentru un timp apoi incepe sa programezi live aducand propriile modificari. Vezi ce sunete interesante poti produce din ea! Ne vedem data viitoare...

en: A.6 Musical Minecraft
ro: A.6 Minecraft muzical

en: Musical Minecraft
ro: Minecraft muzical

en: Hello and welcome back! In the previous tutorials we've focussed purely on the music possibilities of Sonic Pi - (turning your Raspberry Pi into a performance ready musical instrument). So far we've learned how to:
ro: Salut, bine ati revenit! In precedentele tutoriale ne-am concentrat doar pe functionalitatile muzicale ale Sonic Pi (transformarea Raspberry Pi intr-un instrument muzical gata pentru interpretare). Pana acum am invatat cum sa:

en: Live Code - changing the sounds on-the-fly,
ro: Programam live - schimband sunetele din mers,

en: Code some huge beats,
ro: Programam niste beat-uri geniale,

en: Generate powerful synth leads,
ro: Generam melodii cool folosind sintetizatoarele,

en: Re-create the famous TB-303 acid-bass sound.
ro: Re-cream vestitul sunet acid-bass al sintetizatorului TB-303.

en: There's so much more to show you (which we will explore in future editions). However, this month, let's look at something Sonic Pi can do that you probably didn't realise: control Minecraft.
ro: Am insa mult mai multe sa va arat (si voi continua sa fac asta in numerele viitoare). Luna asta, insa, am sa va arat ceva ce Sonic Pi stie sa faca dar probabil nici nu va ganditi: sa controleze Minecraft.

en: Hello Minecraft World
ro: Salut lume Minecraft!

en: OK, let's get started. Boot up your Raspberry Pi, fire up Minecraft Pi and create a new world. Now start up Sonic Pi and re-size and move your windows so you can see both Sonic Pi and Minecraft Pi at the same time.
ro: OK, sa incepem. Porneste Rasberry Pi, lanseaza Minecraft Pi si creeaza o lume noua. Acum porneste Sonic Pi si redimensioneaza si aseaza ferestrele astfel incat sa vezi atat Sonic Pi cat si Minecraft Pi in acelasi timp.

en: In a fresh buffer type the following:
ro: Intr-un buffer nou scrie asta:

en: Now, hit Run. Boom! Your message appeared in Minecraft! How easy was that? Now, stop reading this for a moment and play about with your own messages. Have fun!
ro: Acum, apasa Run. Boom! Mesajul tau a aparut in Minecraft! Cat de greu a fost? Acum, opreste-te putin din citit acest tutorial si joaca-te putin cu propriile mesaje. Distreaza-te!

en: Sonic Teleporter
ro: Teleportare sonica

en: Now let's do some exploring. The standard option is to reach for the mouse and keyboard and start walking around. That works, but it's pretty slow and boring. It would be far better if we had some sort of teleport machine. Well, thanks to Sonic Pi, we have one. Try this:
ro: Acum sa exploram putin. Varianta obisnuita este sa iei mouse-ul si tastatura si sa incepi sa te plimbi in jur. Merge, dar este incet si plictisittor. Ar fi mult mai bine daca ai avea o masina care ar putea sa te teleporteze. Ei bine, Sonic Pi are una. Incearca asta:

en: Crikey! That was a long way up. If you weren't in flying-mode then you would have fallen back down all the way to the ground. If you double-tap space to enter flying-mode and teleport again, you'll stay hovering at the location you zap to.
ro: Genial! Ai ajuns sus, departe. Daca nu aveai activat modul de zbor ai cazut inapoi pana pe pamant. Daca apeste de doua ori rapid pe spatiu ca asa comuti in modul de zbor si te teleportezi din nou, vei incepe sa plutesti din pozitia in care ai aparut.

en: Now, what do those numbers mean? We have three numbers which describe the coordinates of where in the world we want to go. We give each number a name - x, y and z:
ro: Acum sa vedem ce inseamna acele numere. Avem trei numere care descriu coordonatele locului din lume in care ne aflam. Fiecare numar are un nume - x, y si z:

en: x - how far left and right (80 in our example)
ro: x - cat de departe la stanga sau la dreapta (80 in exemplul nostru)

en: y - how high we want to be (40 in our example)
ro: y - cat de sus vrem sa ajungem (40 in exemplul nostru)

en: z - how far forward and back (100 in our example)
ro: z - cat de departe inainte sau inapoi (100 in exemplul nostru)

en: By choosing different values for x, y and z we can teleport *anywhere* in our world. Try it! Choose different numbers and see where you can end up. If the screen goes black it's because you've teleported yourself under the ground or into a mountain. Just choose a higher y value to get back out above land. Keep on exploring until you find somewhere you like...
ro: Alegand diferite valori pentru x, y sau z, putem sa ne teleportam *oriunde* in lumea noastra. Incearca! Alege numere diferite si vezi unde ajungi. Daca ecranul devine negru inseamna ca te-ai teleportat sub pamant sau intr-un munte. Alege o valoare mai mare pentru y si vei iesi din nou deasupra solului. Continua sa explorezi pana gasesti un loc care iti place...

en: Using the ideas so far, let's build a Sonic Teleporter which makes a fun teleport sound whilst it whizzes us across the Minecraft world:
ro: Folosind ideile de pana acum, sa construim o masina de teleportat care scoate un sunet haios cand te deplaseaza in lumea Minecraft:

en: Magic Blocks
ro: Blocuri magice

en: Now you've found a nice spot, let's start building. You could do what you're used to and start clicking the mouse furiously to place blocks under the cursor. Or you could use the magic of Sonic Pi. Try this:
ro: Ai gasit un loc interesant, acum sa incepem sa construim. Ai putea face ca pana acum sa incepi sa faci click in disperare cu mouse-ul pentru a plasa blocuri la pozitia cursorului. Sau ai putea sa folosesti puterile magice ale Sonic Pi. Incearca asta:

en: Now look up! There's a melon in the sky! Take a moment to look at the code. What did we do? On line one we grabbed the current location of Steve as the variables x, y and z. These correspond to our coordinates described above. We use these coordinates in the fn `mc_set_block` which will place the block of your choosing at the specified coordinates. In order to make something higher up in the sky we just need to increase the y value which is why we add 5 to it. Let's make a long trail of them:
ro: Acum priveste in sus! E un pepene pe cer! Priveste o clipa la cod. Ce am facut? Pe prima linia am aflat pozitia curenta a lui Steve in variabilele x, y si z. Acestea corespund coordonatelor descrise anterior. Folosim aceste coordonate in functia 'mc_set_block' care plaseaza blocul pe care l-ai ales la coordonatele specificate. Pentru a construi ceva mai sus in cer trebuie sa marim valoarea pentru y, motiv pentru care am adaugat 5 la ea. Sa construim o poteca:

en: Now, jump over to Minecraft, make sure you're in flying-mode (double tap space if not) and fly all around the world. Look behind you to see a pretty trail of melon blocks! See what kind of twisty patterns you can make in the sky.
ro: Acum, mergi in fereastra Minecraft, asigura-te ca esti in modul de zbor (apasa de doua ori pe bara de spatiu in caz contrar) si zboara la intamplare. Priveste in urma ta si vei vedea o poteca formata din pepeni. Incearca sa creezi modele cat mai introtocheate pe cer.

en: Live Coding Minecraft
ro: Programare live in Minecraft

en: Those of you that have been following this tutorial over the last few months will probably have your minds blown at this point. The trail of melons is pretty cool, but the most exciting part of the previous example is that you can use `live_loop` with Minecraft! For those that don't know, `live_loop` is Sonic Pi's special magic ability that no other programming language has. It lets you run multiple loops at the same time and allows you to change them whilst they run. They are incredibly powerful and amazing fun. I use `live_loop`s to perform music in nightclubs with Sonic Pi - DJs use discs and I use `live_loop`s :-) However, today we're going to live code both music and Minecraft.
ro: Cei care au urmarit acest tutorial pe parcursul ultimelor lui sunt probabil dati pe spate. Poteca din pepeni este interesanta, dar cel mai surprinzator este ca poti folosi 'live_loop' cu Minecraft! Pentru cei care nu stiu, 'live_loop' este o putere magica a Sonic Pi pe care niciun alt limbaj de programare nu o are. Iti permite sa rulezi mai multe bucle in acelasi timp si te lasa sa le schimbi in timp ce ruleaza. Sunt incredibil de puternice si foarte distractive. Eu folosesc 'live_loop' pentru a canta in cluburi cu Sonic Pi. DJ-ii folosesc discuri, eu folosesc bucle live :) Dar astazi vom programa live si muzica si Minecraft.

en: Let's get started. Run the code above and start making your melon trail again. Now, without stopping the code, just simply change `:melon` to `:brick` and hit run. Hey presto, you're now making a brick trail. How simple was that! Fancy some music to go with it? Easy. Try this:
ro: Sa incepem. Ruleaza codul de mai sus si incepe sa construiesti poteca din pepeni din nou. Acum, fara sa opresti codul, schimba ':melon' cu ':brick' si apasa pe Run. Acum lasi in urma ta o poteca din caramizi. Cat de simplu a fost! Ti-ar placea sa ai si niste muzica in timp ce faci asta? E usor. Incearca:

en: Now, whilst that's playing start changing the code. Change the block types - try `:water`, `:grass` or your favourite block type. Also, try changing the cutoff value from `70` to `80` and then up to `100`. Isn't this fun?
ro: Acum, in timp ce ruleaza, incepe sa schimbi codul. Schimba tipul de blocuri - incearca ':water', ':grass' sau blocul tau favorit. In acelasi timp incearca sa schimbi valoarea pentru cutoff din '70' in '80 si apoi in '100' Nu-i asa ca este distractiv?

en: Let's combine everything we've seen so far with a little extra magic. Let's combine our teleportation ability with block placing and music to make a Minecraft Music Video. Don't worry if you don't understand it all, just type it in and have a play by changing some of the values whilst it's running live. Have fun and see you next time...
ro: Sa punem cap la cap ce am vazut pana acum si sa mai adaugam putina magie. Sa combinam abilitatea de a ne teleporta cu plasarea de blocuri si cu muzica pentru a realiza un videoclip Minecraft. Nu te ingrijora daca nu intelegi totul, doar scrie codul asta si joaca-te cu el schimband niste valori in timp ce este redat. Distreaza-te! Ne vedem data viitoare...

en: A.7 Bizet Beats
ro: A.7 Beat-uri Bizet

en: Bizet Beats
ro: Beat-uri Bizet

en: After our brief excursion to the fantastic world of coding Minecraft with Sonic Pi last month, let's get musical again. Today we're going to bring a classical operatic dance piece straight into the 21st century using the awesome power of code.
ro: Dupa scurta noastr incursiune in fantastica lumea a programarii Minecraft folosind Sonic Pi de luna trecuta, sa revenim la muzica. Astazi vom aduce o bucata de dans dintr-o opera clasica direct in secolul 21 folosind puterea codului.

en: Outrageous and Disruptive
ro: Scandalos si tulburator

en: Let's jump into a time machine back to the year 1875. A composer called Bizet had just finished his latest opera Carmen. Unfortunately like many exciting and disruptive new pieces of music people initially didn't like it at all because it was too outrageous and different. Sadly Bizet died ten years before the opera gained huge international success and became one of the most famous and frequently performed operas of all time. In sympathy with this tragedy let's take one of the main themes from Carmen and convert it to a modern format of music that is also too outrageous and different for most people in our time - live coded music!
ro: Sa calatorim inapoi in timp in anul 1875. Un compozitor pe nume Bizet tocmai a terminat ultima sa opera, Carmen. Din pacate, la fel ca in cazul multor altor piese incitante si neobisnuite, lumea nu a apreciat-o la inceput deoarece era scandalos de diferita. In mod tragic, Bizeta a murit cu zece ani inainte ca opera sa obtine un succes international imens si sa devina una dintre cele mai faimoase si cele mai frecvent interpretate opere din toate timpurile. Ca un semn de compasiune sa luam una dintre temele principale din Carmen si sa o convertim intr-un format modern care este de asemenea scandalos si diferit pentru majoritatea oamenilor din vremea nostra - muzica programata live!

en: Decoding the Habanera
ro: Decodarea Habanerei

en: Trying to live code the whole opera would be a bit of a challenge for this tutorial, so let's focus on one of the most famous parts - the bass line to the Habanera:
ro: Sa incercam sa scriem cod pentru intreaga opera ar fi o provocare serioasa pentru acest tutorial, mai bine sa ne concentram asupra uneia dintre cele mai faimoase parti  - linia de bas din Habanera:

en: This may look extremely unreadable to you if you haven't yet studied music notation. However, as programmers we see music notation as just another form of code - only it represents instructions to a musician instead of a computer. We therefore need to figure out a way of decoding it.
ro: S-ar putea sa ti se para ca e in pasareasca daca nu ai studiat notatia muzicala inca. Totusi, ca programatori vedem notatia muzicala ca pe o alta forma de cod - doar ca reprezinta instructiuni pentru un muzician, nu pentru un computer. Trebuie deci sa gasim o cale sa o decodam.

en: Notes
ro: Notele

en: The notes are arranged from left to right like the words in this magazine but also have different heights. *The height on the score represents the pitch of the note.* The higher the note on the score, the higher the pitch of the note.
ro: Notele sunt aranjate de la stanga la dreapta, la fel cu cuvintele din aceasta revista, dar au inaltimi diferite. *Inaltimea pe portativ reprezinta tonalitatea notei*. Cu cat e mai sus nota pe portativ, cu atat tonalitatea notei va fi mai sus.

en: In Sonic Pi we already know how to change the pitch of a note - we either use high or low numbers such as `play 75` and `play 80` or we use the note names: `play :E` and `play :F`. Luckily each of the vertical positions of the musical score represents a specific note name. Take a look at this handy look up table:
ro: In Sonic Pi stim deja sa modificam tonalitatea notei - fie folosim numere mai mari sau mai mici, cum ar fi 'play 75' si 'play 80', fie folosim numele notelor: 'play: E' si 'play:F'. Din fericire, fiecare dintre pozitiile verticale de pe portativ reprezinta o anumita nota. Priveste acest tabel util pentru cautare rapida:

en: Rests
ro: Pauzele

en: Music scores are an extremely rich and expressive kind of code capable of communicating many things. It therefore shouldn't come as much of a surprise that musical scores can not only tell you what notes to play but also when *not* to play notes. In programming this is pretty much equivalent to the idea of `nil` or `null` - the absence of a value. In other words not playing a note is like the absence of a note.
ro: Partiturile muzicale reprezinta un tip de cod foarte bogat si expresiv capabil sa comunice multe lucruri. Nu ar trebui deci sa fie o surpriza ca partiturile pot sa-ti spuna nu doar ce note sa canti, ci si cand *nu* trebuie sa canti nicio nota. In programare acest lucru este echivalent cu folosirea 'nil' sau 'null' - absenta unei valori. Cu alte cuvinte, a nu canta nicio nota inseamna absenta unei note.

en: If you look closely at the score you'll see that it's actually a combination of black dots with lines which represent notes to play and squiggly things which represent the rests. Luckily Sonic Pi has a very handy representation for a rest: `:r`, so if we run: `play :r` it actually plays silence! We could also write `play :rest`, `play nil` or `play false` which are all equivalent ways of representing rests.
ro: Daca privesti cu atentie partitura vei observa ca este de fapt o combinatie de puncte negre cu linii care reprezinta notele ce vor fi redate si niste chesti serpuite care reprezinta pauzele. Din fericire Sonic Pi are o reprezentare foarte comoda pentru pauze: ':r', deci daca dam comanda: 'play :r' va reda de fapt liniste... Putem de asemenea sa scriem 'play :rest', 'play nil' sau 'play false' care sunt toate moduri echivalente de a reprezenta pauzele.

en: Rhythm
ro: Ritmul

en: Finally, there's one last thing to learn how to decode in the notation - the timings of the notes. In the original notation you'll see that the notes are connected with thick lines called beams. The second note has two of these beams which means it lasts for a 16th of a beat. The other notes have a single beam which means they last for an 8th of a beat. The rest has two squiggly beams which means it also represents a 16th of the beat.
ro: Mai este un ultim lucru pe care trebuie sa inveti sa-l decodezi in notatie - tempoul pentru note. In imaginea initiala vei vedea ca notele sunt conectate cu niste linii groase. A doua nota are doua astfel de linii, ceea ce inseamna ca tine o saisprezecime de masura. Celelalte note au o singura linie, ceea ce inseamna ca dureaza o optime. Pauza are si ea doua linii serpuite care inseamna ca dureaza tot o saisprezecime de masura.

en: When we attempt to decode and explore new things a very handy trick is to make everything as similar as possible to try and see any relationships or patterns. For example, when we re-write our notation purely in 16ths you can see that our notation just turns into a nice sequence of notes and rests.
ro: Cand incercam sa decodam si sa exploram efectul unor modificari cel mai bine ar fi sa incercam sa facem totul cat mai asemanator si sa incercam sa vedem ce legaturi putem face. De exemplu, cand rescriem partitura noastra in saisprezecimi poti vede cum se transforma intr-o secventa draguta de note si pauze.

en: Re-coding the Habanera
ro: Rescrierea bucatii Habanera

en: We're now in a position to start translating this bass line to Sonic Pi. Let's encode these notes and rests in a ring:
ro: Suntem acum in masura sa transpunem aceasta line de bas in Sonic Pi. Sa codam aceste note si pauze intr-o lista circulara:

en: Let's see what this sounds like. Throw it in a live loop and tick through it:
ro: Sa vedem cum suna. Pune asta intr-o bucla live si fa o parcurgere ciclica:

en: Fabulous, that instantly recognisable riff springs to life through your speakers. It took a lot of effort to get here, but it was worth it - high five!
ro: Excelent, acest riff inconfundabil capata viata in difuzoarele tale. A fost foarte greu sa ajungem aici, dar a meritat - bate palma!

en: Moody Synths
ro: Sintetizatoare de atmosfera

en: Now we have the bass line, let's re-create some of the ambience of the operatic scene. One synth to try out is `:blade` which is a moody 80s style synth lead. Let's try it with the starting note `:d` passed through a slicer and reverb:
ro: Avem linia de bas, sa recream o parte din atmosfera scenei de opera. Un sintetizatot care merita incercat este ':blade' care este un sintetizator in genul anilor 80. Sa-l incercam trecand nota ':d' de la inceput printr-un slicer si un efect reverb:

en: Now, try the other notes in the bass line: `:a` and `:f5`. Remember, you don't need to hit stop, just modify the code whilst the music is playing and hit run again. Also, try different values for the slicer's `phase:` opt such as `0.5`, `0.75` and `1`.
ro: Acum, incearca alte note in linia de bas: ':a' si ':f5'. Tine minte, nu e nevoie sa apesi pe Stop, doar modifici codul in timp ce se aude muzica si apesi pe Run din nou. De asemenea, incearca diferite valori pentru parametru 'phase:' al slicer-ului, cum ar fi `0.5`, `0.75` si `1`.

en: Finally, let's combine all the ideas so far into a new remix of the Habanera. You might notice that I've included another part of the bass line as a comment. Once you've typed it all into a fresh buffer hit Run to hear the composition. Now, without hitting stop, *uncomment* the second line by removing the `#` and hit run again - how marvellous is that! Now, start mashing it around yourself and have fun.
ro: La final, sa combinam toate aceste idei intr-un nou remix dupa Habanera. Poate ai observat ca am inclus o alta parte din linia de bas sub forma de comentariu. Dupa ce ai copiat totul intr-un buffer nou apasa Run si asculta compozitia. Acum, fara sa apesi pe stop, sterge simbolul de comentariu '#' din fata celei de a doua linii si apasa Run din nou - nu e minunat? Acum poti sa-l modifici cum vrei si sa te distrezi.

en: A.8 Become a Minecraft VJ
ro: A.8 Cum sa devii un VJ Minecraft

en: Become a Minecraft VJ
ro: Cum sa devii un VJ Minecraft

en: Everyone has played Minecraft. You will all have built amazing structures, designed cunning traps and even created elaborate cart lines controlled by redstone switches. How many of you have performed with Minecraft? We bet you didn't know that you could use Minecraft to create amazing visuals just like a professional VJ.
ro: Toata lumea a jucat Minecraft. Toti ati construit structuri impresionante, ati gandit capcane iscusite si probabil ati creat trasee pentru minecart controlate de comutatoare si circuite din redstone. Cati dintre voi ati interpretat muzica in Minecraft. Pariez ca nu stiati ca puteti folosi Minecraft ca sa creati efecte vizuale impresionante, la fel ca un VJ profesionist.

en: If your only way of modifying Minecraft was with the mouse, you'd have a tough time changing things fast enough. Luckily for you your Raspberry Pi comes with a version of Minecraft that can be controlled with code. It also comes with an app called Sonic Pi which makes coding Minecraft not only easy but also incredibly fun.
ro: Daca singurul mod in care ai schimbat ceva in Minecraft a fost cu ajutorul mouse-ului, probabil te-ai chinuit destul de mult sa schimbi lucrurile suficient de rapid. Din fericire pentru tine Raspberry Pi iti vine in ajutor cu o versiune de Minecraft care poate fi controlata prin intermediul programarii. Vine de asemenea cu o aplicatie numita Sonic Pi care face programarea in Minecraft nu doar foarte facila ci si incredibil de distractiva.

en: In today's article we'll be showing you some of the tips and tricks that we've used to create performances in night clubs and music venues around the world.
ro: In articolul de azi iti voi arata cateva trucuri pe care le-am folosit pentru interpretarile din cluburile de noapte sau scene muzicale din toata lumea.

en: Let's get started...
ro: Sa incepem...

en: Getting Started
ro: Inceputul

en: Let's start with a simple warm up exercise to refresh ourselves with the basics. First up, crack open your Raspberry Pi and then fire up both Minecraft and Sonic Pi. In Minecraft, create a new world, and in Sonic Pi choose a fresh buffer and write in this code:
ro: Sa incepem cu un exercitiu usor de incalzire pentru a ne reaminti lucrurile de baza. Pentru inceput, porneste Raspberry Pi si apoi lanseaza atat Minecraft cat si Sonic Pi. In Minecraft, creeaza o lume noua, iar in Sonic Pi alege un buffer gol si scrie codul de mai jos:

en: mc_message "Let's get started..."
ro: mc_message "Sa incepem..."

en: Hit the Run button and you'll see the message over in the Minecraft window. OK, we're ready to start, let's have some fun......
ro: Apasa butonul Run si vei vedea un mesaj in fereastra Minecraft. OK, suntem gata sa incepem, hai sa ne distram...

en: Sand Storms
ro: Furtuna de nisip

en: When we're using Minecraft to create visuals we try and think about what will both look interesting and also be easy to generate from code. One nice trick is to create a sand storm by dropping sand blocks from the sky. For that all we need are a few basic fns:
ro: Cand folosim Minecraft pentru a crea efecte vizuale incercam sa ne gandim ce va arata interesant si va fi si usor de generat prin cod. Un truc haios este sa creezi o furtuna de nisip lasand sa cada blocuri de nisip din cer. Pentru asta avem nevoie doar de cateva functii de baza:

en: `sleep` - for inserting a delay between actions
ro: 'sleep' - pentru a insera o pauza intre actiuni

en: `mc_location` - to find our current location
ro: 'mc_location' - pentru a afla pozitia noastra curenta

en: `mc_set_block`- to place sand blocks at a specific location
ro: 'mc_set_block' - pentru a plasa blocuri de nisip la o anumita pozitie

en: `rrand` - to allow us to generate random values within a range
ro: 'rrand' - pentru a genera valori aleatoare intr-un anumit interval

en: `live_loop` - to allow us to continually make it rain sand
ro: 'live_loop' - pentru a face ca ploaia de nisip sa cada in continuu

en: If you're unfamiliar with any of the built-in fns such as `rrand`, just type the word into your buffer, click on it and then hit the keyboard combo `Control-i` to bring up the built-in documentation. Alternatively you can navigate to the *lang* tab in the Help system and then look up the fns directly along with all the other exciting things you can do.
ro: Daca nu esti familiarizat cu vreuna dintre functiile de mai sus, cum ar fi 'rrand', scrie numele ei intr-un buffer, fa click pe el si apoi apasa combinatia de taste 'Control-i' pentru a afisa informatiile despre functie din documentatia interna. O alta varianta ar fi sa mergi la panoul *lang* din sistemul de ajutor si sa cauti direct functia alaturi de alte chestii incitante pe care le poti face.

en: Let's make it rain a little first before unleashing the full power of the storm. Grab your current location and use it to create a few sand blocks up in the sky nearby:
ro: Sa facem sa ploua putin inainte sa se dezlantuie furtuna cu toata forta. Vezi care este pozitia curenta si folosteste-o ca sa creezi cateva blocuri de nisip sus pe cer, in apropiere:

en: When you hit Run, you might have to look around a little as the blocks may start falling down behind you depending on which direction you're currently facing. Don't worry, if you missed them just hit Run again for another batch of sand rain - just make sure you're looking the right way!
ro: Cand apesi pe Run va trebui sa te uiti putin in jurul tau deoarece blocurile ar putea incepe sa cada in spatele tau, in functie de directia in care te uitai. Nu te ingrijora daca le-ai ratat, apasa Run din nou pentru inca un lot de ploaie de nisip - doar asigura-te ca te uiti in directia potrivita!

en: Let's quickly review what's going on here. On the first line we grabbed Steve's location as coordinates with the fn `mc_location` and placed them into the vars `x`, `y`, and `z`. Then on the next lines we used the `mc_set_block` fn to place some sand at the same coordinates as Steve but with some modifications. We chose the same x coordinate, a y coordinate 20 blocks higher and then successively larger z coordinates so the sand dropped in a line away from Steve.
ro: Sa trecem rapid in revista ce se intampla aici. Pe prima linia am citit pozitia lui Steve sub forma de coordonate, folosind functia 'mc_location', si le-am pus in variabilele 'x', 'y' si 'z'. Apoi, pe liniile urmatoare am folosit 'mc_set_block' pentru a crea niste blocuri de nisip la aceleasi coordonate cu ale lui Steve, dar cu niste modificari. Alegem aceeasi valoare pentru x, o valoare pentru y mai mare cu 20 (adica mai sus) si apoi valori care cresc succesiv pentru z astfel incat nisipul sa cada pe o linie care se indeparteaza de Steve.

en: Why don't you take that code and start playing around with it yourself? Try adding more lines, changing the sleep times, try mixing `:sand` with `:gravel` and choose different coordinates. Just experiment and have fun!
ro: Ce-ar fi sa te joci putin modificand codul? Incearca sa adaugi mai multe linii, sa schimbi valoarea pentru 'sleep', sa amesteci ':sand' cu ':gravel' si sa alegi coordonate diferite. Experimenteaza si distreaza-te!

en: Live Loops Unleashed
ro: Puterea buclelor live

en: OK, it's time to get the storm raging by unleashing the full power of the `live_loop` - Sonic Pi's magical ability which unleashes the full power of live coding - changing code on-the-fly whilst it's running!
ro: OK, e timpul sa pornim furtuna folosind forta 'live_loop' - bagheta magica a Sonic Pi care permite folosirea la maxim a puterii programarii live prin modificarea codului in timp ce ruleaza!

en: What fun! We're looping round pretty quickly (8 times a second) and during each loop we're finding Steve's location like before but then generating 3 random values:
ro: Ce distractiv! Parcurgem bucla rapid (de 8 ori pe secunda) si la fiecare trecere citim pozitia lui Steve la fel ca mai inainte, iar apoi generam 3 valori aleatoare:

en: `xd` - the difference for x which will be between -10 and 10
ro: 'xd' - diferenta pe axa x care va fi intre -10 si 10

en: `zd` - the difference for z also between -10 and 10
ro: 'zd' - diferenta pe axa z, de asemenea intre -10 si 10

en: `co` - a cutoff value for the low pass filter between 70 and 130
ro: 'co' - valoarea de cutoff pentru filtrul trece jos, intre 70 si 130

en: We then use those random values in the fns `synth` and `mc_set_block` giving us sand falling in random locations around Steve along with a percussive rain-like sound from the `:cnoise` synth.
ro: Folosim apoi aceste valori in functiile 'synth' si 'mc_set_block' obtinand nisipul care cade in pozitii aleatoare in jurul lui Steve impreuna cu un sunet asemanator cu cel al ploii generat de sintetizatorul ':cnoise'.

en: For those of you new to live loops - this is where the fun really starts with Sonic Pi. Whilst the code is running and the sand is pouring down, try changing one of the values, perhaps the sleep time to `0.25` or the `:sand` block type to `:gravel`. Now hit run *again*. Hey Presto! Things changed without the code stopping. This is your gateway to performing like a real VJ. Keep practising and changing things around. How different can you make the visuals without stopping the code?
ro: Daca nu stii inca ce sunt buclele live - ele sunt cele care dau tot farmecul cand folosim Sonic Pi. In timp ce codul ruleaza si nisipul cade, incearca sa schimbi una dintre valori, de exemplu valoare pentru pauza la '0.25' sau tipul blocurilor din ':sand' in ':gravel'. Acum apasa run *din nou*. Super! Lucrurile s-au schimbat fara a opri programul. Asta este modalitatea prin care poti sa te manifesti ca un VJ adevarat. Continua sa exersezi si sa schimbi parametrii. Cat de mult poti schimba efectele vizuale fara a opri executia?

en: Epic Block Patterns
ro: Modele de blocuri spectaculoase

en: Finally, another great way of generating interesting visuals is to generate huge patterned walls to fly towards and close by. For this effect we'll need to move from placing the blocks randomly to placing them in an ordered manner. We can do this by nesting two sets of iteration (hit the Help button and navigate to section 5.2 of the tutorial "Iteration and Loops" for more background on iteration). The funny `|xd|` after the do means that `xd` will be set for each value of the iteration. So the first time it will be 0, then 1, then 2... etc. By nesting two lots of iteration together like this we can generate all the coordinates for a square. We can then randomly choose block types from a ring of blocks for an interesting effect:
ro: O alta metoda de a genera imagini interesante este sa generezi pereti imensi cu model care se deplaseaza. Pentru acest efect trebuie sa trecem de la plasarea de blocuri aleator la plasarea lor intr-o ordine prestabilita. Putem face asta creand o iteratie in iteratie (apasa pe butonul Help si mergi la sectiunea 5.2 a tutorialului, "Iteratii si bucle" pentru mai multe informatii despre iteratii). Simpaticul '|xd|' de dupa do inseamna ca 'xd' va fi setat pentru fiecare valoare a iteratiei. Deci prima fata va fi 0, apoi 1, apoi 2 ... etc. Introducand o iteratie intr-o alta ca aici putem genera toate coordonatele dintr-un patrat. Putem apoi alege aleator tipurile de blocuri dintr-o lista circulara pentru un efect interesant:

en: Pretty neat. Whilst we're having fun here, try changing `bs.choose` to `bs.tick` to move from a random pattern to a more regular one. Try changing the block types and the more adventurous of you might want to try sticking this within a `live_loop` so that the patterns keep changing automatically.
ro: Simplu dar elegant. Cat ne distram aici, incearca sa schimbi  `bs.choose` in `bs.tick` pentru a trece de la un model aleator la unul mai regulat. Incearca sa schimbi tipurile blocurilor si daca esti mai indraznet ai putea pune asta intr-un 'live_loop' astfel incat modelul sa se schimbe automat.

en: Now, for the VJ finale - change the two `10.times` to `100.times` and hit Run. Kaboom! A Huge gigantic wall of randomly placed bricks. Imagine how long it would take you to build that manually with your mouse! Double-tap space to enter fly-mode and start swooping by for some great visual effects. Don't stop here though - use your imagination to conjure up some cool ideas and then use the coding power of Sonic Pi to make it real. When you've practised enough dim the lights and put on a VJ show for your friends!
ro: Acum, pentru trucul tau special de VJ, schimba cele 2 `10.times` in `100.times` si apasa Run. Kaboom! Un perete gigant de caramizi plasate aleator. Imagineaza-ti cat timp ti-ar lua sa il construiesti manual cu mouse-ul! Apasa de doua ori rapid pe spatiu pentru a activa modul de zbor si incepe sa te plimbi pentru ca efectul vizual sa fie si mai interesant. Nu te opri aici, foloseste-ti imaginatia si incearca sa iti aplici ideile folosind puterea programarii in Sonic Pi. Cand consideri ca ai exersat suficient, redu lumina si pune in scena un show pentru prietenii tai!

en: A.9 Randomisation
ro: A.9 Randomizarea

en: Surfing Random Streams
ro: Navigand pe curenti aleatori

en: Back in episode 4 of this tutorial series we took a brief look at randomisation whilst coding up some sizzling synth riffs. Given that randomisation is such an important part of my live coding DJ sets I thought it would be useful to cover the fundamentals in much greater detail. So, get your lucky hat on and let's surf some random streams!
ro: In episodul 4 al acestui serial de tutoriale am aruncat o privire asupra randomizarii in timp ce am programat cateva riff-uri incitante. Tinand cont ca randomizarea este o parte atat de importanta a interpretarilor mele live, m-am gandit ca ar fi util sa vorbim mai in detaliu despre elementele ei de baza. Deci, ia-ti amuleta norocoasa si sa navigam pe curenti aleatori!

en: There is no random
ro: Nu exista aleator

en: The first thing to learn which might really surprise you when playing with Sonic Pi's randomisation functions is that they're not actually really random. What does this actually mean? Well, let's try a couple of tests. First, imagine a number in your head between 0 and 1. Keep it there and don't tell me. Now let me guess... was it `0.321567`? No? Bah, I'm clearly no good at this. Let me have another go, but let's ask Sonic Pi to choose a number this time. Fire up Sonic Pi v2.7+ and ask it for a random number but again don't tell me:
ro: Primul lucru pe care trebuie sa-l inveti si care s-ar putea sa ti se para surprinzator cand te joci cu functiile de randomizare este ca de fapt nu sunt chiar aleatoare. Ce inseamna asta? Ei bine, sa facem niste teste. Mai intai, gandeste-te la un numar intre 0 si 1. Tine-l minte fara sa mi-l spui. Acum, sa incerc sa-l ghicesc... era '0.321567'? Nu? Bleah, e evident ca nu-s bun la jocul asta. Hai sa mai incerc o data, dar sa lasam Sonic Pi sa aleaga numarul de data asta. Porneste Sonic Pi v2.7+ si cere-i un numar aleator, din nou fara sa mi-l spui mie:

en: Now for the reveal... was it `0.75006103515625`? Yes! Ha, I can see you're a little sceptical. Perhaps it was just a lucky guess. Let's try again. Press the Run button again and see what we get... What? `0.75006103515625` again? This clearly can't be random! You're right, it's not.
ro: Acum sa vedem... era `0.75006103515625`? Da! Ha, ha, vad ca esti putin neincrezator. Poate a fost doar chestie de noroc. Hai sa incercam din nou. Apasa butonul Run si vezi ce primesti... Ce? Din nou `0.75006103515625`? E clar ca nu este aleator! Ai dreptate, nu este.

en: What's going on here? The fancy computer science word here is determinism. This just means that nothing is by chance and everything is destined to be. Your version of Sonic Pi is destined to always return `0.75006103515625` in the program above. This might sound pretty useless, but let me assure you that it's one of the most powerful parts of Sonic Pi. If you stick at it you'll learn how to rely on the deterministic nature of Sonic Pi's randomisation as a fundamental building block for your compositions and live coded DJ sets.
ro: Ce se intampla aici? Cuvantul elevat folosit in lumea calculatoarelor pentru asta este determinism. Asta inseamna ca nimic nu este la intamplare ci totul este bazat pe predestinare. Versiunea ta de Sonic Pi este predestinata sa returneze mereu `0.75006103515625` in programul de mai sus. Asta pare sa fie o chestie inutila, dar crede-ma ca este una dintre partile cele mai tari din Sonic Pi. Daca te tii de ea vei invata cum sa te bazezi pe natura determinista a randomizarii in Sonic Pi ca bloc de baza pentru constructia compozitiilor tale sau a interpretarii live ca DJ.

en: A Random Melody
ro: O melodie aleatoare

en: When Sonic Pi boots it actually loads into memory a sequence of 441,000 pre-generated random values. When you call a random function such as `rand` or `rrand`, this random stream is used to generate your result. Each call to a random function consumes a value from this stream. Therefore the 10th call to a random function will use the 10th value from the stream. Also, every time you press the Run button, the stream is reset for that run. This is why I could predict the result to `rand` and why the 'random' melody was the same every time. Everybody's version of Sonic Pi uses the exact same random stream which is very important when we start sharing our pieces with each other.
ro: Cand Sonic Pi porneste, incarca in memorie o secventa de 441 000 valori aleatoare pre-calculate. Cand apelezi o functie pentru numere aleatoare, cum ar fi 'rand' sau 'rrand', acest sir aleator este folosit pentru a genera rezultatul asteptat. Fiecare apel al unei functii pentru numere aleatoare consuma o valoare din sir. Deci al zecelea apel al unei functii pentru numere aleatoare va folosi a zecea valoare din sir. De asemenea, de fiecare data cand apesi pe butonul Run, sirul este resteat pentru acea executie. Acesta este motivul pentru care am reusit sa prezic rezultatul functiei 'rand', iar melodia 'random' a sunat mereu la fel. Versiunea Sonic Pi a fiecaruia dintre voi foloseste exact acelasi sir de valori aleatoare, ceea ce este foarte important cand impartasesti creatiile tale cu altii.

en: Let's use this knowledge to generate a repeatable random melody:
ro: Sa ne folosim de ce am aflat ca sa generam o melodie aleatoare repetabila:

en: Type this into a spare buffer and hit Run. You'll hear a melody consisting of 'random' notes between 50 and 95. When it's finished, hit Run again to hear exactly the same melody again.
ro: Copiaza codul asta intr-un buffer gol si apasa Run. Vei auzi o melodie constand in note 'aleatoare' intre 50 si 95. Cand se termina, apasa din nou pe Run ca sa auzi exact aceeasi melodie din nou.

en: Handy Randomisation Functions
ro: Functii utile pentru randomizare

en: Sonic Pi comes with a number of useful functions for working with the random stream. Here's a list of some of the most useful:
ro: Sonic Pi contine o serie de functii utile pentru a lucra cu sirul aleator. Iata o lista cu cateva dintre cele mai folositoare:

en: `rand` - Simply returns the next value in the random stream
ro: 'rand' - returneaza urmatoarea valoare din sirul aleator

en: `rrand` - Returns a random value within a range
ro: 'rrand' - returneaza o valoare aleatoare intr-un interval

en: `rrand_i` - Returns a random whole number within a range
ro: 'rrand_i' - returneaza un numar intreg intr-un interval

en: `one_in` - Returns true or false with the given probability
ro: 'one_in' - returneaza 'true' sau 'false' cu o probabilitate specificata

en: `dice` - Imitates rolling a dice and returns a value between 1 and 6
ro: 'dice' - imita datul cu zarul si returneaza o valoare intre 1 si 6

en: `choose` - Chooses a random value from a list
ro: 'choose' - alege o valoare aleatoare dintr-o lista

en: Check out their documentation in the Help system for detailed information and examples.
ro: Verifica documentatia pentru aceste functii in sistemul de ajutor pentru informatii detaliate si exemple.

en: Resetting the Stream
ro: Resetarea sirului aleator

en: Whilst the ability to repeat a sequence of chosen notes is essential to allow you to replay a riff on the dance floor, it might not be exactly the riff you want. Wouldn't it be great if we could try a number of different riffs and choose the one we liked best? This is where the real magic starts.
ro: Chiar daca abilitatea de a repeta o secventa de note este esentiala pentru a-ti permite sa redai din nou un riff pe ringul de dans, s-ar putea sa nu fie exact riff-ul pe care ti l-ai dorit. N-ar fi interesant daca am putea incerca mai multe riff-uri si sa-l alegem pe cel care a sunat cel mai bine? Aici incepe magia.

en: We can manually set the stream with the fn `use_random_seed`. In Computer Science, a random seed is the starting point from which a new stream of random values can sprout out and blossom. Let's try it:
ro: Putem seta manual sirul folosind functia 'use_random_seed'. In lumea computerelor, seed este valoarea de initializare a sirului aleator sau punctul de pornire din care poate porni un nou sir de valori aleatoare. Sa incercam:

en: Great, we get the first three notes of our random melody above: `84`, `83` and `71`. However, we can now change the seed to something else. How about this:
ro: Super, avem primele trei note ale melodiei noastre aleatoare de mai sus: '84', '83' si '71'. Am putea insa schimba seed-ul cu altceva. Sa incercam asta:

en: Interesting, we get `83`, `71` and `61` . You might notice that the first two numbers here are the same as the last two numbers before - this isn't a coincidence.
ro: Interesant, am obtinut '83', '71' si '61'. Probabil ai observat ca primele doua numere sunt aceleasi ca ultimele doua numere de data trecuta - nu este o coincidenta.

en: Remember that the random stream is just a giant list of 'pre-rolled' values. Using a random seed simply jumps us to a point in that list. Another way of thinking about it is to imagine a huge deck of pre-shuffled cards. Using a random seed is cutting the deck at a particular point. The fabulous part of this is that it's precisely this ability to jump around the random stream which gives us huge power when making music.
ro: Iti aduci aminte ca sirul aleator este doar o lista gigantica de valori 'pre-generate'. Folosirea unui seed inseamna pur si simplu pozitionarea in aceasta lista. Un alt mod de a vedea acest lucru este sa iti imaginezi un pachet enorm de carti amestecate. Folosirea unui seed este la fel cu a taia pachetul de carti intr-o anumita pozitie. Partea cea mai frumoasa este ca tocmai aceasta abilitate de a te pozitiona precis in sirul aletor ne da o mare putere cand cream muzica.

en: Let's revisit our random melody of 8 notes with this new stream resetting power, but let's also throw in a live loop so we can experiment live whilst it's playing:
ro: Sa revenim la melodia noastra aleatoare din 8 note inarmati cu aceasta abilitate de a reseta sirul aleator, dar hai sa adaugam si o bucla live ca sa putem experimenta in timp ce canta muzica:

en: Now, whilst it's still playing, change the seed value from `0` to something else. Try `100`, what about `999`. Try your own values, experiment and play around - see which seed generates the riff you like best.
ro: Acum, in timp ce canta, schimba valoarea pentru seed din '0' in altceva. Incearca '100', sau '999'. Incearca propriile valori, experimenteaza si joaca-te. Vezi ce seed genereaza riff-ul care iti place cel mai mult.

en: This month's tutorial has been quite a technical dive into the workings of Sonic Pi's randomisation functionality. Hopefully it has given you some insight into how it works and how you can start using randomisation in a reliable way to create repeatable patterns within your music. It's important to stress that you can use repeatable randomisation *anywhere* you want. For example, you can randomise the amplitude of notes, the timing of the rhythm, the amount of reverb, the current synth, the mix of an FX, etc. etc. In the future we'll take a close look at some of these applications, but for now let me leave you with a short example.
ro: Tutorialul de luna asta a fost o incursiune tehnica in modul de functionare a randomizarii in Sonic Pi. Sper ca ti-ai putut crea o idee despre cum functioneaza si cum te poti folosi de randomizare intr-un mod fiabil pentru a crea secvente repetabile in muzica ta. E important sa evidentiem ca poti folosi randomizarea repetabile *oriunde* doresti. De exemplu, poti randomiza amplitudinea notelor, tempoul pentru ritm, valoarea pentru reverb, sintetizatorul curent, mixul pentru un efect, etc etc. Intr-un episod viitor vom privi mai indeaproape cateva dintre aceste utilizari, dar deocamdata iti voi prezenta un scurt exemplu.

en: Type the following into a spare buffer, hit Run, and then start changing the seeds around, hit Run again (whilst it's still playing) and explore the different sounds, rhythms and melodies you can make. When you find a nice one, remember the seed number so you can get back to it. Finally, when you've found a few seeds you like, put on a live coded performance for your friends by simply switching between your favourite seeds to create a full piece.
ro: Scrie codul de mai jos intr-un buffer gol, apasa Run, apoi incepe si schimba seed-ul, apasa din nou Run (cat timp inca ruleaza) si incearca diferitele sunete, ritmuri si melodii pe care le poti obtine. Cand gasesti ceva dragut, tine minte seed-ul pentru a putea reveni la el. Dupa ce ai gasit mai multe seed-uri care iti plac, poti sa realizezi o interpretare live pentru prietenii tai schimband intre diferitele valori pentru a crea o piesa completa.

en: A.10 Control
ro: A.10 Controlul

en: Controlling Your Sound
ro: Controlul sunetului

en: So far during this series we've focussed on triggering sounds. We've discovered that we can trigger the many synths built into Sonic Pi with `play` or `synth` and how to trigger pre-recorded samples with `sample`. We've also looked at how we can wrap these triggered sounds within studio FX such as reverb and distortion using the `with_fx` command. Combine this with Sonic Pi's incredibly accurate timing system and you can produce a vast array of sounds, beats and riffs. However, once you've carefully selected a particular sound's options and triggered it, there's no ability to mess with it whilst it's playing right? Wrong! Today you're going to learn something very powerful - how to control running synths.
ro: Pana acum in aceasta serie de tutoriale ne-am concentrat pe pornirea sunetelor. Am descoperit ca putem porni un sintetizator din multele incluse in Sonic Pi folosind 'play' sau 'synth' sau un esantion pre-inregistrat folosind 'smple'. De asemenea am vazut cum putem trece aceste sunete prin efecte de studio ca reverb sau distorsion folosind comanda 'with_fx'. Combina toate aceste cu sistemul foarte precis de pozitionare in timp al Sonic Pi si poti produce o gama vasta de sunete, beat-uri si riff-uri. Dar dupa ce ai selectat cu grija optiunile pentru un anumit sunet si l-ai pornit, nu mai exista nicio posibilitate sa il modifici, nu? Gresit! Astazi vei descoperi o functionalitate foarte puternica - controlul sintetizatorului in timpul redarii.

en: A Basic Sound
ro: A Sunetul de baza

en: Let's create a nice simple sound. Fire up Sonic Pi and in a fresh buffer type the following:
ro: Sa cream un sunet simplu si dragut. Porneste Sonic Pi si scrie asta intr-un buffer gol:

en: Now press the Run button at the top left to hear a lovely rumbling synth sound. Go ahead, press it again a few times to get a feel for it. OK, done? Let's start controlling it!
ro: Acum apasa butonul Run din stanga sus ca sa auzi un sunet dragut de sintetizator. Continua, mai apasa de cateva ori butonul ca sa incepi sa il simti. Gata? Sa incepem sa-l controlam!

en: Synth Nodes
ro: SynthNode

en: A little known feature in Sonic Pi is that the fns `play`, `synth` and `sample`, return something called a `SynthNode` which represents a running sound. You can capture one of these `SynthNode`s using a standard variable and then **control** it at a later point in time. For example, let's change the value of the `cutoff:` opt after 1 beat:
ro: O caracteristica putin cunoscuta a Sonic Pi este aceea ca functiile 'play', 'synth' si 'sample' returneaza ceea ce se numeste un 'SynthNode' care reprezinta un sunet in curs de redare. Poti memora un astfel de 'SynthNode' intr-o variabila si apoi sa il **controlezi** mai tarziu. De exemplu, sa schimbam valoarea pentru parametrul 'cutoff:' dupa o masura:

en: Let's look at each line in turn:
ro: Sa privim fiecare linie pe rand:

en: Firstly we trigger the `:prophet` synth using the `synth` fn as normal. However we also capture the result in a variable called `sn`. We could have called this variable something completely different such as `synth_node` or `jane` - the name doesn't matter. However, it's important to choose a name that's meaningful to you for your performances and for people reading your code. I chose `sn` as it's a nice short mnemonic for synth node.
ro: Mai intai lansam sintetizatorul ':propher' folosind functia 'synth' ca de obicei. Dar in acelasi timp memoram si rezultatul intr-o variabila numita 'sn'. Puteam sa-i dam orice alt nume variabilie, cum ar fi 'synth_node' sau 'jane' - numele nu conteaza. Totusi, este important sa alegi un nume care iti spune ceva pentru cand interpretezi live se pentru alte persoane care ar putea citi codul tau. E am ales 'sn' pentru ca este o prescurtare draguta pentru SynthNode.

en: On line 2 we have a standard `sleep` command. This does nothing special - it just asks the computer to wait for 1 beat before moving onto the next line.
ro: Pe linia a doua avem o comanda 'sleep' obisnuita. Nu face nimic special, doar ii cere computerului sa astepte o masura inainte sa treaca la linia urmatoare.

en: Line 3 is where the control fun starts. Here, we use the `control` fn to tell our running `SynthNode` to change the cutoff value to `130`. If you hit the **Run** button, you'll hear the `:prophet` synth start playing as before, but after 1 beat it will shift to sound a lot brighter.
ro: Linia 3 este cea in care se intampla totul. Aici am folosit functia 'control' pentru a spune sintetizatorului sa schimbe valoarea de cutoff in '130' in timp ce ruleaza. Daca apesi butonul **Run**, vei auzi cum sintetizatorul ':prophet' incepe sa cante ca mai inainte, dar dupa o masura va incepe sa sune mult mai clar.

en: Modulatable Options
ro: Parametri modulabili

en: Most of Sonic Pi's synths and FX opts may be changed after being triggered. However, this isn't the case for all of them. For example, the envelope opts `attack:`, `decay:`, `sustain:` and `release:` can only be set when triggering the synth. Figuring out which opts can and can't be changed is simple - just head to the documentation for a given synth or FX and then scroll down to the individual option documentation and look for the phrases "May be changed whilst playing" or "Can not be changed once set". For example, the documentation for the `:beep` synth's `attack:` opt makes it clear that it's not possible to change it:
ro: Multi dintre parametrii pentru sintetizatoarele si efectele din Sonic Pi pot fi schimbati dupa ce au fost pornite. Nu este insa cazul pentru toate. De exemplu, parametrii anvelopei `attack:`, `decay:`, `sustain:` si `release:` pot fi specificati doar cand se porneste sintetizatorul. E destul de usor sa afli care parametri pot si care nu pot fi schimbati - mergi la documentatia unui anumit sintetizator sau efect si deruleaza in jos pana la informatiile despre parametrii individuali si cauta fraza "Poate fi schimbat in timpul rularii", respectiv "Nu mai poate fi schimbat odata setat". De exemplu, documentatia pentru parametrul 'attack:' al sintetizatorului ':beep' spune clar ca nu este posibil sa il schimbi:

en: Default: 0
ro: Implicit: 0

en: Must be zero or greater
ro: Trebuie sa fie zero sau mai mare

en: Can not be changed once set
ro: Nu poate fi schimbat odata setat

en: Scaled with current BPM value
ro: Modificat proportional cu viteza BPM

en: Multiple Changes
ro: Schimbari multiple

en: Whilst a synth is running you're not limited to changing it only once - you're free to change it as many times as you like. For example, we can turn our `:prophet` into a mini arpeggiator with the following:
ro: In timp ce un sintetizator ruleaza poti sa il schimbi de cate ori vrei. De exemplu, putem transforma sintetizatorul ':prophet' intr-un generator de arpegii folosind:

en: In this snippet of code we just added a couple of extra things. First we defined a new variable called `notes` which contains the notes we'd like to cycle through (an arpeggiator is just a fancy name for something that cycles through a list of notes in order). Secondly we replaced our single call to `control` with an iteration calling it 16 times. In each call to `control` we `.tick` through our ring of `notes` which will automatically repeat once we get to the end (thanks to the fabulous power of Sonic Pi's rings). For a bit of variety try replacing `.tick` with `.choose` and see if you can hear the difference.
ro: In aceasta bucata de cod am adaugat cateva chestii in plus. Am definit o noua variabila, numita 'notes', care contine notele pe care vrem sa le reda in mod repetat (un generator de arpegii chiar asta inseamna - ceva ce reda notele dintr-o lista circulara in ordine). Apoi am inlocuit apelul individual al functiei 'control' cu o iteratie care o apeleaza de 16 ori. La fiecare apel al functiei folosim '.tick' pentru a parcurge lista 'notes' care se va repeta automat cand ajungem la sfarsit (gratie minunatelor liste circulare din Sonic Pi). Pentru putina varietate incearca sa inlocuiesti '.tick' cu '.choos' si vezi daca remarci diferenta.

en: Note that we can change multiple opts simultaneously. Try changing the control line to the following and listen for the difference:
ro: Ai observat ca putem schimba mai multi parametri simultan. Incearca sa schimbi linia in care apare functia control cu aceasta si asculta diferentele:

en: When we control a `SynthNode`, it responds exactly on time and instantly changes the value of the opt to the new one as if you'd pressed a button or flicked a switch requesting the change. This can sound rhythmical and percussive - especially if the opt controls an aspect of the timbre such as `cutoff:`. However, sometimes you don't want the change to happen instantaneously. Instead, you might want to smoothly move from the current value to the new one as if you'd moved a slider or dial. Of course, Sonic Pi can also do this too using the `_slide:` opts.
ro: Cand controlam un 'SynthNode', el raspunde imediat si schimba instantaneu valoarea parametrului cu cea noua ca si cand ai fi apasat un buton sau ai fi intors de un comutator pentru a cere modificarea. Asta genereaza un sunet ritmic si percutant - mai ales daca parametrul controleaza ceva legat de timbru, cum ar fi 'cutoff:'. Totusi, uneoi nu vrei ca schimbarea sa se produca instantaneu. In schimb, ti-ai dori o trecere lina de la valoarea curenta la noua valoare ca si cand ai fi miscat un cursor. Desigur, Sonic Pi poate face si acest lucru, folosind parametrii '_slide'.

en: Each opt that can be modified also has a special corresponding `_slide:` opt that allows you to specify a slide time. For example, `amp:` has `amp_slide:` and `cutoff:` has `cutoff_slide:`. These slide opts work slightly differently than all the other opts in that they tell the synth note how to behave **next time they are controlled**. Let's take a look:
ro: Fiecare parametru care poate fi modificat are asociat si un parametru '_slide:' care permite specificarea timpului in care se face modificarea graduala. De exemplu, pentru 'amp:' avem `amp_slide:`, iar pentru `cutoff:` avem `cutoff_slide:`. Acesti parametri functioneaza putin diferit de ceilalti prin aceea ca spun sintetizatorului cum sa actioneze **data viitoare cand primesc o comanda de control**. Sa aruncam o privire:

en: Notice how this example is exactly the same as before except with the addition of `cutoff_slide:`. This is saying that next time this synth has its `cutoff:` opt controlled, it will take 2 beats to slide from the current value to the new one. Therefore, when we use `control` you can hear the cutoff slide from 70 to 130. It creates an interesting dynamic feel to the sound. Now, try changing the `cutoff_slide:` time to a shorter value such as 0.5 or a longer value such as 4 to see how it changes the sound. Remember, you can slide any of the modifiable opts in exactly this way and each `_slide:` value can be totally different so you can have the cutoff sliding slowly, the amp sliding fast and the pan sliding somewhere in between if that's what you're looking to create...
ro: Observi ca exemplul este la fel cu cel dinainte cu exceptia faptului ca am adaugat `cutoff_slide:`. Aceasta face ca data viitoare cand i se cere sintetizatorului sa schimbe valoarea de cutoff, el sa faca trecea de la valoarea veche la cea noua gradual, pe durata a 2 masuri. Ca urmare, cand vei folosi 'control' vei auzi cum 'cutoff' trece lin de la 70 la 130, ceea ce da sunetului un aer dinamic. Acum incearca sa schimbi valoarea pentru 'cutoff_slide' cu una mai mica, cum ar fi 0.5 sau o valoare mai mare, cum ar fi 4, pentru a observa cum se modifica sunetul. Tine minte, in acelasi mod poti face sa varieze treptat orice parametru modificabil, iar fiecare valoare '_slide:' poate fi complet diferita astfel. De exemplu cutoff poate sa se schimbe lent, amplitudinea mai rapid, iar pozitionarea cu o viteza intre cele doua, daca asta iti doresti...

en: Let's look at a short example which demonstrates the power of controlling synths after they've been triggered. Notice that you can also slide FX just like synths although with a slightly different syntax. Check out section 7.2 of the built-in tutorial for more information on controlling FX.
ro: Sa analizam putin un scurt exemplu care ne arata puterea controlarii sintetizatoarelor dupa ce au fost pornite. Observi ca pot fi modificate treptat si efectele la fel ca sintetizatoarele, dar cu o sintaxa putin diferita. Citeste sectiunea 7.2 a tutorialului pentru mai multe informatii despre controlul efectelor.

en: Copy the code into a spare buffer and take a listen. Don't stop there though - play around with the code. Change the slide times, change the notes, the synth, the FX and the sleep times and see if you can turn it into something completely different!
ro: Copiaza codul intr-un buffer gol si asculta. Nu te opri aici, joca-te putin cu codul. Schimba valorile pentru '_slide:', schimba notele, sintetizatorul, efectele si duratele pentru pauze si vezi cum poti sa schimbi sunetul in ceva cu totul diferit!

en: A.11 Tick Tock
ro: A.11 Tic Tac

en: Tracking the Beat
ro: Urmarirea ritmului

en: Last month in this series we took a deep technical dive into the randomisation system underpinning Sonic Pi. We explored how we can use it to deterministically add new levels of dynamic control over our code. This month we're going to continue our technical dive and turn our attention to Sonic Pi's unique tick system. By the end of this article you'll be ticking your way through rhythms and riffs on your way to being a live coding DJ.
ro: In episodul de luna trecuta am facut o incursiune tehnica in sistemul de randomizare din Sonic Pi. Am explorat cum il putem folosi pentru a adauga un nou nivel de control dinamic in codul nostru intr-un mod determinist. Luna asta vom continua sa studiem detaliile tehnice si ne vom indrepta atentia asupra sistemului de tact unic in Sonic Pi. La sfarsitul acestui articol vei putea sa urmaresti comanzi ritmurile si riff-urile si vei fi cu un pas mai aproape sa devii un DJ care programeaza live.

en: Beat Counting
ro: Numararea masurilor

en: When making music we often want to do a different thing depending on which beat it is. Sonic Pi has a special beat counting system called `tick` to give you precise control over when a beat actually occurs and even supports multiple beats with their own tempos.
ro: Cand facem muzica ne dorim adesea sa facem lucruri diferite in functie de masura la care am ajuns. Sonic Pi are un sistem special de contorizare a masurilor, numit 'tick', care iti ofera un control precis asupra momentului in care incepe masura si suporta chiar mai multe tempo-uri in paralel.

en: Let's have a play - to advance the beat we just need to call `tick`. Open up a fresh buffer, type in the following and hit Run:
ro: Sa ne jucam putin, pentru a trece la masura urmatoare trebuie doar sa apelezi '.tick'. Deschide un buffer nou si scrie codul de mai jos apoi apasa Run:

en: This will return the current beat: `0`. Notice that even if you press the Run button a few times it will always return `0`. This is because each run starts a fresh beat counting from 0. However, whilst the run is still active, we can advance the beat as many times as we want:
ro: Va fi afisata masura curenta: '0'. Poti observa ca daca apesi pe Run de mai multe ori, de fiecare data va returna '0'. Asta se intampla deoarece la fiecare Run numaratoarea masurilor incepe de la 0. In timpul rularii insa, putem avansa la urmatoarea masura de cate ori vrem:

en: Whenever you see the symbol `#=>` at the end of a line of code it means that that line will log the text on the right-hand-side. For example, `puts foo #=> 0` means the code `puts foo` prints `0` to the log at that point in the program.
ro: De cate ori observi simbolul '#=>' la sfarsitul unei linii de cod, inseamna ca linia va determina scrierea in jurnal a partii care urmeaza. De exemplu, 'puts foo#=> 0' inseamna ca instructiunea 'puts foo' scrie '0' in jurnal la acel punct din program.

en: Checking the Beat
ro: Schimbarea masurii

en: We've seen that `tick` does two things. It increments (adds one) and returns the current beat. Sometimes we just want to look at the current beat without having to increment it which we can do via `look`:
ro: Am vazut ca 'tick' face doua lucruri. Incrementeaza (creste cu 1) valoarea masurii curente si returneaza noua valoare. Uneori vrem doar sa vedem valoarea curenta, fara sa trecem la masura urmatoare, ceea ce poate fi realizat cu ajutorul 'look':

en: In this code we tick the beat up twice and then call `look` twice. We'll see the following values in the log: `0`, `1`, `1`, `1`. The first two `tick`s returned `0`, then `1` as expected, then the two `look`s just returned the last beat value twice which was `1`.
ro: In acest cod generam un tact de 2 ori si afisam valoarea cu '.tick', apoi doar analizam valoarea de 2 ori cu '.look'. Vom vedea urmatoarele valori: `0`, `1`, `1`, `1`. Primele 2 utilizari ale functiei 'tick' returneaza '0' si apoi '1', cum era de astepta, apoi cele 2 functii 'look' returneaza ultima valoare care este '1'.

en: So now we can advance the beat with `tick` and check the beat with `look`. What next? We need something to tick over. Sonic Pi uses rings for representing riffs, melodies and rhythms and the tick system has been specifically designed to work very closely with them. In fact, rings have their own dot version of `tick` which does two things. Firstly, it acts like a regular tick and increments the beat. Secondly it looks up the ring value using the beat as the index. Let's take a look:
ro: Deci acum putem trece la masura urmatoare folosind 'tick' si sa vedem unde am ajuns folosind 'look'. Ce urmeaza? Trebuie sa avem ceva ce poate fi parcurs pas cu pas. Sonic Pi foloseste liste circulare pentru a reprezenta riff-uri, melodii si ritmuri, iar sistemul de tact a fost gandit special pentru a lucra strans cu acestea. De fapt, listele circulare au propriile versiuni de tip sufix pentru functia 'tick', care realizeaza doua lucruri. In primul rand actioneaza ca un tick obisnuit si trec la masura urmatoare, iar in al doilea rand parcurg listele circulare folosind numarul masurii ca index. Sa aruncam o privire:

en: `.tick` is a special dot version of `tick` which will return the first value of the ring `:a`. We can grab each of the values in the ring by calling `.tick` multiple times:
ro: '.tick' este o versiune speciala de tip sufix a functiei '.tick', care va returna prima valoare din lista ':a'. Putem obtine fiecare dintre valorile din lista apeland '.tick' de mai multe ori:

en: Take a look at the log and you'll see `:a`, `:b`, `:c` and then `:a` again. Notice that `look` returns `3`. Calls to `.tick` act just like they are regular calls to `tick` - they increment the local beat.
ro: Urmareste jurnalul si vei vedea `:a`, `:b`, `:c` si iarasi `:a`. Observi ca 'look' returneaza valoarea '3'. Apelurile '.tick' functioneaza la fel ca cele ale functiei 'tick' obisnuite' - incrementeaza numarul masurii curente.

en: A Live Loop Arpeggiator
ro: Creator de arpegii intr-o bucla live

en: The real power comes when you mix `tick` with rings and `live_loop`s. When combined we have all the tools we need to both build and understand a simple arpegiator. We need just four things:
ro: Adevarata distractie incepe cand combinam 'tick' cu listele circulare si cu buclele live. Cand punem aceste lucruri impreuna avem tot ce ne trebuie pentru a construi si a intelege un generatori simplu de arpegii. Avem nevoie de doar patru lucruri:

en: A ring containing the notes we want to loop over.
ro: O lista circulara care contine notele pe care vrem sa le repetam.

en: A means of incrementing and obtaining the beat.
ro: O modalitate de a incrementa si de a obtine numarul masurii curente.

en: The ability to play a note based on the current beat.
ro: Capacitatea de a reda o nota care depinde de masura curenta.

en: A loop structure to keep the arpegiator repeating.
ro: O structura de tip bucla care face ca generatorul sa repete arpegiile.

en: These concepts can all be found in the following code:
ro: Toate aceste concepte pot fi intalnite in codul urmator:

en: Let's look at each of these lines. First we define our ring of notes which we'll continually play. We then create a `live_loop` called `:arp` which loops round for us. Each time round the `live_loop` we set our synth to `:dpulse` and then play the next note in our ring using `.tick`. Remember that this will increment our beat counter and use the latest beat value as an index into our notes ring. Finally, we wait for an eighth of a beat before looping round again.
ro: Sa privim fiecare dintre aceste linii. Mai intai definim lista de note pe care le vom reda in continuu. Apoi cream o bucla live numita ':arp' care se ocupa de repetarea instructiunilor pentru noi. De fiecare data cand intram in bucla algem sintetizatorul ':dpulse' si apoi redam urmatoarea nota din lista cu ajutorul '.tick'. Tine minte ca acest lucru va duce la incrementarea numarului masurii curente si va folosi aceasta valoare ca index in lista cu notele. La final asteptam o optime de masura inainte de a relua bucla.

en: Multiple Simultaneous Beats
ro: Ritmuri multiple

en: A really important thing to know is that `tick`s are local to the `live_loop`. This means that each `live_loop` has its own independent beat counter. This is much more powerful than having a global metronome and beat. Let's take a look at this in action:
ro: Un lucru important de stiut este ca tactul este local pentru o bucla live. Asta inseamna ca fiecare 'live_loop' are propriul contor pentru masura. Acest lucru ne ofera mai multa flexibilitate decat un metronom global si un tempo global. Sa vedem cum functioneaza:

en: Clashing Beats
ro: Conflicte de numarare

en: A big cause of confusion with Sonic Pi's tick system is when people want to tick over multiple rings in the same `live_loop`:
ro: O sursa de confuzii si erori in utilizarea sistemului de tact din Sonic Pi este folosirea unui tick pentru mai multe liste in acelasi 'live_loop':

en: Even though each `live_loop` has its own independent beat counter, we're calling `.tick` twice within the same `live_loop`. This means that the beat will be incremented twice every time round. This can produce some interesting polyrhythms but is often not what you want. There are two solutions to this problem. One option is to manually call `tick` at the start of the `live_loop` and then use `.look` to look up the current beat in each `live_loop`. The second solution is to pass a unique name to each call to `.tick` such as `.tick(:foo)`. Sonic Pi will then create and track a separate beat counter for each named tick you use. That way you can work with as many beats as you need! See the section on named ticks in 9.4 of the built-in tutorial for more information.
ro: Fiecare 'live_loop' are propriul contor pentru masura, dar noi apelam '.tick' de doua ori in cadrul aceleiasi bucle. Asta inseamna ca numarul masurii curente va fi incrementat de doua ori la fiecare trecere. Uneori pot aparea sunete poliritmice interesante, dar nu asta ne dorim in general. Exista doua solutii pentru aceasta problema. O varianta ar fi sa apelam 'tick' la inceputul buclei live si apoi sa folosim 'look' pentru a vedea care este valoarea curenta. A doua ar fi sa transmitem un nume unic la fiecare dintre cele 2 apeluri ale functiei '.tick', cum ar fi '.tick(:foo)'. Sonic Pi va crea si va urmari un contor separat pentru fiecare nume pe care il folosesti. In felul asta poti lucra cu oricate tacturi ai nevoie. Vezi sectiunea 9.4 din tutorial pentru mai multe informatii despre folosirea de nume pentru tacturi.

en: Let's bring all this knowledge of `tick`s, `ring`s and `live_loop`s together for a final fun example. As usual, don't treat this as a finished piece. Start changing things and play around with it and see what you can turn it into. See you next time...
ro: Sa punem cap la cap cunostintele noastre despre tact, liste circulare si bucle live pentru un exemplu final. Ca de obicei, nu trebuie sa tratezi asta ca pe o bucata finisata. Poti schimba ce doresti ca sa vezi in ce o poti transforma. Ne vedem data viitoare...

en: A.12 Sample Slicing
ro: A.12 Slicing cu esantioane

en: Sample Slicing
ro: Slicing cu esantioane

en: Way back in episode 3 of this Sonic Pi series we looked at how to loop, stretch and filter one of the most famous drum breaks of all time - the Amen Break. In this tutorial we're going to take this one step further and learn how to slice it up, shuffle the slices and glue it back together in a completely new order. If that sounds a bit crazy to you, don't worry, it will all become clear and you'll soon master a powerful new tool for your live coded sets.
ro: In episodul 3 al acestei serii despre Sonic Pi am vazut cum putem reda in bucla, intinde sau comprima si filtra unul dintre cele mai faimoase solo-uri de toba din toate timpurile - Amen Break. In acest tutorial o sa mergem cu un pas mai departe si o sa vedem cum putem sa il maruntim (slice), sa amestecam bucatile si sa le combinam la loc in alta ordine. Daca ti se pare o chestie putin traznita, nu te ingrijora, lucrurile vor deveni mai clare in curand si vei stapani o noua unealta puternica pentru interpretarile live folosind Sonic Pi.

en: Sound as Data
ro: Sunetul ca date

en: Before we get started let's just take a brief moment to understand how to work with samples. By now, you've all hopefully played with Sonic Pi's powerful sampler. If not, there's no time like the present! Boot up your Raspberry Pi, launch Sonic Pi from the Programming menu, type the following into a fresh buffer and then hit the Run button to hear a pre-recorded drum beat:
ro: Inainte sa incepem, sa explicam putin cum functioneaza esantioanele. Pana acum sper ca te-ai jucat deja cu sampler-ul din Sonic Pi. Daca nu, nu exista un moment mai potrivit decat acesta! Porneste Raspberry Pi, lanseaza Sonic Pi din meniul Programming, scrie codul urmator intr-un buffer gol si apasa butonul Run pentru a auzi un beat de toba pre-inregistrat:

en: A recording of a sound is simply represented as data - lots of numbers between -1 and 1 which represent the peaks and troughs of the sound wave. If we play those numbers back in order, we get the original sound. However, what's to stop us from playing them back in a different order and creating a new sound?
ro: O inregistrare a unui sunet este reprezentata sub forma de date - o multime de numere intre -1 si 1 care reprezinta limitele undei sonore. Daca redam aceste numere in ordine, obtinem sunetul original. Dar ce ne opreste sa le redam intr-o alta ordine, pentru a crea alte sunete?

en: How are samples actually recorded? It's actually pretty simple once you understand the basic physics of sound. When you make a sound - for example by hitting a drum, the noise travels through the air in a similar fashion to how the surface of a lake ripples when you throw a pebble into it. When those ripples reach your ears, your eardrum moves sympathetically and converts those movements into the sound you hear. If we wish to record and play back the sound, we therefore need a way of capturing, storing and reproducing those ripples. One way is to use a microphone which acts like an eardrum and moves back and forth as the sound ripples hit it. The microphone then converts its position into a tiny electric signal which is then measured many times a second. These measurements are then represented as a series of numbers between -1 and 1.
ro: Cum sunt inregistrate de fapt esantioanele? O sa ti se para simplu dupa ce intelegi bazale fizicii sunetului. Cand produci un sunet, de exemplu lovind in toba, acesta se propaga prin aer la fel cum se increteste suprafata apei cand arunci o piatra in ea. Cand aceste unduiri ajung la urechea noastra, timpanul se misca in ritm cu ele si converteste aceste miscari in sunetul pe care il auzim. Daca dorim sa inregistram si sa redam sunetul, trebuie deci sa capturam, sa stocam si sa reproducem aceste unduiri. O metoda este sa folosim un microfon care actioneaza ca un timpan si se misca inainte si inapoi cand unda ajunge la el. Microfonul converteste apoi pozitia respectiva intr-un semnal electric care este masurat de multe ori intr-o secunda. Aceste masuratori sunt reprezentate sub forma unei serii de numere intre -1 si 1.

en: If we were to plot a visualisation of the sound it would be a simple graph of data with time on the x axis and microphone/speaker position as a value between -1 and 1 on the y axis. You can see an example of such a graph at the top of the diagram.
ro: Daca am incerca sa gasim o reprezentare vizuala a sunetului ar fi un grafic simplu cu timpul pe axa x si pozitia microfonului/difuzorului pe axa y, avand valori intre -1 si 1. Poti vede un exemplu de astfel de grafic in partea de sus a diagramei.

en: Playing Part of a Sample
ro: Redarea unei parti dintr-un esantion

en: So, how do we code Sonic Pi to play a sample back in a different order? To answer this question we need to take a look at the `start:` and `finish:` opts for `sample`. These let us control the start and finish positions of our playback of the numbers which represent the sound. The values for both of these opts are represented as a number between `0` and `1` where `0` represents the start of the sample and `1` is the end. So, to play the first half of the Amen Break, we just need to specify a `finish:` of `0.5`:
ro: Cum procedam deci pentru a cere Sonic Pi sa redea un esantion intr-o ordine diferita. Pentru a raspunde la aceasta intrebare trebuie sa analizam parametrii 'start:' si 'finish:' pentru 'sample'. Acestia ne permit sa controlam pozitia de inceput si de final pentru numerele reprezentand esantionul care vor fi redate. Valorile pentru ambii parametri sunt reprezentate de numere intre '0' (inceputul esantionului) si '1' (sfarsitul sau). Deci, pentru a reda prima jumatate din Amen Break, trebuie sa setam valoarea '0.5' pentru 'finish:':

en: We can add in a `start:` value to play an even smaller section of the sample:
ro: Putem adauga si o valoare pentru 'start:' ca sa redam o sectiune si mai mica din esantion:

en: For fun, you can even have the `finish:` opt's value be *before* `start:` and it will play the section backwards:
ro: Ca sa te distrezi, poti alege o valoare *mai mica* pentru 'finish:' decat pentru 'start:' si respectiva sectiune va fi redata invers:

en: Re-ordering Sample Playback
ro: Schimabarea ordinii de redare a esantionului

en: Now that we know that a sample is simply a list of numbers that can be played back in any order and also how to play a specific part of a sample we can now start having fun playing a sample back in the 'wrong' order.
ro: Acum ca stim ca un esantion este doar o lista de numere care pot fi redate in orice ordine si stim si cum sa redam doar o anumita parte din esantion, putem incepe sa ne distram redand un esantion in ordine 'gresita'.

en: Let's take our Amen Break and chop it up into 8 equally-sized slices and then shuffle the pieces around. Take a look at the diagram: at the top A) represents the graph of our original sample data. Chopping it into 8 slices gives us B) - notice that we've given each slice a different colour to help distinguish them. You can see each slice's start and finish values at the top. Finally C) is one possible re-ordering of the slices. We can then play this back to create a new beat. Take a look at the code to do this:
ro: Sa ne uitam putin la Amen Break si sa il taiem in 8 felii egale apoi sa le amestecam. Priveste diagrama: sus A) reprezinta graficul datelor din esantionul initial. Taierea lui in 8 bucati ne da B) - observi ca am colorat diferit fiecare dintre cele 8 felii pentru a le distinge mai usor. Deasupra poti vedea valorile de inceput si de sfarsit pentru fiecare felie. In fine, C) reprezinta una dintre re-aranjarile posibile pentru cele 8 felii. Putem reda aceste numere pentru a crea un nou beat. Sa privim codul care face acest lucru:

en: we choose a random slice to play which should be a random number between 0 and 7 (remember that we start counting at 0). Sonic Pi has a handy function for exactly this: `rand_i(8)`. We then store this random slice index in the variable `slice_idx`.
ro: Alegem aleator o felie pentru redare folosind un numar aleator intre 0 si 7 (adu-ti aminte ca incepem numerotarea de la 0). Sonic Pi are o functie foarte utila pentru acest lucru: 'rand_i(8)'. Memoram apoi acest index aleator in variabila 'slice_idx'.

en: We define our `slice_size` which is 1/8 or 0.125. The `slice_size` is necessary for us to convert our `slice_idx` into a value between 0 and 1 so we can use it as our `start:` opt.
ro: Definim marimea feliei - 'slice_size' ca fiind 1/8 sau 0.125. Variabila 'slice_size' ne este utila pentru a converti 'slice_idx' intr-o valoare intre 0 si 1, ca sa o putem folosi pentru parametrul 'start:'.

en: We calculate the start position `s` by multiplying the `slice_idx` by the `slice_size`.
ro: Calculam pozitia de start 's' inmultind 'slice_idx' cu 'slice_size'.

en: We calculate the finish position `f` by adding the `slice_size` to the start position `s`.
ro: Calculam pozitia de final 'f' adaugand 'slice_size' la valoarea pozitiei de start 's'.

en: We can now play the sample slice by plugging in the `s` and `f` values into the `start:` and `finish:` opts for `sample`.
ro: Acum putem reda felia din esantion transmitand 's' si 'f' ca valori pentru parametrii 'start:' si 'finish:' cand apelam 'sample'.

en: Before we play the next slice we need to know how long to `sleep` which should be the duration of the sample slice. Luckily, Sonic Pi has us covered with `sample_duration` which accepts all the same opts as `sample` and simply returns the duration. Therefore, by passing `sample_duration` our `start:` and `finish:` opts, we can find out the duration of a single slice.
ro: Inainte sa redam urmatoarea felie trebuie sa stim cat de mult trebuie sa dureze pauza, care trebuie sa fie la fel de lunga ca durata unei felii din esantion. Din fericire, Sonic Pi ne ofera functia 'sample_duration' care accepta aceiasi parametri ca 'sample' si returneaza durata. Apeland deci 'sample_duration' cu parametri 'start:' si 'finish:', putem afla durata unei felii de esantion.

en: We wrap all of this code in a `live_loop` so that we continue to pick new random slices to play.
ro: Introducem toate acestea intr-o bucla live ca sa putem alege in continuu noi felii aleatoare pentru redare.

en: Let's combine everything we've seen so far into a final example which demonstrates how we can take a similar approach to combine randomly sliced beats with some bass to create the start of an interesting track. Now it's your turn - take the code below as a starting point and see if you can take it in your own direction and create something new...
ro: Sa punem cap la cap tot ce am vazut pana acum intr-un exemplu final care arata cum putem folosi o abordare asemanatoare pentru a combina beat-uri sectionate aleator (sliced) cu niste bas pentru a obtine punctul de pornire pentru o pista interesanta. Acum este randul tau - ia codul de mai jos si modifica-l cum iti place tie pentru a crea ceva nou...

en: A.13 Code a Probabilistic Sequencer
ro: A.13 Programeaza un Sequencer probabilistic

en: Code a Probabilistic Sequencer
ro: Programeaza un Sequencer probabilistic

en: In a previous episode of this Sonic Pi series we explored the power of randomisation to introduce variety, surprise and change into our live coded tracks and performances. For example, we randomly picked notes from a scale to create never-ending melodies. Today we're going to learn a new technique which uses randomisation for rhythm - probabilistic beats!
ro: Intr-un episod precedent am explorat randomizarea pentru a introduce varietate, surpriza si schimbare in interpretarile bazate pe programarea live. De exemplu, am ales la intamplare note dintr-o scala pentru a crea melodii fara sfarsit. Azi vom invata o tehnica noua care foloseste randomizarea pentru ritm - beat-uri probabilistice!

en: Probability
ro: Probabilitati

en: Before we can start making new beats and synth rhythms we need to take a quick dive into the basics of probability. This might sound daunting and complicated, but really it's just as simple as rolling a dice - honestly! When you take a regular 6 sided board game dice and roll it what's actually happening? Well, firstly you'll roll either a 1, 2, 3, 4, 5 or 6 with exactly the same chance of getting any of the numbers. In fact, given that it's a 6 sided dice, on average (if you roll lots and lots of times) you'll throw a 1 every 6 throws. This means you have a 1 in 6 chance of throwing a 1. We can emulate dice rolls in Sonic Pi with the fn `dice`. Let's roll one 8 times:
ro: Inainte sa incepem sa cream noi beat-uri si ritmuri de sintetizator, trebuie sa discutam putin despre bazele probabilitatilor. Poate suna putin complicat, chiar infricosator, dar este la fel de simplu ca a da cu zarul, serios! Cand iei un zar obisnuit cu 6 fete si il rostogolesti, ce se intampla de fapt? Ei bine, in primul rand vei obtine un 1, 2, 3, 4, 5 sau 6, fiecare dintre acestea avand aceeasi sansa sa apara. De fapt, tinand cont de faptul ca zarul are 6 fete, vei obtine in medie un 1 la fiecare 6 aruncari (daca arunci zarul de un numar de ori suficient de mare). Asta inseamana ca ai o sansa din sase sa abtii un 1. Putem simula datul cu zarul in Sonic Pi folosind functia 'dice'. Sa dam cu zarul de 8 ori:

en: Notice how the log prints values between 1 and 6 just as if we'd rolled a real dice ourselves.
ro: Observi cum in log apar valori intre 1 si 6, ca si cum am fi dat cu zarul.

en: Random Beats
ro: Beat-uri aleatoare

en: Now imagine you had a drum and every time you were about to hit it you rolled a dice. If you rolled a 1, you hit the drum and if you rolled any other number you didn't. You now have a probabilistic drum machine working with a probability of 1/6! Let's hear what that sounds like:
ro: Acum sa ne imaginam ca ai o toba si de fiecare data cand te pregatesti sa o lovesti dai cu zatul. Daca obtii 1, lovesti toba, iar daca obtii altceva, nu o lovesti. Acum ai o toba automata care merge cu probabilitatea 1/6! Sa ascultam sunetul obtinut:

en: Let's quickly go over each line to make sure everything is very clear. First we create a new `live_loop` called `:random_beat` which will continually repeat the two lines between `do` and `end`. The first of these lines is a call to `sample` which will play a pre-recorded sound (the `:drum_snare_hard` sound in this case). However, this line has a special conditional `if` ending. This means that the line will only be executed if the statement on the right hand side of the `if` is `true`. The statement in this case is `dice == 1`. This calls our `dice` function which, as we have seen, returns a value between 1 and 6. We then use the equality operator `==` to check to see if this value is `1`. If it is `1`, then the statement resolves to `true` and our snare drum sounds, if it isn't `1` then the statement resolves to `false` and the snare is skipped. The second line simply waits for `0.125` seconds before rolling the dice again.
ro: Sa parcurgem rapid fiecare linie ca sa ne asiguram ca totul este clar. Mai intai cream o noua bucla live numita ':random_beat' care va repeta in continuu cele doua linii dintre 'do' si 'end'. Prima dintre aceste linii este un apel 'sample' care va reda un sunet pre-inregistrat (':drum_snare_hard' in cazul acesta). Aceasta linie are insa o conditie la sfarsit, introdusa de un 'if' (daca). Aceasta inseamna ca linia se va executa doar daca acea conditie care urmeaza dupa 'if' este indeplinita. Conditia in acest caz este 'dice == 1'. Este apelata functia 'dice' care, asa cum am vazut, returneaza o valoare intre 1 si 6. Apoi folosim operatorul '==' pentru a verifica daca aceasta valoare este '1'. Daca este '1', atunci conditia este indeplinita (are valoarea 'true', adica adevarat) si este redat sunetul de toba mica, daca nu este '1' conditia nu este indeplinita si instructiunea sunetul nu este redat. A doua linie introduce o pauza simpla de '0.125' secunde inainte de a da din nou cu zarul.

en: Changing Probabilities
ro: Schimbarea probabilitatilor

en: Those of you that have played role play games will be familiar with lots of strangely shaped dice with different ranges. For example there is the tetrahedron shaped dice which has 4 sides and even a 20 sided dice in the shape of a icosahedron. The number of sides on the dice changes the chance, or probability of rolling a 1. The fewer sides, the more likely you are to roll a 1 and the more sides the less likely. For example, with a 4 sided dice, there's a one in 4 chance of rolling a 1 and with a 20 sided dice there's a one in 20 chance. Luckily, Sonic Pi has the handy `one_in` fn for describing exactly this. Let's play:
ro: Cei care ati jucat jocuri de tip RPG (role playing games) sunteti probabil familiari cu zarurile cu forme ciudate si cu numar diferit de fete. De exemplu, exista un zar in forma de tetraedru care are 4 fete, dar si zaruri cu 20 de fete in forma de icosaedru. Numarul de fete ale zarului schimba probabilitatea de a obtine un 1. Cu cat sunt mai putine fete, cu atat e mai probabil sa obtii un 1, iar cu cat sunt mai multe, cu atat este mai putin probabil.
    De exemplu, pentru un zar cu 4 fete ai 1 sansa din 4, iar pentru zarul cu 20 de fete ai 1 sansa din 20. Din fericire, Sonic Pi are o functie 'one_in' foarte la indemana pentru a descrie exact acest lucru. Sa ne jucam:

en: Start the live loop above and you'll hear the familiar random rhythm. However, don't stop the code running. Instead, change the `6` to a different value such as `2` or `20` and hit the `Run` button again. Notice that lower numbers mean the snare drum sounds more frequently and higher numbers mean the snare triggers fewer times. You're making music with probabilities!
ro: Incepe cu bucla live de mai sus si vei auzi ritmul aleator deja cunoscut. Nu opri insa codul care ruleaza. In schimb, modifica '6' cu o valoare diferita, cum ar fi '2' sau '20' si apasa din nou butonul 'Run'. Observi ca un numar mai mic inseamna ca sunetul de toba mica se va auzi mai des, iar un numar mai mare inseamna ca sunetul se va auzi mai rar. Acum creezi muzica folosind probabilitatile!

en: Combining Probabilities
ro: Combinarea probabilitatilor

en: Things get really exciting when you combine multiple samples being triggered with different probabilities. For example:
ro: Lucrurile pot deveni cu adevarat interesante cand combini mai multe esantioane care sunt redate cu probabilitati diferite. De exemplu:

en: Again, run the code above and then start changing the probabilities to modify the rhythm. Also, try changing the samples to create an entirely new feel. For example try changing `:drum_cymbal_closed` to `:bass_hit_c` for extra bass!
ro: Executa codul de mai sus si apoi schimba probabilitatile pentru a modifica ritmul. De asemenea, incerca sa schimbi esantioanele pentru a crea ceva cu totul diferit. De exemplu, schimba `:drum_cymbal_closed` cu `:bass_hit_c` pentru mai mult bas!

en: Repeatable Rhythms
ro: Ritmuri repetabile

en: Next, we can use our old friend `use_random_seed` to reset the random stream after 8 iterations to create a regular beat. Type the following code to hear a much more regular and repeating rhythm. Once you hear the beat, try changing the seed value from `1000` to another number. Notice how different numbers generate different beats.
ro: In continuare, putem apela la vechiul nostru prieten 'use_random_seed' pentru a reseta sirul aleator dupa fiecare 8 iteratii pentru a crea un beat regulat. Scrie codul de mai jos pentru a auzi un ritm mai regulat care se repeta. Dupa ce se aude beat-ul, incearca sa schimbi valoarea de initializare (random seed) din 1000 in altceva. Observi ca numere diferite vor produce beat-uri diferite.

en: One thing I tend to do with this kind of structure is to remember which seeds sound good and make a note of them. That way I can easily re-create my rhythms in future practice sessions or performances.
ro: Un lucru pe care il fac de obicei cu acest tip de structura este sa vad ce valoare de initializare suna mai bine si sa o notez. In felul asta pot recrea usor ritmurile mele in viitor cand exersez sau interpretez live.

en: Finally, we can throw in some random bass to give it some nice melodic content. Notice that we can also use our newly discovered probabilistic sequencing method on synths just as well as samples. Don't leave it at that though - tweak the numbers and make your own track with the power of probabilities!
ro: In fine, putem adauga niste bas aleator pentru a crea un continut melodic placut. Putem folosi metoda probabilistica de redare a esantioanelor pe care tocmai am descoperit-o. Dar nu lasa lucrurile asa - modifica numerele si creeaza propria ta melodie folosind puterea probabilitatilor!

en: A.14 Amplitude Modulation
ro: A.14 Modulatia in amplitudine

en: Amplitude Modulation
ro: Modulatia in amplitudine

en: This month we're going to take a deep dive into one of Sonic Pi's most powerful and flexible audio FX - the `:slicer`. By the end of this article you will have learned how to manipulate the overall volume of parts of our live coded sound in powerful new ways. This will allow you to create new rhythmic and timbral structures and broaden your sonic possibilities.
ro: Luna asta vom analiza in detaliu  unul dintre cele mai puternice efecte audio ale Sonic Pi - ':slicer'. La sfarsitul acestui articol vei sti sa modifici volumul global al diferitelor parti din sunetul programat live in moduri noi foarte puternice. Asta iti va permita se creezi noi structuri ritmice si timbrale si sa iti largesti capacitatea de exprimare.

en: Slice that Amp
ro: Modifica amplitudinea cu ':slicer'

en: So, what does the `:slicer` FX actually do? One way to think about it is that it's just like having someone play around with the volume control on your TV or home hi-fi. Let's take a look but first, listen to the deep growl of the following code which triggers the `:prophet` synth:
ro: Ce face de fapt efectul ':slicer'? Poti sa iti imaginezi ca cineva se joaca cu volumul la televizorul tau sau la amplificatorul audio. Sa aruncam o privire, dar mai intai sa ascultam murmurul produs de bucata asta de cod care foloseste sintetizatorul ':prophet':

en: Now, let's pipe it through the `:slicer` FX:
ro: Acum, sa il trecem printr-un efect ':slicer':

en: Hear how the slicer acts like it's muting and unmuting the audio with a regular beat. Also, notice how the `:slicer` affects all the audio generated between the `do`/`end` blocks. You can control the speed at which it turns the audio on and off with the `phase:` opt which is short for phase duration. Its default value is `0.25` which means 4 times a second at the default BPM of 60. Let's make it faster:
ro: Observa cum efectul slicer actioneaza ca si cand ar opri/porni sunetul intr-un ritm regulat. De asemenea, vei vedea ca ':slicer' afecteaza toate sunetele generate intre blocurile 'do'/'end'. Poti controla viteza cu care porneste si opreste sunetul cu parametrul 'phase:' care este o prescurtare de la durata fazei. Valoarea implicita este '0.25' ceea ce inseamna de 4 ori pe secunda la BPM implicit de 60. Sa il facem mai rapid:

en: Now, play with different `phase:` durations yourself. Try longer and shorter values. See what happens when you choose a really short value. Also, try different synths such as `:beep` or `:dsaw` and different notes. Take a look at the following diagram to see how different `phase:` values change the number of amplitude changes per beat.
ro: Acum, joaca-te cu diferite durate pentru 'phase:'. Incearca valori mai mari sau mai mici. Vezi ce se intampla cand alegi o durata foarte scurta. De asemenea, incearca diferite sintetizatoare, cum ar fi ':beep' sau ':dsaw' si note diferite. Priveste diagrama urmatoare pentru a vedea cum schimba diferitele valori pentru ':phase' numarul de schimbari de amplitudine intr-un beat.

en: Phase duration is the length of time for one on/off cycle. Therefore smaller values will make the FX switch on and off much faster than larger values. Good values to start playing with are `0.125`, `0.25`, `0.5` and `1`.
ro: Durata fazei este timpul pentru un ciclu pornit/oprit. Ca urmare, valori mai mici vor face efectul sa comute mai rapid decat valori mai mari. Valori cu care ai putea experimenta sunt  `0.125`, `0.25`, `0.5` si `1`.

en: Control Waves
ro: Forma de unda de control

en: By default, the `:slicer` FX uses a square wave to manipulate the amplitude through time. This is why we hear the amplitude on for a period, then immediately off for a period, then back on again. It turns out that the square wave is just one of 4 different control waves that are supported by `:slicer`. The others are saw, triangle and (co)sine. Take a look at the diagram below to see what these look like. We can also hear what they sound like. For example, the following code uses (co)sine as the control wave. Hear how the sound doesn't turn on and off abruptly but instead smoothly fades in and out:
ro: Implicit, efectul ':slicer' foloseste o forma de unda dreptunghiulara pentru a modifica amplitudinea in timp. De acceea auzim sunetul o perioada, apoi imediat dispare, apoi apare din nou. Forma de unda dreptunghiulara este doar una dintre cele 4 care pot fi folosite de catre ':slicer'. Celelalte sunt tip dinti de fierastrau, triunghiulara si (co)sinusoidala. Priveste diagrama de mai jos pentru a vedea cum arata diecare. Putem sa si auzim cum suna fiecare. De exemplu, codul de mai jos foloseste forma de unda co(sinusoidala) pentru control. Observi ca sunetul nu se opreste/porneste brusc ci are un efect de fade out/fade in:

en: Have a play with the different wave forms by changing the `wave:` opt to `0` for saw, `1` for square, `2` for triangle and `3` for sine. See how different waves sound with different `phase:` opts too.
ro: Joaca-te cu diferite forme de unda schimband parametrul 'wave:' la '0' pentru dinti de fierastrau, '1' pentru patrata, '2' pentru triunghiulara si '3' pentru sinusoidala. Observa de asemenea cum suna diferitele forme de unda cu valori diferite pentru 'phase:'.

en: Each of these waves can be inverted with the `invert_wave:` opt which flips it on the y axis. For example, in a single phase the saw wave typically starts high, and slowly goes down before jumping back to the top. With `invert_wave: 1` it will start low and slowly go up before jumping back down again. Additionally, the control wave can be started at different points with the `phase_offset:` opt which should be a value between `0` and `1`. By playing around with `phase:`, `wave:`, `invert_wave:` and `phase_offset` opts you can dramatically change how the amplitude is modified through time.
ro: Fiecare dintre aceste forme de unda poate fi inversata folosind parametrul 'invert_wave:' care o oglindeste fata de axa y. De exemplu, pe parcursul unei singure faze unda dinti de fierastrau porneste in general de sus si coboara incet pentru ca apoi sa sara instantaneu din nou la valoarea maxima. Folosind 'invert_wave: 1', ea va porni de jos si va creste progresiv inainte de a reveni instantaneu la valoarea minima. In plus, forma de unda poate porni din diferite puncte, folosind parametrul 'phase_offset:' care trebuie sa aiba o valoare intre '0' si '1'. Jucandu-te cu parametrii  `phase:`, `wave:`, `invert_wave:` si `phase_offset` poti schimba semnificativ modul in care amplitudinea este modificata in timp.

en: Setting your levels
ro: Stabilirea nivelului

en: By default, `:slicer` switches between amplitude values `1` (fully loud) and `0` (silent). This can be changed with the `amp_min:` and `amp_max:` opts. You can use this alongside the sine wave setting to create a simple tremolo effect:
ro: Implicit, ':slicer' comuta intre valorile '1' (sunet la maximum) si '0' (oprit complet) pentru amplitudine. Acestea pot fi schimbate folosind parametrii `amp_min:` si `amp_max:`. Poti folosi acesti parametri impreuna cu o unda sinusoidala pentru a crea un efect simplu de tremolo:

en: This is just like grabbing the volume knob on your hi-fi and moving it up and down just a little so the sound 'wobbles' in and out.
ro: Este ca si cum ai roti putin la stanga si la dreapta butonul de volum de la amplificatorul tau audio pentru ca taria sunetului sa oscileze putin.

en: Probabilities
ro: Probabilitati

en: One of `:slicer`'s powerful features is its ability to use probability to choose whether or not to turn the slicer on or off. Before the `:slicer` FX starts a new phase it rolls a dice and based on the result either uses the selected control wave or keeps the amplitude off. Let's take a listen:
ro: Una dintre caracteristicile importante ale efectului ':slicer' este posibilitatea de a folosi probabilitatile pentru a alege daca activeaza sau nu modificarea de amplitudine. Inainte ca ':slicer' sa inceapa o noua faza, el da cu zarul si pe baza rezultatului fie foloseste forma de unda selectata fie mentine amplitudinea la 0. Sa ascultam:

en: Hear how we now have an interesting rhythm of pulses. Try changing the `probability:` opt to a different value between `0` and `1`. Values closer to `0` will have more space between each sound due to the likelihood of the sound being triggered being much lower.
ro: Observi ca acum avem un ritm interesant de impulsuri. Incearca sa setezi parametrul "probability:' la o valoare intre '0' si '1'. Valorile mai apropiate de 0 vor duce la pauze mai mari intre sunete deoarece probabilitatea ca sunetul sa fie redat este mult mai mica.

en: Another thing to notice is that the probability system in the FX is just like the randomisation system accessible via fns such as `rand` and `shuffle`. They are both completely deterministic. This means that each time you hit Run you'll hear exactly the same rhythm of pulses for a given probability. If you would like to change things around you can use the `seed:` opt to select a different starting seed. This works exactly the same as `use_random_seed` but only affects that particular FX.
ro: Un alt lucru de remarcat este ca sistemul de probabilitati din acest efect este la fel ca sistemul de randomizare accesibil prin intermediul functiilor ca 'rand' si 'shuffle'. Ambele sunt complet deterministe. Aceasta inseamna ca de fiecare data cand apesi pe Run vei auzi exact acelasi ritm de impulsuri pentru o probabilitate data. Daca vrei sa schimbi acest lucru poti folosi parametrul 'seed:' pentru a selecta un punct de pornire diferit in secventa de numere aleatoare. Acest parametru functioneaza exact ca `use_random_seed`, dar afecteaza doar acest efect particular.

en: Finally, you can change the 'resting' position of the control wave when the probability test fails from `0` to any other position with the `prob_pos:` opt:
ro: In fine, poti schimba pozitia de "repaus" a undei de control pentru cazul in care testul probabilistic esueaza (deci nu se initiaza modificarea amplitudinii conform formei de unda) de la '0' la orice alta valoare, folosind parametrul 'prob_pos:':

en: Slicing Beats
ro: Crearea de beat-uri folosind slicing

en: One really fun thing to do is to use `:slicer` to chop a drum beat in and out:
ro: Un lucru cu adevarat amuzant este sa folosesti ':slicer' pentru a cioparti un beat de toba:

en: This allows us to take any sample and create new rhythmical possibilites which is a lot of fun. However, one thing to be careful about is to make sure that the tempo of the sample matches the current BPM in Sonic Pi otherwise the slicing will sound totally off. For example, try swapping `:loop_mika` with the `loop_amen` sample to hear how bad this can sound when the tempos don't align.
ro: Acest lucru ne permite sa luam orice esantion si sa cream noi ritmuri, ceea ce este chiar distractiv. Totusi, un lucru de care trebuie sa tinem seama este ca tempo-ul esantionului trebuie sa fie acelasi cu BPM curent din Sonic Pi, altfel slicing-ul va suna total anapoda. De exemplu, incearca sa schimbi `:loop_mika` cu `loop_amen` pentru a auzi cat de rau suna cand tempo-urile nu coincid.

en: Changing tempo
ro: Schimbarea tempo-ului

en: As we have already seen, changing the default BPM with `use_bpm` will make all the sleep times and synth envelope durations grow or shrink to match the beat. The `:slicer` FX honours this too, as the `phase:` opt is actually measured in beats not seconds. We can therefore fix the issue with `loop_amen` above by changing the BPM to match the sample:
ro: Dupa cum am vazut, modificarea BPM implicit cu 'use_bpm' va faca ca toate pauzele sau duratele anvelopelor pentru esantioane sa creasca sau sa scada pentru a se potrivi cu beat-ul. Efectul ':slicer' respecta aceeasi regula, parametrul 'phase:' fiind de fapt masurat in masuri, nu in secunde. Putem deci corecta problema de mai sus cu 'loop_amen' schimband BPM pentru a se potrivi cu cel al esantionului:

en: Let's apply all these ideas into a final example that only uses the `:slicer` FX to create an interesting combination. Go ahead, start changing it and make it into your own piece!
ro: Sa aplicam toate aceste idei intr-un exemplu final care foloseste doar efectul ':slicer' pentru a crea o combinatie interesanta. Da-i drumul, modifica-l si transforma-l in propria ta piesa!

en: A.15 Five Live Coding Techniques
ro: A.15 Cinci tehnici de programare live

en: Five Live Coding Techniques
ro: Cinci tehnici de programare live

en: In this month's Sonic Pi tutorial we're going to take a look at how you can start treating Sonic Pi like a real instrument. We therefore need to start thinking of code in a completely different way. Live coders think of code in a similar way to how violinists think of their bow. In fact, just like a violinist can apply various bowing techniques to create different sounds (long slow motions vs short fast hits) we will explore five of the basic live coding techniques that Sonic Pi enables. By the end of this article you'll be able to start practicing for your own live coded performances.
ro: In tutorialul de luna aceasta vom vedea cum putem sa tratam Sonic Pi ca pe un instrument adevarat. Va trebui deci sa incepem sa ne gandim la cod intr-un mod complet diferit. Cei care programeaza live se gandesc la cod intr-un mod similar cu cel in care violonistul se gandeste la arcus. De fapt, asa cum violonistul poate aplica tehnici diferite de manuire a arcusului pentru a crea sunete diferite (miscari lungi si lente vs lovituri scurte si rapide), vom vedea ca Sonic Pi permite tehnici diferite de programare live dintre care vom analiza 5. La sfarsitul acestui tutorial vei putea incepe sa exersezi pentru propriile interpretari live.

en: 1. Memorise the Shortcuts
ro: 1. Memorati scurtaturile de la tastatura (shortcuts)

en: The first tip to live coding with Sonic Pi is to start using the shortcuts. For example, instead of wasting valuable time reaching for the mouse, moving it over to the Run button and clicking, you can simply press `alt` and `r` at the same time which is much faster and keeps your fingers at the keyboard ready for the next edit. You can find out the shortcuts for the main buttons at the top by hovering the mouse over them. See section 10.2 of the built-in tutorial for the full list of shortcuts.
ro: Primul sfat pentru a putea programa live cu Sonic Pi este sa incepi sa folosesti shortcut-uri. De exemplu, in loc sa pierzi timp pretios ca sa iei mouse-ul, sa il muti deasupra butonului Run si sa faci click, poti apasa 'Alt' si 'r' in acelasi timp, ceea ce este mai rapid si iti tine degetele deasupra tastaturii, pregatite pentru ce ai de introdus. Poti descoperi care sunt scurtaturile pentru butoanele principale deplasand cursorul mouse-ului deasupra lor. Vezi sectiunea 10.2 a tutorialului inclus in program pentru lista completa de scurtaturi.

en: When performing, one fun thing to do is to add a bit of flair with your arm motion when hitting shortcuts. For example, it's often good to communicate to the audience when you're about to make a change - so embellish your movement when hitting `alt-r` just like a guitarist would do when hitting a big power chord.
ro: Cand interpretati, un lucru haios pe care il puteti face este sa adaugati un pic de stil prin miscarea mainilor cand apasati scurtaturile. De exemplu, este bine sa comunicati audientei cand va pregatiti sa faceti o schimbare - deci ornati putin miscarea cand apasati 'Alt-r' exact cum un chitarist ar face-o cand reda un acord de forta.

en: 2. Manually Layer your Sounds
ro: 2. Stratificati manual sunetele

en: Now you can trigger code instantly with the keyboard, you can instantly apply this skill for our second technique which is to layer your sounds manually. Instead of 'composing' using lots of calls to `play`, and `sample` separated by calls to `sleep` we will have one call to `play` which we will manually trigger using `alt-r`. Let's try it. Type the following code into a fresh buffer:
ro: Acum puteti porni codul instantaneu cu ajutorul tastaturii si puteti folosi aceasta abilitate pentru a doua tehnica - stratificarea manuala a sunetelor. In loc sa 'compuneti' folosind o multime de apeluri 'play' si 'sample' separate de apeluri 'sleep' pentru pauze, vom avea un apel 'play' pe care il vom declansa manual folosind 'Alt-r'. Sa incercam. Scrie codul de mai jos intr-un buffer nou:

en: Now, hit `Run` and whilst the sound is playing, modify the code in order to drop down four notes by changing it to the following:
ro: Acum, apasa 'Run' si, in timp ce sunetul este redat, schimba codul pentru a cobori patru note, modificandu-l in:

en: Now, hit `Run` again, to hear both sounds playing at the same time. This is because Sonic Pi's `Run` button doesn't wait for any previous code to finish, but instead starts the code running at the same time. This means you can easily layer lots of sounds manually with minor or major modifications between each trigger. For example, try changing both the `note:` and the `cutoff:` opts and then re-trigger.
ro: Acum, apasa 'Run' din nou, pentru a auzi ambele sunete redate in acelasi timp. Aceasta deoarece apasarea butonului 'Run' in Sonic Pi duce la executarea codului imediat, fara a astepta ca sunetul dinainte sa se termine. Asta inseamna ca poti adauga manual cu usurinta noi straturi sunetului cu modificari mai mici sau mai mari intre doua lansari in executie. De exemplu, incearca sa schimbi atat parametrul 'note:' cat si 'cutoff:', apoi reporneste.

en: You can also try this technique with long abstract samples. For example:
ro: Poti incerca aceasta tehnica si cu esantioane abstracte lungi. De exemplu:

en: Try starting the sample off, and then progressively halving the `rate:` opt between hitting `Run` from `1` to `0.5` to `0.25` to `0.125` and then even try some negative values such as `-0.5`. Layer the sounds together and see where you can take it. Finally, try adding some FX.
ro: Incearca sa pornesti esantionul apoi injumatateste de fiecare data parametrul 'rate:' inainte de a apasa din nou pe 'Run', de la '1' la '0.5' la '0.25' la '0.125' si apoi chiar la valori negative cum ar fi '-0.5'. Asterne straturile de sunet unul peste altul si vezi la ce poti ajunge. Apoi, incearca sa adaugi efecte.

en: When performing, working with simple lines of code in this way means that an audience new to Sonic Pi has a good chance to follow what you're doing and relate the code that they can read to the sounds they are hearing.
ro: Cand interpretezi, lucrul cu linii simple de cod in modul acesta inseamna ca audienta care ia prima data contact cu Sonic Pi are o buna sansa sa urmareasca ce faci si sa faca legatura intre codul pe care il citesc si sunetele pe care le aud.

en: 3. Master Live Loops
ro: 3. Stapaneste buclele live

en: When working with more rhythmic music, it can often be hard to manually trigger everything and keep good time. Instead, it is often better to use a `live_loop`. This provides repetition for your code whilst also giving the ability to edit the code for the next time round the loop. They also will run at the same time as other `live_loop`s which means you can layer them together both with each other and manual code triggers. Take a look at section 9.2 of the built-in tutorial for more information about working with live loops.
ro: Cand lucrezi cu muzica mai ritmata, poate fi adesea dificil sa pornesti totul manual si sa pastrezi sincronizarea. De aceea, e mai bine sa sa folosesti 'live_loop'. Aceasta asigura repetarea codului in timp ce iti da posibilitatea sa modifici codul pentru urmatoarea executie a buclei. De asemenea, se va executa in acelasi timp cu alte bucle live, ceea ce inseamna ca straturile de sunet vor fi sincronizate. Arunca o privire la sectiunea 9.2 din tutorial pentru mai multe informatii despre lucrul cu buclele live.

en: When performing, remember to make use of `live_loop`'s `sync:` opt to allow you to recover from accidental runtime mistakes which stop the live loop running due to an error. If you already have the `sync:` opt pointing to another valid `live_loop`, then you can quickly fix the error and re-run the code to re-start things without missing a beat.
ro: Cand interpretezi, tine minte sa folosesti parametrul 'sync:' al 'live_loop' pentru a permite revenirea dupa probleme de rulare care opresc bucla live din cauza unor erori. Daca ai deja parametrul 'sync:' legat de o alta bucla live valida, atunci poti sa remediezi cu usurinta eroarea si sa rulezi din nou codul pentru a reporni sunetul fara sa pierzi un beat.

en: 4. Use the Master Mixer
ro: 4. Foloseste Mixerul principal

en: One of Sonic Pi's best kept secrets is that it has a master mixer through which all sound flows. This mixer has both a low pass filter and a high pass filter built-in, so you can easily perform global modifications to the sound. The master mixer's functionality can be accessed via the fn `set_mixer_control!`. For example, whilst some code is running and making sound, enter this into a spare buffer and hit `Run`:
ro: Unul dintre cele mai bine pastrate secrete ale Sonic Pi este ca are un mixer principal prin care trec toate sunetele. Mixerul are incorporate atat un filtru trece jos cat si unul trece sus, deci puteti face cu usurinta modificari globale asupra sunetului. Functionalitatile mixerului principal pot fi accesate folosind functia 'set_mixer_control!'. De exemplu, in timp ce se executa o bucata de cod care produce sunete, introdu comanda de mai jos intr-un buffer gol si apasa 'Run':

en: After you run this code, all existing and new sounds will have a low pass filter applied to them and will therefore sound more muffled. Note that this means that the new mixer values stick until they are changed again. However, if you want, you can always reset the mixer back to its default state with `reset_mixer!`. Some of the currently supported opts are: `pre_amp:`, `lpf:` `hpf:`, and `amp:`. For the full list, see the built-in docs for `set_mixer_control!`.
ro: Dupa ce executi aceasta instructiune, tuturor sunetelor existente si viitoare li se va aplica un filtru trece jos si vor fi in consecinta mai inabusite. Retine ca aceasta inseamna ca valorile pe care le-am setat pentru mixer voi fi mentinute pana cand le schimbam din nou. Totusi, daca vrei, poti sa resetezi oricand mixerul la starea implicita cu 'reset_mixer!'. Cativa dintre parametrii suportati in acest moment sunt: `pre_amp:`, `lpf:` `hpf:` si `amp:`. Pentru lista completa, vezi documentatia pentru `set_mixer_control!`.

en: Use the mixer's `*_slide` opts to slide one or many opts values over time. For example, to slowly slide the mixer's low pass filter down from the current value to 30, use the following:
ro: Foloseste parametrii '*_slide' ai mixerului pentru a face sa varieze una sau mai multe valori in timp. De exemplu, pentru a face ca filtrul trece jos sa coboare lin de la valoarea curenta la 30, foloseste:

en: You can then slide quickly back to a high value with:
ro: Poti apoi sa cresti rapid la o valoare mai ridicata cu:

en: When performing, it's often useful to keep a buffer free for working with the mixer like this.
ro: Cand interpretezi, este util sa pastrezi un buffer liber pentru a lucra cu mixerul in acest mod.

en: 5. Practice
ro: 5. Exerseaza

en: The most important technique for live coding is practice. The most common attribute across professional musicians of all kinds is that they practice playing with their instruments - often for many hours a day. Practice is just as important for a live coder as a guitarist. Practice allows your fingers to memorise certain patterns and common edits so you can type and work with them more fluently. Practice also gives you opportunities to explore new sounds and code constructs.
ro: Cea mai importanta tehnica pentru programarea live este exersarea. Caracteristica cea mai intalnita intre muzicienii profesionisti de toate tipurile este ca ei exerseaza cantatul la instrumentele lor - adesea multe ore pe zi. Exersarea este la fel de importanta pentru un programator live ca si pentru un chitarist. Repetitia permite degetelor tale sa memoreze anumite sabloane si modificari frecvente astfel incat sa le poti introduce de la tastatura si sa lucrezi cu ele mai fluent. Exersarea iti ofera de asemenea posibilitatea sa explorezi sunete si secvente de cod noi.

en: When performing, you'll find the more practice you do, the easier it will be for you to relax into the gig. Practice will also give you a wealth of experience to draw from. This can help you understand which kinds of modifications will be interesting and also work well with the current sounds.
ro: Cand interpretezi, vei descoperi ca iti va fi cu atat mai usor cu cat ai exersat mai mult. Exersarea iti va oferi de asemenea o experienta utila. Aceasta te va ajuta sa intelegi ce tipuri de modificari vor fi mai interesante si vor merge mai bine cu sunetele curente.

en: This month, instead of giving you a final example that combines all the things discussed, let's part by setting down a challenge. See if you can spend a week practicing one of these ideas every day. For example, one day practice manual triggers, the next do some basic `live_loop` work and the following day play around with the master mixer. Then repeat. Don't worry if things feel slow and clunky at first - just keep practicing and before you know it you'll be live coding for a real audience.
ro: Luna aceasta, in loc sa iti dau un exemplu final care combina toate elementele discutate, mai bine sa ne distram stabilind o provocare. Vezi daca poti sa petreci o saptamana exersand cate una dintre aceste tehnici in fiecare zi. De exemplu, intr-o zi exersezi lansarea manuala a sunetelor, in ziua urmatoare incerci niste bucle live simple, iar in urmatoare te joci cu mixerul principal. Apoi repeti. Nu te ingrijoar daca simti ca esti lent si neindemanatic la inceput - continua sa exersezi si fara sa iti dai seama vei ajuge sa programezi live in fata unei audiente reale.

en: A.16 How to Practice Live Coding
ro: A.16 Cum sa exersezi programarea live

en: 8 Tips for Live Coding Practice
ro: 8 Sfaturi pentru a exersa programarea live

en: Last month we took a look at five important techniques for mastering live coding - in other words, we explored how we could use Sonic Pi to approach code in the same way we would approach a musical instrument. One of the important concepts that we discussed was practice. This month we're going to take a deeper dive into understanding why live coding practice is important and how you might start.
ro: Luna trecuta am aruncat o privire asupra a cinci tehnici importante pentru a stapani programarea live - cu alte cuvinte, am explorat cum am putea folosi Sonic Pi pentru a aborda programarea asa cum abordam un instrument muzical. Unul dintre cele mai importante concepte pe care le-am discutat a fost exersarea. Luna aceasta vom vedea mai in amanunt de ce este importanta exersarea in programarea live si cum ai putea incepe.

en: Practice regularly
ro: Exerseaza regulat

en: The most important piece of advice is to make sure you practice regularly. As a rule I typically practice for 1-2 hours a day, but 20 mins is just fine when you're starting out. Little but often is what you're aiming for - so if you can only manage 10 minutes, that's a great start.
ro: Cel mai important sfat este sa te asiguri ca exersezi regulat. De regula eu exersez cam 1-2 ore pe zi, dar 20 de minute sunt de ajuns pentru inceput. Putin si des ar trebui sa fie ceea ce urmaresti la inceput - deci daca nu reusesti decat 10 minute, este un inceput bun.

en: Practice tip #1 - start to develop a practice routine. Find a nice time in the day that works for you and try and practice at that time as many days of the week as you can. Before long you'll be looking forward to your regular session.
ro: Sfatul nr 1 - incepe sa-ti creezi un program pentru exersare. Gaseste o ora din zi care iti convine si incearca sa exersezi cat de multe zile poti la acea ora. Dupa un timp vei ajunge sa astepti cu nerabdare sesiunea de practica programata.

en: Learn to Touch Type
ro: Invata sa tastezi in orb

en: If you watch a professional musician performing on stage you'll likely notice a few things. Firstly, when they play they don't stare at their instrument. Their fingers, arms and bodies know which keys to press, strings to pluck or drums to hit without them having to think about it too much. This is known as "muscle memory" and although it might sound like something only professionals can do - it's just the same as when you first learned to walk or ride a bike - practicing through repetition. Live coders use muscle memory to free their minds from having to think about where to move their fingers so they can focus on the music. This is called touch-typing - typing without having to look at the keyboard.
ro: Daca privesti un muzician profesionist interpretand pe scena vei observa probabil cateva lucruri. In primul rand, cand canta el nu se uita la instrument. Degetele lui, bratele si corpul stiu pe ce clapa sa apese, ce coarda sa ciupeasca sau ce toba sa loveasca, fara ca ei sa trebuiasca sa se gandeasca la asta prea mult. Aceasta este cunoscuta drept "memoria muschilor" si desi suna ca un lucru pe care doar profesionistii il pot face - este acelasi lucru ca atunci cand ati invatat sa mergeti pe jos sau pe bicicleta - exersarea prin repetitie. Programatorii live folosesc memoria muschilor pentru a-si elibera mintea de nevoia de a se gandi unde sa isi miste degetele, astfel incat se pot concentra asupra muzicii. Aceasta se numeste tastare in orb - apasarea tastelor fara a fi nevoit sa privesti la tastatura.

en: Practice tip #2 - learn how to touch type. There are many apps, websites and even games which can help you achieve this. Find one you like the look of and stick at it until you can code without looking down.
ro: Sfatul nr 2 - invata sa tastezi in orb. Exista multe aplicatii, site-uri web sau chiar jocuri care te pot ajuta sa faci asta. Gaseste ceva care iti place si insista pana cand poti sa scrii cod fara sa te uiti la tastatura.

en: Code whilst standing
ro: Programeaza in picioare

en: The body of a musician is conditioned for playing their instrument. For example, a trumpet player needs to be able to blow hard, a guitar player needs to be able to grip the fretboard with strength and a drummer needs to be able to continually hit the drums for long periods of time. So, what's physical about live coding? Just like DJs, live coders typically perform whilst standing up and some even dance whilst they code! If you practice live coding whilst sitting at a desk and then have to get up and stand at a gig, you'll likely find the difference very difficult and frustrating.
ro: Corpul unui muzician este adaptat pentru interpretarea la instrumentul pe care si l-a ales. De exemplu, un trompetist trebuie sa poata sufla puternic, un chitarist trebuie sa poata tine griful cu putere iar tobosarul trebuie sa poata lovi in continuu tobele pentru perioade lungi de timp. Dar unde este partea fizica in programarea live? La fel ca un DJ, un programator live de obicei interpreteaza in timp ce sta in picioare, uneori chiar dansand in timp ce scrie cod! Daca exersezi programarea live in timp ce stai asezat in fata biroului si apoi vei fi nevoit sa stai in picioare pentru o interpretare in fata audientei, schimbarea pozitiei ti se va parea dificila si frustranta.

en: Practice tip #3 - stand whilst you practice. The easiest way to do this is to use a standing height desk. However, if like me you don't have one at home, there's a couple of low-fi options. The approach I take is to use an ironing board which happens to work rather well. Another is to stack some boxes or large books on a normal desk and place your keyboard on top of that. Also, make sure you stretch before you start practicing and try and dance a little during the session. Remember, nobody is watching you, so have fun and you'll feel much more natural on stage.
ro: Sfatul nr 3 - stai in picioare cand exersezi. Cel mai usor este sa folosesti un birou mai inalt la care se poate lucra in picioare. Daca nu ai unul acasa (cum este si cazul meu), exista cateva optiuni la indemana. Eu folosesc o masa de calcat care se potriveste destul de bine. Alta varianta ar fi sa pui niste carti sau cutii sub tastatura ca sa ajunga la inaltimea potrivita. Ai grija sa faci cateva miscari de incalzire inainte sa incepi sa exersezi si incearca sa dansezi putin in timpul sesiunii. Tine minte, nimeni nu te priveste, deci poti sa te distrezi si te vei simti mult mai natural pe scena.

en: Practice setting up
ro: Exerseaza pregatirea echipamentelor

en: Most instruments require some assembly and tuning before they can be played. Unless you're a rockstar with a bus full of roadies, you'll have to set up your own instrument before your gig. This is often a stressful time and it is easy for problems to occur. One way to help with this is to incorporate the setup process into your practice sessions.
ro: Majoritatea instrumentelor muzicale necesita o parte de asamblare si reglaje inainte sa poti canta la ele. Daca nu esti cumva un star rock cu un autocar plin de tehnicieni dupa tine, va trebui sa iti pregatesti singur instrumentul inainte de interpretare. Adesea asta reprezinta o parte stresanta si care poate crea probleme. Un mod de a te pregati pentru acest lucru este sa incluzi partea de pregatire a echipamentelor in programul de exersare.

en: Practice tip #4 - treat setting up as an important part of your practice. For example, have a box or bag that you can keep your Raspberry Pi and keyboard in etc. Before each practice session, take out all the parts, connect everything, and work through the boot process until you have Sonic Pi running and can make sounds. Once you've finished practicing, take the time to carefully pack everything away afterwards. This may take some time at first, but before long you'll be able to setup and pack everything away incredibly quickly without having to think about it.
ro: Sfatul nr 4 - trateaza pregatirea echipamentelor ca pe o parte importanta a exersarii. De exemplu, alege o cutie sau o geanta in care poti tine Raspberry Pi, tastatura si ce iti mai este necesar. Inainte de fiecare sesiune de repetitii, scoate componentele, conecteaza-le si porneste totul pana cand vezi Sonic Pi pe ecran, pregatit sa scoata sunete. Dupa ce termini repetitia, impacheteaza totul cu grija la loc. Aceasta iti va lua ceva timp la inceput, dar in curand vei fi capabil sa pui totul in functiune sau sa impachetezi foarte rapid, fara sa te mai gandesti cum se face asta.

en: Experiment Musically
ro: Experimenteaza

en: Once you've set up and are ready to start making music, you might find yourself struggling to know where to start. One problem many people face is that they might have a good idea of the kinds of sounds they want to make, but are frustrated that they can't produce them. Some people don't even know what kind of sounds they want to make! The first thing to do is not to worry - this is very common and happens to every musician - even if they've been practicing for a long time. It is much more important to be making sounds you don't like than not making any sounds at all.
ro: Odata ce totul este pregatit si poti incepe sa creezi muzica, s-ar putea sa nu stii de unde sa incepi. O problema care apare adesea este ca poti sa stii cam ce sunete vrei sa produci, dar esti frustrat fiindca nu stii cum anume sa faci asta. Uneori s-ar putea chiar sa nu stii nici ce sunete vrei sa produci! Cel mai important este sa nu te ingrijorezi - acest lucru se intampla oricarui muzician - chiar daca exerseaza de mult timp. Este mult mai bine sa creezi sunete care nu iti plac decat sa nu creezi nimic.

en: Practice tip #5 - spend time making sounds and music you don't like. Try to make time to explore new sounds and ideas. Don't worry that it might sound terrible if it's not the style you're looking for. When you're experimenting like this you increase the chance of stumbling over a sound or combination of sounds which you love! Even if 99% of the sounds you make are bad, that 1% might be the riff or intro to your new track. Forget the things you don't like and remember the parts you do. This is even easier when you're making music with code - just hit save!
ro: Sfatul nr 5 - petrece suficient timp creand sunete si muzica chiar daca sunt nereusite. Fa-ti timp sa explorezi noi sunete si idei. Nu te ingrijora ca ar putea suna groaznic sau nu ar fi stilul pe care il cauti. Cand experimentezi in felul asta cresc sansele de a da peste un sunet sau o combinatie de sunete de care te vei indragosti!  Chiar daca 99% dintre sunetele pe care le produci sunt aiurea, restul de 1% ar putea fi exact riff-ul sau introducerea pentru o noua piesa. Uita ce nu ti-a placut si retine doar restul. Acest lucru este foarte usor cand faci muzica folosind programarea - doar apesi pe 'Save'!

en: Hear the Code
ro: Asculta codul

en: Practice tip #6 - write some code into Sonic Pi but don't hit the Run button. Instead, try to imagine what sound it is going to produce. Then, hit Run, listen, and think about what you got right and what you didn't. Keep repeating this until it become a natural part of your coding process. When I practice I normally have a good idea of what the code will sound like. However, I still am occasionally surprised, and then I'll stop and spend some time thinking about why I was wrong. Each time this happens, I learn new tricks which allow me to express myself in new ways.
ro: Sfatul nr 6 - scrie o bucata de cod in Sonic Pi si nu apasa pe 'Run'. Incearca sa iti imaginezi ce sunet va produce. Apoi, apasa 'Run', asculta si gandeste-te ce s-a potrivit si ce nu cu ce ti-ai imaginat. Repeta acest exercitiu pana cand va deveni o parte naturala a modului tau de a programa. Cand repet am in mod normal o idee destul de clara despre cum va suna. Totusi, uneori poti fi surprins si atunci ma opresc si ma gandesc de ce suna altfel decat mi-am imaginat. De fiecare data cand se intampla acest lucru, invat noi trucuri care imi permit sa ma exprim muzical in noi moduri.

en: Remove all distractions
ro: Inlatura orice te poate distrage

en: A common problem when practicing is to become distracted with other things. Practicing is hard and requires real discipline regardless of the kind of music you're making - from jazz to classical to EDM. If you're struggling to get started or make progress, it's often too easy to hop on social media, or look something up on the internet etc. If you've set yourself a target of 20 minutes of practice, it's important to try and spend all that time being as productive as possible.
ro: O problema uzuala cand exersezi este sa fii distras de alte lucruri. Sa exersezi este dificil si necesita disciplina indiferent ce fel de muzica creezi - ca este jazz sau clasica sau dance. Daca nu reusesti sa faci progrese in timpul repetitiei e foarte usor sa treci rapid la social media sau sa cauti ceva pe Internet. Daca ti-ai propus insa sa repeti 20 de minute, e important sa respecti acest lucru si sa petreci tot acest timp fiind cat poti de productiv.

en: Practice tip #7 - before you start practicing remove as many distractions as possible. For example, disconnect from the internet, put your phone in another room and try to practice in a quiet place where you're unlikely to be disturbed. Try to focus on coding music and you can return to your distractions when you've finished.
ro: Sfatul nr 7 - inainte de a incepe sa repeti inlatura tot ce te poate distrage. De exemplu, deconecteaza-te de la Internet, du-ti telefonul in alta camera si incearca sa exersezi intr-un loc linistit unde este putin probabil sa fii deranjat. Incearca sa te concentrezi pe crearea de muzica si te vei putea intoarce la celelalte lucruri cand termini.

en: Keep a practice diary
ro: Tine un jurnal al repetitiilor

en: When you are practicing, you'll often find your mind is full of new exciting ideas - new musical directions, new sounds to try out, new functions to write, etc. These ideas are often so interesting that you might stop what you're doing and start working on the idea. This is another form of distraction!
ro: Cand exersezi mintea ta poate fi inundata de idei noi si incitante - noi directii muzicale, noi sunete pe care sa le incerci, functii noi pe care sa le scrii etc. Aceste idei sunt adesea atat de interesante incat ai putea sa te opresti din ce faci ca sa incepi sa lucrezi la ceva nou. Aceasta este alta forma de a fi distras!

en: Practice tip #8 - keep a practice diary by your keyboard. When you get an exciting new idea, temporarily pause your practice session, quickly jot the idea down, then forget about it and carry on practicing. You can then spend some quality time thinking about and working on your ideas after you've finished practicing.
ro: Sfatul nr 8 - tine un jurnal al repetitiilor langa tastatura. Cand ai o idee noua si interesanta, fa o pauza, noteaza-ti rapid ideea pe hartie, apoi continua cu ceea ce faceai. Vei putea sa te gandesti pe indelete si sa lucrezi la acea idee dupa ce termini de exersat.

en: Try to establish a practice routine which incorporates as many of these ideas as possible. Try to keep the sessions as fun as possible but be aware that some practice sessions will be hard and feel a little like work. However, it will all be worth it once you've created your first piece or given your first performance. Remember, practice is the key to success!
ro: Incearca sa iti stabilesti un program de repetitii care sa includa cat mai multe dintre aceste idei. Fa sesiunile cat se poate de placute, dar fii constient ca unele dintre ele vor fi dificile si vei simti ca ai de muncit. Dar iti vei da seama ca a meritat cand vei produce prima ta piesa sau vei sustine prima interpretare live. Tine mine, repetitia este cheia succesului!

en: A.17 Sample Stretching
ro: A.17 Comprimarea/Intinderea esantioanelor

en: Sample Stretching
ro: Comprimarea/Intinderea esantioanelor

en: When people discover Sonic Pi, one of the first things they learn is how simple it is to play pre-recorded sounds using the `sample` function. For example, you can play an industrial drum loop, hear the sound of a choir or even listen to a vinyl scratch all via a single line of code. However, many people don't realise that you can actually vary the speed that the sample is played back at for some powerful effects and a whole new level of control over your recorded sounds. So, fire up a copy of Sonic Pi and let's get started stretching some samples!
ro: Cand cineva ia contact prima data cu Sonic PI, unul dintre primele lucruri pe care le descopera este cat de simplu este sa redai sunete pre-inregistrate folosind functia 'sample'. De exemplu, poti reda in bucla un sunet de toba, sa auzi vocile unui cor sau chiar sa asculti niste efecte obtinute prin manipularea discurilor de vinil printr-o singura linie de cod. Totusi, sunt multi cei care nu realizeaza ca pot modifica viteza la care este redat esantionul pentru a obtine niste efecte interesante si a controla mai bine sunetul inregistrat. Deci, porneste Sonic Pi si hai sa incepem sa ne jucam cu viteza esantioanelor!

en: Slowing Samples Down
ro: Incetinirea esantioanelor

en: To modify the playback rate of a sample we need to use the `rate:` opt:
ro: Pentru a modifica viteza de redare a esantionului, trebuie sa folosim parametrul 'rate:'

en: If we specify a `rate:` of `1` then the sample is played back at the normal rate. If we want to play it back at half speed we simply use a `rate:` of `0.5`:
ro: Daca specificam valoarea '1' pentru 'rate:', esantionul va fi redat la viteza normala. Daca vrem sa fie redat cu o viteza injumatatita, folosim valoarea '0.5' pentru 'rate:':

en: Notice that this has two effects on the audio. Firstly the sample sounds lower in pitch and secondly it takes twice as long to play back (see the sidebar for an explanation of why this is the case). We can even choose lower and lower rates moving towards `0`, so a `rate:` of `0.25` is a quarter speed, `0.1` is a tenth of the speed, etc. Try playing with some low rates and see if you can turn the sound into a low rumble.
ro: Observi ca aceasta va avea doua efecte. In primul rand esantionul va contine sunete mai joase si in al doilea rand redarea sa va dura de doua ori mai mult (vezi in bara laterala o explicatie pentru acest lucru). Putem alege valori din ce in ce mai mici pentru 'rate:', pana spre '0', '0.25' avand viteza un sfert din cea initiala, '0.1' o zecime, etc. Incearca sa te joci cu niste valori mai joase si sa vezi cum sunetul e transforma intr-un huruit cu tonuri grave.

en: Speeding Samples Up
ro: Redarea esantioanelor cu viteza marita

en: In addition to making the sound longer and lower using a small rate, we can use higher rates to make the sound shorter and higher. Let's play with a drum loop this time. First, take a listen to how it sounds at the default rate of `1`:
ro: In afara de a face sunetul sa dureze mai mult si sa fie mai grav, putem sa il facem si mai scurt, dar mai acut, folosind valori mai mare pentru 'rate:'. Sa ne jucam cu un sunet de toba de data asta. Mai intai, sa ascultam cum suna la viteza normala:

en: Now, let's speed it up a little:
ro: Acum, sa il redam putin mai rapid:

en: Ha! We just moved musical genres from old-skool techno to jungle. Notice how the pitch of each drum hit is higher as well as how the whole rhythm speeds up. Now, try even higher rates and see how high and short you can make the drum loop. For example, if you use a rate of `100`, the drum loop turns into a click!
ro: Ha! Tocmai am schimbat genul muzical din old-skool techno in jungle. Observi ca tonalitatea pentru fiecare bataie de toba este mai inalta si tot ritmul este mai rapid, Acum, incearca viteze chiar mai mari si vezi cat de scurt si inalt poti face sunetul de toba. De exemplu, daca folosesti '100' pentru 'rate:', sunetul se transforma intr-un click!

en: Reverse Gear
ro: Marsarier

en: Now, I'm sure many of you are thinking the same thing right now... "what if you use a negative number for the rate?". Great question! Let's think about this for a moment. If our `rate:` opt signifies the speed with which the sample is played back, `1` being normal speed, `2` being double speed, `0.5` being half speed, `-1` must mean backwards! Let's try it on a snare. First, play it back at the normal rate:
ro: Sunt sigur ca multi dintre voi va ganditi acum... "dar daca as folosi o valoare negativa pentru viteza?". Buna intrebare! Sa ne gandim putin la acest lucru. Daca parametrul 'rate:' semnifica viteza cu care sunetul este redat, '1' fiind viteza normala, '2' fiind viteza dubla, '0.5' viteza injumatatita, '-1' trebuie sa insemne redare inversa! Sa incercam cu un sunet de toba. Mai intai, reda-l la viteza normala:

en: Now, play it backwards:
ro: Acum, reda-l de la coada la cap:

en: Of course, you can play it backwards twice as fast with a rate of `-2` or backwards at half speed with a rate of `-0.5`. Now, play around with different negative rates and have fun. It's particularly amusing with the `:misc_burp` sample!
ro: Desigur, il poti reda invers cu viteza dubla folosind valoarea '-2' sau cu viteza injumatatita folosind valoarea '-0.5' pentru 'rate:'. Acum joaca-te cu diferite viteze negative si distreaza-te. Este amuzant in special daca folosesti esantionul ':misc_burp'!

en: One of the effects of rate modification on samples is that faster rates result in the sample sounding higher in pitch and slower rates result in the sample sounding lower in pitch. Another place you may have heard this effect in every day life is when you're cycling or driving past a beeping pedestrian crossing - as you're heading towards the sound source the pitch is higher than when you're moving away from the sound - the so-called Doppler effect. Why is this?
ro: Unul dintre efectele modificarii vitezei esantioanelor este ca o redare mai rapida produce sunete mai inalte, iar una mai lenta duce la sunete mai joase. Acest efect poate fi intalnit in viata de zi cu zi cand mergi cu bicicleta si treci pe langa un semafor cu semnalizare sonora - cand te apropii de sursa sunetului tonalitatea este ma inalta decat atunci cand te indepartezi - efectul Doppler. De ce se intampla asta?

en: Let's consider a simple beep which is represented by a sine wave. If we use an oscilloscope to plot a beep, we'll see something like Figure A. If we plot a beep an octave higher, we'll see Figure B and an octave lower will look like Figure C. Notice that the waves of higher notes are more compact and the waves of lower notes are more spread out.
ro: Sa analizam un sunet simplu reprezentat ca o unda sinusoidala. Daca folosim un osciloscop pentru a vizualiza sunetul vom vedea ceva ca in figura A. Daca reprezentam un sunte mai inalt cu o octava, vom vedea figura B, iar cu o octava mai jos va arata ca in figura C. Observam ca undele pentru notele mai inalte sunt ai compacte, iar undele pentru notele mai joase sunt mai extinse.

en: A sample of a beep is nothing more than a lot of numbers (x, y, coordinates) which when plotted onto a graph will re-draw the original curves. See figure D where each circle represents a coordinate. To turn the coordinates back into audio, the computer works through each x value and sends the corresponding y value to the speakers. The trick here is that the rate at which the computer works through the x numbers does not have to be the same as the rate with which they were recorded. In other words, the space (representing an amount of time) between each circle can be stretched or compressed. So, if the computer walks through the x values faster than the original rate, it will have the effect of squashing the circles closer together which will result in a higher sounding beep. It will also make the beep shorter as we will work through all the circles faster. This is shown in Figure E.
ro: Un esantion pentru un sunet reprezinta doar un set de numere (coordonate x, y) care atunci cand sunt afisate grafic redeseneaza curbele initiale. Vezi figura D unde fiecare cerc reprezinta o coordonata. Pentru a transforma aceste coordonate inapoi in sunet, computerul parcurge fiecare coordonata x si trimite valoarea y corespunzatoare la difuzoare. Interesant este ca viteza cu care computerul parcurge valorile pentru x nu trebuie sa fie aceeasi cu cea cu care au fost inregistrate. Deci, cand computerul parcurge valorile pentru x mai rapid decat la inregistrare, efectul va fi de inghesuire a cercurilor, ceea ce va duce la un sunet mai inalt. Sunetul va fi deasemenea mai scurt, deoarece vom parcurge aceste valori mai repede. Acest lucru este aratat in figura E.

en: Finally, one last thing to know is that a mathematician called Fourier proved that any sound is actually lots and lots of sine waves all combined together. Therefore, when we compress and stretch any recorded sound we're actually stretching and compressing many sine waves all at the same time in exactly this manner.
ro: Un ultim lucru pe care trebuie sa-l stii este ca un matematician numit Fourier a demonstrat ca fiecare sunet este de fapt format dintr-o multime de unde sinusoidale combinate. Ca urmare, cand comprimam sau extindem un sunet inregistrat, de fapt comprimam sau extindem in acelasi timp mai multe unde sinusoidale in modul descris anterior.

en: Pitch Bending
ro: Modificarea tonalitatii

en: As we've seen, using a faster rate will make the sound higher in pitch and a slower rate will make the sound lower in pitch. A very simple and useful trick is to know that doubling the rate actually results in the pitch being an octave higher and inversely halving the rate results in the pitch being an octave lower. This means that for melodic samples, playing it alongside itself at double/half rates actually sounds rather nice:
ro: Asa cum am vazut, folosind o viteza de redare mai mare vom obtine un sunet cu o tonalitate mai inalta, iar o viteza mai mica va crea un sunet mai grav. O regula simpla spune ca dublarea vitezei va duce la un sunet cu o octava mai sus si invers, injumatatirea vitezei duce la un sunet cu o octava mai jos. Aceasta inseamna ca pentru esantioanele melodice redarea lor in paralel la viteza normala, dubla si injumatatita va suna chiar interesant:

en: However, what if we just want to alter the rate such that the pitch goes up one semitone (one note up on a piano)? Sonic Pi makes this very easy via the `rpitch:` opt:
ro: Totusi, ce ar trebui sa facem daca am dori doar sa schimbam viteza astfel incat sa crestem tonalitatea cu un semiton (cu o nota mai sus la pian)? Sonic Pi face acest lucru foarte usor folosind parametrul 'rpitch:':

en: If you take a look at the log on the right, you'll notice that an `rpitch:` of `3` actually corresponds to a rate of `1.1892` and a `rpitch:` of `7` corresponds to a rate of `1.4983`. Finally, we can even combine `rate:` and `rpitch:` opts:
ro: Daca arunci o privire la jurnalul din partea dreapta, vei observa ca o valoare de '3' pentru 'rpitch:' corespunde unei viteze ('rate:') de `1.1892` iar o valoare `rpitch:` de `7` corespunde unui 'rate:' de `1.4983`. In fine, putem chiar combina parametrii `rate:` si `rpitch:`:

en: Let's take a look at a simple piece which combines these ideas. Copy it into an empty Sonic Pi buffer, hit play, listen to it for a while and then use it as a starting point for your own piece. See how much fun it is to manipulate the playback rate of samples. As an added exercise try recording your own sounds and play around with the rate to see what crazy sounds you can make.
ro: Sa aruncam o privire la o bucata simpla care combina aceste idei. Copiaza codul intr-un buffer gol, apasa play si asculta putin apoi foloseste-l ca punct de pornire pentru propria ta piesa. Vezi cat de distractiv este sa modifici viteza de redare a esantioanelor. Ca exercitiu suplimentar, incearca sa inregistrezi propriile sunete si joca-te cu viteza de redare pentru a vedea ce sunete interesante poti obtine.

en: A.18 Sound Design - Additive Synthesis
ro: A.18 Design de sunet - Sinteza aditiva

en: Additive Synthesis
ro: Sinteza aditiva

en: Simple Combinations
ro: Combinatii simple

en: Let's start with the most basic sound there is - the humble pure-toned sine wave:
ro: Sa incepem cu cel mai simplu sunet - unda sinusoidala pura:

en: Now, let's see how this sounds combined with a square wave:
ro: Acum, sa vedem cum suna impreuna cu o unda rectangulara:

en: Notice how the two sounds combine to form a new, richer sound. Of course, we don't have to stop there, we can add as many sounds as we need. However, we need to be careful with how many sounds we add together. Just like when we mix paints to create new colours, adding too many colours will result in a messy brown, similarly - adding too many sounds together will result in a muddy sound.
ro: Ai observat cum cele doua sunete s-au combinat intr-unul nou, mai bogat. Desigur, nu trebuie sa ne oprim aici, putem adauga cate sunete ne trebuie. Totusi, trebuie sa avem grija cate sunete suprapunem. Asa cum atunci cand amestecam vopsele pentru a obtine noi culori, daca punem prea multe culori vom obtine un fel de maroniu murdar, in mod asemanator, amestecarea prea multor sunete va crea un nou sunet lipsit de claritate.

en: Blending
ro: Amestecarea

en: Let's add something to make it sound a little brighter. We could use a triangle wave at an octave higher (for that high bright sound) yet only play it at amp `0.4` so it adds something extra to the sound rather than taking it over:
ro: Sa adaugam ceva care va face sunetul mai viu. Am putea folosi o unda triunghiulara cu o octava mai sus (pentru un sunet viu inalt), dar sa o redam la o amplitudine de '0.4' astfel incat doar va adauga ceva sunetului in loc sa-l acapareze cu totul:

en: Now, try creating your own sounds by combining 2 or more synths at different octaves and amplitudes. Also, note that you can play around with each synth's opts to modify each source sound before it is mixed in for even more combinations of sounds.
ro: Acum, incearca sa creezi propriile tale sunete combinand 2 sau mai multe sintetizatoare in octave si cu amplitudini diferite. De asemenea, observa ca poti sa te joci cu fiecare dintre parametrii sintetizatoarelor pentru a modifica fiecare sunet sursa inainte de a-l adauga la mix pentru si mai multe combinatii de sunete.

en: Detuning
ro: Dezacordarea

en: So far, when combining our different synths we've used either the same pitch or switched octave. How might it sound if we didn't stick to octaves but instead chose a slightly higher or lower note? Let's try it:
ro: Pana acum, cand am combinat diferite sintetizatoare, fie am folosit aceeasi inaltime, fie am schimbat octava. Cum ar suna daca nu am respecta octavele ci am alege o nota putin mai inalta sau mai joasa? Sa incercam:

en: If we detune our square waves by 0.7 notes we hear something that perhaps doesn't sound in tune or correct - a 'bad' note. However, as we move closer to 0 it will sound less and less out of tune as the pitches of the two waves get closer and more similar. Try it for yourself! Change the `detune:` opt value from `0.7` to `0.5` and listen to the new sound. Try `0.2`, `0.1`, `0.05`, `0`. Each time you change the value, take a listen and see if you can hear how the sound is changing. Notice that low detune values such as `0.1` produce a really nice 'thick' sound, with both slightly different pitches interacting with each other in interesting, often surprising, ways.
ro: Daca decalam cele 2 unde rectangulare cu 0.7 note putem auzi ceva ce probabil nu suna corect, ci dezacordat - o nota 'gresita'. Totusi, pe masura ce ne apropiem de 0 va suna din ce in ce mai putin dezacordat, inaltimile celor doua unde devenind mai apropiate si mai asemanatoare. Incearca! Schimba valoarea pentru 'detune:' din '0.7' in '0.5' si asculta noul sunet. Incearca `0.2`, `0.1`, `0.05`, `0`. De fiecare data cand schimbi valoarea, asculta si incearca sa auzi cum se schimba sunetul. Observa ca un dezacord minor, cum ar fi cu '0.1' produce un sunet 'plin', cele doua inaltimi usor diferite interactionand in moduri interesante, adesea surprinzatoare.

en: Amplitude shaping
ro: Modelarea amplitudinii

en: Another way we can finely craft our sound is to use a different envelope and options for each synth trigger. For example this will allow you to make some aspects of the sound percussive and other aspects ring out for a period of time.
ro: O alta metoda prin care poti fasona sunetul este sa folosesti anvelope si parametri diferiti pentru fiecare sintetizator. De exemplu, aceasta iti va permite sa faci anumite parti ale sunetului mai percutante iar altele mai rasunatoare pentru un timp.

en: In the example above I have mixed in a noisy percussive element to the sound along with some more persistent background rumbling. This was achieved firstly by using two noise synths with middling cutoff values (`90` and `100`) using short release times along with a noise with a longer release time but with a low cutoff value (which makes the noise less crisp and more rumbly.)
ro: In exemplul de mai sus am combinat un element zgomotos percutant alaturi de un huruit de fundal mai persistent. Am realizat asta in primul rand folosind doua sintetizatoare de zgomot cu valorii medii de cutoff (`90` si `100`) si timp de release scurt, alaturi de un zgomot cu release mai lung, dar cu o valoare de cutoff mai joasa (care face zgomotul mai putin clar si mai huruitor).

en: Let's combine all these techniques to see if we can use additive synthesis to re-create a basic bell sound. I've broken this example into four sections. Firstly we have the 'hit' section which is the initial onset part of the bell sound - so uses a short envelope (e.g. a `release:` of around `0.1`). Next we have the long ringing section in which I'm using the pure sound of the sine wave. Notice that I'm often increasing the note by roughly `12` and `24` which are the number of notes in one and two octaves. I have also thrown in a couple of low sine waves to give the sound some bass and depth. Finally, I used `define` to wrap my code in a function which I can then use to play a melody. Try playing your own melody and also messing around with the contents of the `:bell` function until you create your own crazy sound to play with!
ro: Sa combinam toate aceste tehnici pentru a vedea daca putem folosi sinteza aditiva pentru a re-crea un sunet de clopot simplu. Am impartit acest exemplu in 4 sectiuni. In primul rand avem sectiunea 'hit' (lovitura) care reprezinta partea de atac a sunetului de clopot - deci utilizeaza o anvelopa scurta (de exemplu un 'release:' de aproximativ '0.1'). Apoi avem sectiunea mai lunga a sunetului de clopot in care folosesc o unda sinusoidala. Observi ca adesea cresc nota cu '12' sau '24', ceea ce reprezinta numarul de note din una, respectiv doua octave. Am mai adaugat si doua unde sinusoidale joase, pentru a da sunetului niste bass si profunzime. La final, am folosit 'define' pentru a ingloba codul intr-o functie pe care o pot apoi folosi pentru a canta o melodie. Incearca sa canti propria melodie si sa modifici continutul functiei ':bell' pana cand obtii niste sunete super tari cu care sa te joci!

en: A.19 Sound Design - Subtractive Synthesis
ro: A.19 Design de sunet - Sinteza substractiva

en: Subtractive Synthesis
ro: Sinteza substractiva

en: This is the second in a series of articles on how to use Sonic Pi for sound design. Last month we looked at additive synthesis which we discovered was the simple act of playing multiple sounds at the same time to make a new combined sound. For example we could combine different sounding synths or even the same synth at different pitches to build a new complex sound from simple ingredients. This month we'll look at a new technique commonly called *subtractive synthesis* which is simply the act of taking an existing complex sound and removing parts of it to create something new. This is a technique which is commonly associated with the sound of analog synthesisers of the 1960s and 1970s but also with the recent renaissance of modular analog synths through popular standards such as Eurorack.
ro: Acesta este al doilea articol dintr-o serie referitoare la felul in care poti dolosi Sonic Pi pentru design de sunet. Luna trecuta am vorbit despre sinteza aditiva care inseamna pur si simplu redarea mai multor sunete in acelasi timp pentru ca crea un sunet combinat. De exemplu, putem combina diferite sintetizatoare, sau chiar sunete de la acelasi sintetizator la intaltimi diferite pentru a crea un sunet nou, complex, pornind de la ingrediente simple. Luna aceasta vom descoperi o noua tehnica, numita *sinteza substractiva* care inseamna ca pornim de la un sunet complex si extragem parti din el pentru a crea ceva nou. Aceasta tehnica este asociata de obicei cu sunetul sintetizatoarelor analogice din anii '60 si '70, dar si cu recenta revigorare a sintetizatoarelor analogice modulare prin standarde populare, cum ar fi Eurorack.

en: Despite this sounding like a particularly complicated and advanced technique, Sonic Pi makes it surprisingly simple and easy - so let's dive right in.
ro: Desi suna ca o tehnica avansata si complicata, Sonic Pi face utilizarea ei surprinzator de facila. Sa intram direct in subiect.

en: Complex Source Signal
ro: Semnal sursa complex

en: For a sound to work well with subtractive synthesis, it typically needs to be fairly rich and interesting. This doesn't mean we need something hugely complex - in fact, just a standard `:square` or `:saw` wave will do:
ro: Pentru ca un sunet sa fie potrivit pentru sinteza substractiva, trebuie sa fie destul de bogat si interesant. Asta nu inseamna ca avem nevoie de ceva extrem de complex - de fapt, e suficienta o unda standard dreptunghiulara (`:square`) sau triunghiulara (`:saw`):

en: Notice that this sound is already pretty interesting and contains many different frequencies above `:e2` (the second E on a piano) which add to create the timbre. If that didn't make much sense to you, try comparing it with the `:beep`:
ro: Observi ca sunetul este deja destul de interesant si contine mult frecvente diferite mai sus de ':e2' (al doilea Mi la un pian) care se combina pentru a crea timbrul. Daca nu intelegi mare lucru din asta, incearca sa il compari cu un ':beep':

en: As the `:beep` synth is just a sine wave, you'll hear a much purer tone and only at `:e2` and none of the high crispy/buzzy sounds which you heard in the `:saw`. It's this buzziness and variation from a pure sine wave that we can play with when we use subtractive synthesis.
ro: Cum sintetizatorul ':beep' este o unda simpla sinusoidala, vei auzi un sunet mult mai pur, doar ':e2' fara nimic din sunetele mai inalte si mai bazaitoare care se aud la ':saw'. Cu acest zumzet care face diferenta fata de o unda sinusoidala ne putem juca pentru a aplica sinteza substractiva.

en: Once we have our raw source signal, the next step is to pass it through a filter of some kind which will modify the sound by removing or reducing parts of it. One of the most common filters used for subtractive synthesis is something called a low pass filter. This will allow all the low parts of the sound through but will reduce or remove the higher parts. Sonic Pi has a powerful yet simple to use FX system that includes a low pass filter, called `:lpf`. Let's play with it:
ro: Odata ce avem sunetul brut, urmatorul pas este sa-l trecem printr-un filtru care il va modifica scotand sau atenuand anumite parti din el. Unul dintre filtrele cele mai folosite in sinteza substractiva este ceea ce se numeste filtrul trece-jos. Acesta permite componentelor joase din sunet sa treaca, dar le scoate sau le atenueaza pe cele inalte. Sonic Pi are un sistem de efecte (FX) foarte simplu dar foarte puternic care include un filtru trece-jos, numit ':lpf' (low-pass filter). Sa ne jucam cu el:

en: If you listen carefully you'll hear how some of that buzziness and crispiness has been removed. In fact, all the frequencies in the sound above note `100` have been reduced or removed and only the ones below are still present in the sound. Try changing that `cutoff:` point to lower notes, say `70` and then `50` and compare the sounds.
ro: Daca asculti cu atentie vei observa ca o parte din zumzet a disparut. De fapt, toate frecventele din sunet mai sus de nota '100' au fost reduse sau eliminate si au ramas in sunet doar cele mai joase. Incearca sa schimbi aceasta valoare de 'cutoff:' la o nota mai joasa, sa zicem '70', apoi '50' si apoi compara sunetele.

en: Of course, the `:lpf` isn't the only filter you can use to manipulate the source signal. Another important FX is the high pass filter referred to as `:hpf` in Sonic Pi. This does the opposite to `:lpf` in that it lets the high parts of the sound through and cuts off the low parts.
ro: Desigur, ':lpf' nu este singurul filtru pe care il poti folosi pentru a modifica semnalul sursa. Un alt efect important care poate fi aplicat in Sonic Pi este filtrul trece-sus, numit ':hpf' (high pass filter). Acesta actioneaza invers decat ':lpf' prin aceea ca lasa sa treaca partile inalte ale sunetului si le taie pe cele joase.

en: Notice how this sounds much more buzzy and raspy now that all the low frequency sounds have been removed. Play around with the cutoff value - notice how lower values let more of the original bass parts of the source signal through and higher values sound increasingly tinny and quiet.
ro: Observi ca sunetul a devenit mai zumzaitor si mai strident prin eliminarea sunetelor de frecventa joasa. Joaca-te cu valoarea de cutoff - observa cum valorile mai joase lasa sa treaca mai mult din partile de bass originale, iar valorile mai mari fac sunetul mai "subtire" si mai linistit.

en: The low pass filter is such an important part of every subtractive synthesis toolkit that it's worth taking a deeper look at how it works. This diagram shows the same sound wave (the `:prophet` synth) with varying amounts of filtering. At the top, section A shows the audio wave with no filtering. Notice how the wave form is very pointy and contains lots of sharp edges. It is these hard, sharp angles that produce the high crispy/buzzy parts of the sound. Section B shows the low pass filter in action - notice how it is less pointy and more rounded than the wave form above. This means that the sound will have fewer high frequencies giving it a more mellow rounded feel. Section C shows the low pass filter with a fairly low cutoff value - this means that even more of the high frequencies have been removed from the signal resulting in an even softer, rounder wave form. Finally, notice how the size of the wave form, which represents the amplitude, decreases as we move from A to C. Subtractive synthesis works by removing parts of the signal which means that the overall amplitude is reduced as the amount of filtering that is taking place increases.
ro: Filtrul trece-jos este o parte foarte importanta a fiecarui instrument de sinteza substractiva si merita sa aruncam o privire mai atenta asupra felului in care functioneaza. Aceasta diagrama arata aceeasi unda sonora (sintetizatorul ':prophet') filtrata in mod diferit. In partea de sus, sectiunea A arata unda audio fara filtrare. Se observa ca forma de unda este foarte ascutita si contine multe variatii bruste. Aceste unghiuri ascutite produce bazaitul de tonalitate inalta din sunet. Sectiunea B arata cum actioneaza filtrul trece-jos - se observa ca unda este mai putin ascutita si mai rotunjita fata de cea dinainte. Asta inseamna ca sunetul va avea mai putine frecvente inalte si va suna mai cuminte. Sectiunea C arata filtrul trece-jos cu o frecventa de taiere destul de coborata - asta inseamna ca si mai multe dintre frecventele inalte au fost eliminate iar unda va fi si mai rotunjita. In fine, poti observa ca marimea undei (care reprezinta amplitudinea), scade de la A la C. Sinteza substractiva functioneaza prin elimnarea de parti din semnal, ceea ce inseamna ca amplitudinea globala scade cu atat mai mult cu cat filtrarea este mai intensa.

en: Filter Modulation
ro: Flitrarea modulata

en: So far we've just produced fairly static sounds. In other words, the sound doesn't change in any way for the entirety of its duration. Often you might want some movement in the sound to give the timbre some life. One way to achieve this is via filter modulation - changing the filter's options through time. Luckily Sonic Pi gives you powerful tools to manipulate an FX's opts through time. For example, you can set a slide time to each modulatable opt to specify how long it should take for the current value to linearly slide to the target value:
ro: Pana acum am produs sunete destul de statice. Cu alte cuvinte, sunetul nu se schimba in niciun fel pe toata durata sa. Uneori ai putea avea nevoie de o variatie a sunetului pentru a da viata timbrului. Un mod de a realiza acest lucru este sa aplici o filtrare modulata - adica sa schimbi parametrii filtrului in timp. Din fericire, Sonic Pi iti ofera unelte puternice pentru a manipula parametrii efectelor in timp. De exemplu, poti sa alegi un timp de variatie pentru fiecare parametru modulabil pentru a spune cat timp trebuie sa treaca pentru ca valoarea curenta sa se modifice liniar (slide) in valoarea tinta:

en: Let's take a quick look at what's going on here. Firstly we start an `:lpf` FX block as normal with an initial `cutoff:` of a very low `20`. However, the first line also finishes with the strange `|fx|` at the end. This is an optional part of the `with_fx` syntax which allows you to directly name and control the running FX synth. Line 2 does exactly this and controls the FX to set the `cutoff_slide:` opt to 4 and the new target `cutoff:` to be `130`. The FX will now start sliding the `cutoff:` opt's value from `50` to `130` over a period of 3 beats. Finally we also trigger a source signal synth so we can hear the effect of the modulated low pass filter.
ro: Sa vedem ce se petrece aici. Mai intai, pornim un flitru trece-jos cu o valoare foarte coborata ('50') pentru 'cutoff:'. Totusi, prima linie se termina in mod ciudat cu '|fx|'. Aceasta reprezinta o parte optionala din sintaxa pentru 'with_fx' care iti permite sa numesti si sa controlezi direct efectele care ruleaza. Linia 2 face exact acest lucru si controleaza efectul stabilindu-i timpul de glisare ('cutoff_slide') la 3 si valoarea tinta pentru 'cutoff:' la '130'. Valoarea pentru 'cutoff:' pentru acest efect va creste liniar de la '50' la '130' pe durata a 3 batai. La final vom proni un semnal sursa de la un sintetizator pentru a putea auzi efectul filtrului trece-jos modulat.

en: This is just a very basic taster of what's possible when you use filters to modify and change a source sound. Try playing with Sonic Pi's many built-in FX to see what crazy sounds you can design. If your sound feels too static, remember you can start modulating the options to create some movement.
ro: Acesta este doar un exemplu simplu pentru ce se poate obtine folosind filtrele pentru modificarea unor sunete. Incearca sa te joci cu multitudinea de efecte incluse in Sonic Pi si vezi ce sunete cool poti crea. Daca sunetul tau pare prea monoton, aminteste-ti ca poti modula parametrii sai pentru a ii da viata.

en: Let's finish by designing a function which will play a new sound created with subtractive synthesis. See if you can figure out what's going on here - and for the advanced Sonic Pi readers out there - see if you can work out why I wrapped everything inside a call to `at` (please send answers to @samaaron on Twitter).
ro: Sa incheiem creand o functie care va reda un sunet nou creat prin sinteza substractiva. Incearca sa-ti dai seama singur ce se petrece aici, iar daca esti un utilizator Sonic Pi avansat, spune-mi daca stii de ce am inglobat totul intr-un apel 'at' (te rog sa trimiti mesajul la @samaaron pe Twitter).

en: Essential Knowledge
ro: Cunostinte esentiale

en: This section will cover some very useful - in fact *essential* - knowledge for getting the most out of your Sonic Pi experience.
ro: Aceasta sectiune se va ocupa de cateva cunostinte foarte utile, *esentiale* de fapt pentru a beneficia din plin de experienta Sonic Pi.

en: We'll cover how to take advantage of the many keyboard shortcuts available to you, how to share your work and some tips on performing with Sonic Pi.
ro: Vom vedea cum poti sa folosesti multe dintre combinatiile de taste disponibile, cum sa impartasesti creatiile tale si cateva trucuri pentru interpretarea folosind Sonic Pi.

en: Using Shortcuts
ro: Folosirea combinatiilor de taste

en: Sonic Pi is as much an instrument as a coding environment. Shortcuts can therefore make playing Sonic Pi much more *efficient and natural* - especially when you're playing live in front of an audience.
ro: Sonic Pi este un instrument in aceeasi masura in care este si un mediu de programare. Combinatiile de taste pot face interpretarea folosind Sonic Pi *mai eficienta si mai naturala*, mai ales cand canti live in fata unei audiente.

en: Much of Sonic Pi can be controlled through the keyboard. As you gain more familiarity working and performing with Sonic Pi, you'll likely start using the shortcuts more and more. *I personally touch-type* (I recommend you consider learning too) and find myself frustrated whenever I need to reach for the mouse as it slows me down. I therefore use all of these shortcuts on a very regular basis!
ro: Sonic Pi poate fi controlat aproape complet folosind tastatura. Pe masura ce devii mai familiar cu interpretarea folosind Sonic Pi, probabil vei incepe sa folosesti din ce in ce mai mult combinatiile de taste. *Eu personal tastez fara sa privesc tastatura* (iti recomand sa incerci si tu sa inveti) si ma simt frustrat cand trebuie sa intind mana dupa mouse, deoarece ma incetineste. Ca urmare, eu folosesc aceste combinatii de taste in mod regulat!

en: Therefore, if you learn the shortcuts, you'll learn to use your keyboard effectively and you'll be live coding like a pro in no time.
ro: Ca urmare, daca inveti combinatiile de taste, vei invata sa folosesti eficient tastatura si vei programa live ca un profesionist cat de curand.

en: However, *don't try and learn them all at once*, just try and remember the ones you use most and then keep adding more to your practice.
ro: Totusi, *nu incerca sa le inveti pe toate odata*, incearca doar sa le memorezi pe cele pe care le utilizezi cel mai des si continua sa adaugi si altele pe parcurs.

en: Consistency across Platforms
ro: Coerenta intre diferite platforme

en: Imagine you're learning the clarinet. You'd expect all clarinets of all makes to have similar controls and fingerings. If they didn't, you'd have a tough time switching between different clarinets and you'd be stuck to using just one make.
ro: Imagineaza-ti ca ai invatat sa canti la clarinet. Te-ai astepta ca toate clarinetele sa aiba clape si inele asemanatoare. Daca nu ar avea, ti-ar fi greu sa treci de la un clarinet la altul si ai fi foratat sa folosesti mereu aceeasi marca.

en: Unfortunately the three major operating systems (Linux, Mac OS X and Windows) come with their own standard defaults for actions such as cut and paste etc. Sonic Pi will try and honour these standards. However *priority is placed on consistency across platforms* within Sonic Pi rather than attempting to conform to a given platform's standards. This means that when you learn the shortcuts whilst playing with Sonic Pi on your Raspberry Pi, you can move to the Mac or PC and feel right at home.
ro: Din pacate, cele trei sisteme de operare cele mai raspandite (Linux, Mac OS X si Windows) vin cu propriile combinatii implicite pentru diferite actiuni cum ar fi pentru copy/paste, etc. Sonic Pi va incerca sa respecte aceste standarde. Totusi, *prioritate are coerenta intre platforme* in cadrul Sonic Pi, nu respectarea standardelor unei anumite platforme. Asta inseamna ca daca ai invatat combinatiile folosind Sonic Pi pe Raspberry Pi, poti trece la versiunea de Mac sau PC si sa te simti ca acasa.

en: Control and Meta
ro: Control si Meta

en: Part of the notion of consistency is the naming of shortcuts. In Sonic Pi we use the names *Control* and *Meta* to refer to the two main combination keys. On all platforms *Control* is the same. However, on Linux and Windows, *Meta* is actually the *Alt* key while on Mac *Meta* is the *Command* key. For consistency we'll use the term *Meta* - just remember to map that to the appropriate key on your operating system.
ro: Notiunea de coerenta acopera si numele folosite pentru combinatiile de taste. In Sonic Pi folosim *Control* si *Meta* pentru a ne referi la 2 taste importante care fac parte din aceste combinatii. Pe toate platformele *Control* este la fel. In schimb, in Linux si Windows *Meta* este reprezentat de tasta *Alt*, iar pe Mac de tasta *Command*. Pentru coerenta vom folosi termenul *Meta* - tine minte sa il inlocuiesti cu tasta corespunzatoare pe sistemul tau de operare.

en: Abbreviations
ro: Abrevieri

en: To help keep things simple and readable, we'll use the abbreviations *C-* for *Control* plus another key and *M-* for *Meta* plus another key. For example, if a shortcut requires you to hold down both *Meta* and *r* we'll write that as `M-r`. The *-* just means "at the same time as."
ro: Pentru a pastra lucrurile simple si usor de citit, vom folosi abrevierile *C-* pentru *Control* plus alta tasta si *M-* pentru *Meta* plus alta tasta. De exemplu, daca o combinatie cere sa apesi *Meta* si *r*, o vom nota 'M-r'. *-* inseamna in acest caz "in acelasi timp cu".

en: The following are some of the shortcuts I find most useful.
ro: In continuare sunt cateva dintre combinatiile pe care le consider cele mai utile.

en: Stopping and starting
ro: Oprirea si pornirea

en: Instead of always reaching for the mouse to run your code, you can simply press `M-r`. Similarly, to stop running code you can press `M-s`.
ro: In loc sa iei de fiecare data mouse-ul ca sa apesi pe butonul Run, poti apasa 'M-r'. La fel, pentru a opri executia codului poti apasa 'M-s'.

en: Navigation
ro: Navigarea

en: I'm really lost without the navigation shortcuts. I therefore highly recommend you spend the time to learn them. These shortcuts also work extremely well when you've learned to touch type as they use the standard letters rather than requiring you to move your hand to the mouse or the arrow keys on your keyboard.
ro: Personal sunt pierdut fara aceste combinatii de taste. De aceea iti recomand cu caldura sa te apleci putin asupra lor. Aceste scurtaturi functioneaza foarte bine si cand inveti sa tastezi fara sa privesti tastatura deoarece folosesc litere obisnuite si nu e nevoie sa-ti misti mana dupa mouse sau dupa tastele sageti.

en: You can move to the beginning of the line with `C-a`, the end of the line with `C-e`, up a line with `C-p`, down a line with `C-n`, forward a character with `C-f`, and back a character with `C-b`. You can even delete all the characters from the cursor to the end of the line with `C-k`.
ro: Poti merge la inceputul liniei cu 'C-a', la sfarsit cu 'C-e', mai sus cu o linie cu 'C-p', mai jos cu o linie cu 'C-n', inainte cu un caracter cu 'C-f' si inapoi cu un caracter cu 'C-b'. Poti sterge toate caracterele de la cursor pana la sfarsitul liniei cu 'C-k'.

en: Tidy Code
ro: Cod mai ordonat

en: To auto-align your code simply press `M-m`.
ro: Pentru auto-alinierea codului apasa 'M-m'.

en: Help System
ro: Sistem de ajutor (help)

en: To toggle the help system you can press `M-i`. However, a much more useful shortcut to know is `C-i` which will look up the word underneath the cursor and display the docs if it finds anything. Instant help!
ro: Pentru a activa/dezactiva sistemul de ajutor poti apasa 'M-i'. O scurtatura mai utila este 'C-i' care va cauta cuvantul din spatele cursorului si va afisa documentatia aferenta daca il gaseste. Ajutor instantaneu!

en: For a full list take a look at section 10.2 Shortcut Cheatsheet.
ro: Pentru lista completa arunca o privire la sectiunea 10.2 Tabel de combinatii de taste.

en: Shortcut Cheatsheet
ro: Tabel de combinatii de taste

en: The following is a summary of the main shortcuts available within Sonic Pi. Please see Section 10.1 for motivation and background.
ro: Ceea ce urmeaza este un rezumat al principalelor combinatii de taste disponibile in Sonic Pi. Vezi sectiunea 10.1 pentru explicatii.

en: Conventions
ro: Conventii

en: In this list, we use the following conventions (where *Meta* is one of *Alt* on Windows/Linux or *Cmd* on Mac):
ro: In aceasta lista folosim urmatoarele conventii (unde *Meta* este *Alt* pentru Windows/Linux sau *Cmd* pentru Mac):

en: `C-a` means hold the *Control* key then press the *a* key whilst holding them both at the same time, then releasing.
ro: 'C-a' inseamna sa tii apasata tasta *Control* apoi sa apesi tasta *a* astfel incat sa fie ambele apasate simultan, apoi sa le eliberezi.

en: `M-r` means hold the *Meta* key and then press the *r* key whilst holding them both at the same time, then releasing.
ro: 'M-r' inseamna sa tii apasata tasta *Meta* apoi sa apesi tasta *r* astfel incat sa fie ambele apasate simultan, apoi sa le eliberezi.

en: `S-M-z` means hold the *Shift* key, then the *Meta* key, then finally the *z* key all at the same time, then releasing.
ro: 'S-M-z' inseamna sa tii apasata tasta *Shift*, apoi tasta *Meta*, apoi sa apesi tasta *z* astfel incat sa fie toate apasate simultan, apoi sa le eliberezi.

en: `C-M-f` means hold the *Control* key, then press *Meta* key, finally the *f* key all at the same time, then releasing.
ro: 'C-M-f' inseamna sa tii apasata tasta *Control*, apoi tasta *Meta*, apoi sa apesi tasta *f* astfel incat sa fie toate apasate simultan, apoi sa le eliberezi.

en: Main Application Manipulation
ro: Controlul aplicatiei principale

en: `M-r` - Run code
ro: `M-r` - Executa codul (Run)

en: `M-s` - Stop code
ro: `M-s` - Opreste codul (Stop)

en: `M-i` - Toggle Help System
ro: 'M-i' - Activeaza/dezactiveaza sistemul de ajutor (help)

en: `M-p` - Toggle Preferences
ro: `M-p` - Activeaza/dezactiveaza optiunile

en: `M-{` - Switch buffer to the left
ro: `M-{` - Comuta la buffer-ul din stanga

en: `M-}` - Switch buffer to the right
ro: `M-}` - Comuta la buffer-ul din dreapta

en: `M-+` - Increase text size of current buffer
ro: `M-+` - Creste dimensiunea textului in buffer-ul curent

en: `M--` - Decrease text size of current buffer
ro: `M--` - Micsoreaza dimensiunea textului in buffer-ul curent

en: Selection/Copy/Paste
ro: Selectie/Copy/Paste

en: `M-a` - Select all
ro: 'M-a' - Selecteaza tot

en: `M-c` - Copy selection to paste buffer
ro: `M-c` - Copiaza selectia in memorie

en: `M-]` - Copy selection to paste buffer
ro: `M-]` - Copiaza selectia in memorie

en: `M-x` - Cut selection to paste buffer
ro: `M-x` - Muta selectia in memorie (cut)

en: `C-]` - Cut selection to paste buffer
ro: `C-]` - Muta selectia in memorie (cut)

en: `C-k` - Cut to the end of the line
ro: `C-k` - Muta in memorie (cut) totul pana la sfarsitul liniei

en: `M-v` - Paste from paste buffer to editor
ro: `M-v` - Aduce din memorie (paste) in editor

en: `C-y` - Paste from paste buffer to editor
ro: `C-y` - Aduce din memorie (paste) in editor

en: `C-SPACE` - Set mark. Navigation will now manipulate highlighted region. Use `C-g` to escape.
ro: 'C-SPATIU' - Trece in mod evidentiere. Comenzile de navigare vor actiona in zona evidentiata. Foloseste 'C-g' ca sa revii in modul normal.

en: Text Manipulation
ro: Manipularea textului

en: `M-m` - Align all text
ro: 'M-m' - Aliniaza tot textul

en: `Tab` - Align current line or selection (or select autocompletion)
ro: `Tab` - Aliniaza linia sau selectia curenta (sau trece in modul auto-completare)

en: `C-l` - Centre editor
ro: `C-l` - Centreaza editorul

en: `M-/` - Comment/Uncomment current line or selection
ro: `M-/` - Transforma linia sau selectia curenta in comentariu/revine la text normal

en: `C-t` - Transpose/swap characters
ro: `C-t` - Inverseaza ordinea caracterelor

en: `M-u` - Convert next word (or selection) to upper case.
ro: `M-u` - Converteste urmatorul cuvant (sau selectie) la majuscule.

en: `M-l` - Convert next word (or selection) to lower case.
ro: `M-l` - Converteste urmatorul cuvant (sau selectie) la litere mici.

en: `C-a` - Move to beginning of line
ro: `C-a` - Merge la inceputul liniei

en: `C-e` - Move to end of line
ro: `C-e` - Merge la sfarsitul liniei

en: `C-p` - Move to previous line
ro: `C-p` - Merge la linia precedenta

en: `C-n` - Move to next line
ro: `C-n` - Merge la linia urmatoare

en: `C-f` - Move forward one character
ro: `C-f` - Merge inainte un caracter

en: `C-b` - Move backward one character
ro: `C-b` - Merge inapoi un caracter

en: `M-f` - Move forward one word
ro: `M-f` - Merge inainte un cuvant

en: `M-b` - Move backward one word
ro: `M-b` - Merge inapoi un cuvant

en: `C-M-n` - Move line or selection down
ro: `C-M-n` - Muta linia sau selectia in jos

en: `C-M-p` - Move line or selection up
ro: `C-M-p` -  Muta linia sau selectia in sus

en: `S-M-u` - Move up 10 lines
ro: `S-M-u` - Merge in sus 10 linii

en: `S-M-d` - Move down 10 lines
ro: `S-M-d` - Merge in jos 10 linii

en: `M-<` - Move to beginning of buffer
ro: `M-<` - Merge la inceputul buffer-ului

en: `M->` - Move to end of buffer
ro: `M->` - Merge la sfarsitul buffer-ului

en: Deletion
ro: Stergerea

en: `C-h` - Delete previous character
ro: `C-h` - Sterge caracterul precedent

en: `C-d` - Delete next character
ro: `C-d` - Sterge caracterul urmator

en: Advanced Editor Features
ro: Functii avansate ale editorului

en: `C-i` - Show docs for word under cursor
ro: `C-i` - Arata documentatia pentru cuvantul de la pozitia cursorului

en: `M-z` - Undo
ro: `M-z` - Undo (anuleaza ultima modificare)

en: `S-M-z` - Redo
ro: `S-M-z` - Redo (reface ultima modificare)

en: `C-g` - Escape
ro: `C-g` - Escape (Revine la modul anterior)

en: `S-M-f` - Toggle fullscreen mode
ro: `S-M-f` - Activeaza/dezactiveaza modul ecran complet

en: `S-M-b` - Toggle visibility of buttons
ro: `S-M-b` - Afiseaza/ascunde butoanele

en: `S-M-l` - Toggle visibility of log
ro: `S-M-l` - Afiseaza/ascunde jurnalul (log)

en: `S-M-m` - Toggle between light/dark modes
ro: `S-M-m` - Comuta intre modurile luminos/intunecat

en: `S-M-s` - Save contents of buffer to a file
ro: `S-M-s` - Salveaza continutul bufferului intr-un fisier

en: `S-M-o` - Load contents of buffer from a file
ro: `S-M-o` - Incarca dintr-un fisier continutul bufferului

en: Sharing
ro: Impartasirea creatiilor

en: Sonic Pi is all about sharing and learning with each other.
ro: Sonic Pi inseamna si impartasirea creatiilor sau sa inveti de la altii.

en: Once you've learned how to code music, sharing your compositions is as simple as sending an email containing your code. Please do *share* your code with others so they can *learn* from your work and even use parts in a new *mash-up*.
ro: Dupa ce vei invata cum sa programezi muzica, vei putea trasmite altora creatiile tale printr-un simplu email care contine codul. Te rog sa *impartasesti* si altora creatiile tale astfel incat ei sa poata *invata* de la tine si chiar sa foloseasca anumite parti intr-un aranjament nou.

en: If you're unsure of the best way to share your work with others I recommend putting your code on [GitHub](https://github.com) and your music on [SoundCloud](https://soundcloud.com). That way you'll be able to easily reach a large audience.
ro: Daca nu te-au decis inca in ce fel sa partajezi creatiile tale, iti recomand sa incarci codul pe [GitHub](https://github.com), iar muzica pe  [SoundCloud](https://soundcloud.com). In felul acesta te vei adresa unei audiente foarte largi.

en: Code -> GitHub
ro: Cod -> GitHub

en: [GitHub](https://github.com) is a site for sharing and working with code. It's used by professional developers as well as artists for sharing and collaborating with code. The simplest way to share a new piece of code (or even an unfinished piece) is to create a [Gist](https://gist.github.com). A [Gist](https://gist.github.com) is a simple way of uploading your code in a simple way that others can see, copy and share.
ro: [GitHub](https://github.com) este un site pentru partajarea codui si pentru lucrul in comun. Este folosit atat de programatori profesionisti cat si de artisiti pentru a-si face cunoscuta munca sau pentru proiecte in comun. Cel mai simplu mode de a partaja o bucata de cod (chiar si o piesa neterminata) este sa creezi un [Gist](https://gist.github.com). Un [Gist](https://gist.github.com) reprezinta o cale facile de a-ti incarca codul astfel incat altii sa-l poata vedea, copia si partaja.

en: Another important way of sharing your work is to record the audio and upload it to [SoundCloud](https://soundcloud.com). Once you've uploaded your piece, other users can comment and discuss your work. I also recommend placing a link to a [Gist](https://gist.github.com) of your code in the track description.
ro: O alta cale de a impartasi cu altii creatiile tale este sa inregistrezi sunetul si sa il incarci pe [SoundCloud](https://soundcloud.com). Odata ce ai incarcat o piesa, alti utilizatori vor putea sa o asculte si sa discute pe marginea ei. Iti recomand sa treci in descrierea piesei si un link catre un [Gist](https://gist.github.com) care contine codul.

en: To record your work, hit the `Rec` button in the toolbar, and recording starts immediately. Hit `Run` to start your code if it isn't already in progress. When you're done recording, press the flashing `Rec` button again, and you'll be prompted to enter a filename. The recording will be saved as a WAV file, which can be edited and converted to MP3 by any number of free programs (try Audacity for instance).
ro: Pentru a inregistra o piesa, apasa pe butonul 'Rec. Apasa 'Run' in cazul in care codul nu ruleaza deja. Cand ai terminat de inregistrat, apasa din nou butonul 'Rec' (care clipeste acum) si ti se va cere un nume pentru fisier. Inregistrarea va fi salvata ca fisier WAV, care poate fi modificat sau convertit in MP3 folosind unul dintre programele disponibile, multe gratuite. Poti incearca Audacity, de exemplu.

en: Hope
ro: Speranta

en: I encourage you to share your work and really hope that we'll all teach each other new tricks and moves with Sonic Pi. I'm really excited by what you'll have to show me.
ro: Te incurajez sa-ti impartasesti creatiile si sper ca vom invata unii de la altii noi trucuri cu Sonic Pi. Sunt foarte curios sa vad ce vei avea sa ne arati.

en: Performing
ro: Interpretarea

en: One of the most exciting aspects of Sonic Pi is that it enables you to use code as a *musical instrument*. This means that writing code live can now be seen as a new way of performing music.
ro: Unul dintre cele mai mari avantaje ale Sonic Pi este ca iti permite sa folosesti programarea ca pe un *instrument muzical*. Asta inseamna ca scrierea de cod live poate fi vazuta ca o noua metoda de a interpreta muzica in fata audientei.

en: We call this *Live Coding*.
ro: Numim asta *Programare live*.

en: Show Your Screen
ro: Arata imaginea de pe ecran

en: When you live code I recommend you *show your screen* to your audience. Otherwise it's like playing a guitar but hiding your fingers and the strings. When I practice at home I use a Raspberry Pi and a little mini projector on my living room wall. You could use your TV or one of your school/work projectors to give a show. Try it, it's a lot of fun.
ro: Iti recomand sa *arati imaginea de pe ecran* atunci cand programezi live. Altfel ar fi ca si cand ai canta la chitara ascunzandu-ti degetele si coardele. Cand exersez acasa folosesc un Raspberry Pi si un mini proiector ca sa vad imaginea pe peretele din living. Poti sa folosesti televizorul sau un proiector de la scoala sau de la birou ca sa arati imaginea. Incearca asta, e foarte distractiv.

en: Form a Band
ro: Creeaza o formatie

en: Live coding isn't completely new - a small number of people have been doing it for a few years now, typically using bespoke systems they've built for themselves. A great place to go and find out more about other live coders and systems is [TOPLAP](http://toplap.org).
ro: Programarea live nu este ceva complet nou, cateva persoane fac deja aste de cativa ani folosind de regula sisteme personalizate pe care si le-au construit singuri. Poti descoperi mai multe despre altii care practica programarea live si sistemele lor la [TOPLAP](http://toplap.org).

en: Another great resource for exploring the live coding world is [Algorave](http://algorave.com). Here you can find all about a specific strand of live coding for making music in nightclubs.
ro: Un alt loc in care poti afla mai multe despre lumea programarii live este [Algorave](http://algorave.com). Aici poti afla totul despre o ramura a programarii live specializata pe crearea de muzica in cluburi.

en: Sonic Pi now supports a simple API for interacting with Minecraft Pi - the special edition of Minecraft which is installed by default on the Raspberry Pi's Raspbian Linux-based operating system.
ro: Sonic Pi suporta acum un API simplu pentru a interactiona cu Minecraft Pi - versiunea speciala a Minecraft care este instalata implicita pe sistemul de operare Raspbian (bazat pe Linux) pentru Raspberry Pi.

en: No need to import libraries
ro: Nu este nevoie sa importi biblioteci

en: The Minecraft Pi integration has been designed to be insanely easy to use. All you need to do is to launch Minecraft Pi and create a world. You're then free to use the `mc_*` fns just like you might use `play` and `synth`. There's no need to import anything or install any libraries - it's all ready to go and works out of the box.
ro: Integrarea cu Minecraft Pi a fost gandita sa fie extrem de simplu de utilizat. Tot ce trebuie sa faci este sa pornesti Minecraft Pi si sa creezi o lume. Apoi poti folosi functiile 'mc_*' la fel cum folosesti 'play' sau 'synth'. Nu e nevoie sa importi nimic sau sa instalezi vreo bibilioteca de functii - totul este inclus si poate fi pornit imediat.

en: Automatic Connection
ro: Conectarea automata

en: The Minecraft Pi API takes care of managing your connection to the Minecraft Pi application. This means you don't need to worry about a thing. If you try and use the Minecraft Pi API when Minecraft Pi isn't open, Sonic Pi will politely tell you. Similarly, if you close Minecraft Pi whilst you're still running a `live_loop` that uses the API, the live loop will stop and politely tell you that it can't connect. To reconnect, just launch Minecraft Pi again and Sonic Pi will automatically detect and re-create the connection for you.
ro: Interfata de programare (API) pentru Minecraft Pi se ocupa de conectarea la aplicatia Minecraft Pi. Asta inseamna ca nu trebuie sa-ti mai bati tu capul cu asta. Daca incerci sa folosesti API-ul cand Minecraft Pi nu este pornit, Sonic Pi te va informa politicos despre acest lucru. La fel, daca inchizi Minecraft Pi in timp ce inca ruleaza un 'live_loop' care foloseste API-ul, bucla se va opri si iti va spune frumos ca nu poate sa se conecteze. Pentru a te reconecta, trebuie doar sa pornesti Minecraft Pi si Sonic Pi va detecta acest lucru automat si va reface conexiunea.

en: Designed to be Live Coded
ro: Facut pentru programarea live

en: The Minecraft Pi API has been designed to work seamlessly within `live_loop`s. This means it's possible to synchronise modifications in your Minecraft Pi worlds with modifications in your Sonic Pi sounds. Instant Minecraft-based music videos! Note however that Minecraft Pi is alpha software and is known to be slightly buggy. If you encounter any problems simply restart Minecraft Pi and carry on as before. Sonic Pi's automatic connection functionality will take care of things for you.
ro: API-ul pentru Minecraft Pi este facut sa mearga de la sine cu buclele live. Asta inseamna ca este posibil sa sincronizezi modificarile din lumea Minecraft Pi cu modificarile sunetelor din Sonic Pi. Poti obtine instantaneu videoclipuri muzicale bazate pe Minecraft! Tine cont totusi ca Minecraft Pi este un program inca in versiune alfa si este cunoscut pentru faptul ca mai are buguri. Daca intampini probleme, reporneste Minecraft Pi si continua de unde ai ramas. Functia de reconectare automata din Sonic Pi se va ocupa de restul.

en: Requires a Raspberry Pi 2.0
ro: Este nevoie de un Raspberry Pi cel putin versiunea 2.0

en: It is highly recommended that you use a Raspberry Pi 2 if you wish to run both Sonic Pi and Minecraft at the same time - especially if you want to use Sonic Pi's sound capabilities.
ro: Este recomandat sa folosesti macar un Raspberry Pi 2 daca vrei sa rulezi atat Sonic Pi cat si Minecraft in acelasi timp, mai ales daca vrei sa folosesti partea de sunet din Sonic Pi.

en: API Support
ro: Suportul pentru API

en: At this stage, Sonic Pi supports basic block and player manipulations which are detailed in Section 11.1. Support for event callbacks triggered by player interactions in the world is planned for a future release.
ro: In aceasta faza Sonic Pi ofera suport pentru modificari de baza legate de blocuri sau de jucator, asa cum sunt descrise in sectiunea 11.1. Suportul pentru functii care se executa cand actiunile jucatorului genereaza anumite evenimente este planificat pentru o versiune urmatoare.

en: Basic Minecraft Pi API
ro: Functii de baza din API-ul pentru Minecraft Pi

en: Sonic Pi currently supports the following basic interactions with Minecraft Pi:
ro: In acest moment Sonic Pi ofera suport pentru urmatoarele interactiuni cu Minecraft Pi:

en: Displaying chat messages
ro: Afisarea de mesaje in fereastra de chat

en: Setting the position of the user
ro: Modificarea pozitiei jucatorului

en: Getting the position of the user
ro: Aflarea pozitiei jucatorului

en: Setting the block type at a given coordinate
ro: Modificarea blocului aflat la anumite coordonate

en: Getting the block type at a given coordinate
ro: Aflarea tipului blocului aflat la anumite coordonate

en: Let's look at each of these in turn.
ro: Sa le analizam pe rand.

en: Let's see just how easy it is to control Minecraft Pi from Sonic Pi. First, make sure you have both Minecraft Pi and Sonic Pi open at the same time and also make sure you've entered a Minecraft world and can walk around.
ro: Sa vedem cat de usor este sa controlezi Minecraft Pi folosind Sonic Pi. Mai intai asigura-te ca atat Minecraft Pi cat si Sonic Pi sunt pornite si ca ai intrat intr-o lume Minecraft si poti sa te deplasezi in interiorul ei.

en: In a fresh Sonic Pi buffer simply enter the following code:
ro: Intr-un buffer gol din Sonic Pi introdu urmatorul cod:

en: When you hit the *Run* button, you'll see your message flash up on the Minecraft window. Congratulations, you've written your first Minecraft code! That was easy wasn't it.
ro: Cand apesi pe *Run* vei vedea mesajul tau aparand in fereastra Minecraft. Felicitari, ai scris prima linie de cod pentru Minecraft! A fost simplu, nu?

en: Now, let's try a little magic. Let's teleport ourselves somewhere! Try the following:
ro: Acum sa incercam o mica magie. Sa ne teleportam undeva. Incearca asta:

en: When you hit *Run* - boom! You're instantantly transported to a new place. Most likely it was somewhere in the sky and you fell down either to dry land or into water. Now, what are those numbers: `50, 50, 50`? They're the coordinates of the location you're trying to teleport to. Let's take a brief moment to explore what coordinates are and how they work because they're really, really important for programming Minecraft.
ro: Apasa pe *Run* si ... minune! Ai fost teleportat instantaneu intr-un nou loc. Cel mai probabul era undeva in vazduh si ai cazut intre timp pe sol sau in apa. Acum sa vedem ce reprezinta numerele astea: `50, 50, 50`. Sunt coordonatele locului in care incerci sa te teleportezi. Sa discutam putin despre ce inseamna coordonatele si cum functioneaza, deoarece sunt foarte importante pentru programarea in Minecraft.

en: Coordinates
ro: Coordonate

en: Imagine a pirate's map with a big `X` marking the location of some treasure. The exact location of the `X` can be described with two numbers - how far along the map from left to right and how far along the map from bottom to top. For example `10cm` across and `8cm` up. These two numbers `10` and `8` are coordinates. You could easily imagine describing the locations of other stashes of treasure with other pairs of numbers. Perhaps there's a big chest of gold at `2` across and `9` up...
ro: Sa ne imaginam o harta a piratilor cu un 'X' care marcheaza locul in care se afla o comoara. Pozitia exacta a 'X'-ului poate fi descrisa cu doua numere - cat de departe este de marginea din stanga si cat de departe de marginea de jos. De exemplu: '10 cm' la dreapta si '8 cm' in sus. Aceste doua numere, '10' si '8' sunt coordonatele. Poti sa-ti imaginezi usor cum ai descrie pozitiile altor cufere folosind alte perechi de numere. Poate un cufar cu mult aur se afla la '2' la dreapta si '9' in sus...

en: Now, in Minecraft two numbers isn't quite enough. We also need to know how high we are. We therefore need three numbers:
ro: In Minecraft doua numere nu sunt suficiente. Trebuie sa stim si inaltimea la care ne aflam, deci avem nevoie de trei numere:

en: How far from right to left in the world - `x`
ro: Cat de departe pe directia stanga-dreapta: 'x'

en: How far from front to back in the world - `z`
ro: Cat de departe pe directia inainte-inapoi: 'z'

en: How high up we are in the world - `y`
ro: Cat de sus ne aflam in lume: 'y'

en: One more thing - we typically describe these coordinates in this order `x`, `y`, `z`.
ro: Inca un lucru: de obicei trecem aceste coordonate in ordinea asta - 'x', 'y', 'z'.

en: Finding your current coordinates
ro: Aflarea coordonatelor curente

en: Let's have a play with coordinates. Navigate to a nice place in the Minecraft map and then switch over to Sonic Pi. Now enter the following:
ro: Sa ne jucam putin cu coordonatele. Mergi intr-un loc dragut in lumea Minecraft si apoi revino la fereastra Sonic Pi. Introdu textul asta:

en: When you hit the *Run* button you'll see the coordinates of your current position displayed in the log window. Take a note of them, then move forward in the world and try again. Notice how the coordinates changed! Now, I recommend you spend some time repeating exactly this - move a bit in the world, take a look at the coordinates and repeat. Do this until you start to get a feel for how the coordinates change when you move. Once you've understood how coordinates work, programming with the Minecraft API will be a complete breeze.
ro: Cand vei apasa pe butonul *Run* vei vedea coordonatele pozitiei curente afisate in fereastra jurnal. Priveste-le, apoi deplaseaza-te in lumea Minecraft si incearca din nou. Vei observa cum coordonatele s-au schimbat. Iti recomand sa repeti de cateva ori testul asta - te deplasezi putin in lumea Minecraft, vezi care sunt coordonatele, apoi reiei. Fa asta pana cand incepi sa simti in ce fel se schimba coordonatele atunci cand te deplasezi. Odata ce ai inteles cum functioneaza coordonatele, programarea cu API-ul Minecraft va fi floare la ureche.

en: Let's Build!
ro: Sa construim!

en: Now that you know how to find the current position and to teleport using coordinates, you have all the tools you need to start building things in Minecraft with code. Let's say you want to make the block with coordinates `40`, `50`, `60` to be glass. That's super easy:
ro: Acum ca stii sa afli pozitia curenta si sa te teleportezi folosind coordonatele, ai toate uneltele necesare pentru a incepe sa construiesti diferite lucruri in Minecraft prin programare. Sa spunem ca vrei ca blocul de la coordonatele `40`, `50`, `60` sa fie din sticla. E foarte usor:

en: Haha, it really was that easy. To see your handywork just teleport nearby and take a look:
ro: Ha, ha, a fost chiar usor. Ca sa vezi ce-ai mesterit teleporteaza-te in apropiere si arunca o privire:

en: Now turn around and you should see your glass block! Try changing it to diamond:
ro: Acum intoarce-te si ar trebui sa vezi blocul de sticla! Incearca sa-l transformi in diamant:

en: If you were looking in the right direction you might have even seen it change in front of your eyes! This is the start of something exciting...
ro: Daca te uitai in directia potrivita ai vazut chiar cum se schimba in fata ochilor tai! Acesta este inceputul unei aventuri incitante...

en: Looking at blocks
ro: Sa aruncam o privire asupra blocurilor

en: Let's look at one last thing before we move onto something a bit more involved. Given a set of coordinates we can ask Minecraft what the type of a specific block is. Let's try it with the diamond block you just created:
ro: Sa mai vedem un singur lucru inainte de a trece la ceva mai complicat. Avand un set de coordonate putem cere Minecraft sa ne spuna ce tip de bloc se afla acolo. Sa incercam cu blocul de diamant pe care tocmai l-ai creat:

en: Yey! It's `:diamond`. Try changing it back to glass and asking again - does it now say `:glass`? I'm sure it does :-)
ro: Da! Este ':diamond' (diamant). Incearca sa-l transformi iar in sticla si intreaba din nou. A raspuns ':glass' (sticla)? Sunt sigur ca da :)

en: Available block types
ro: Tipurile de blocuri disponibile

en: Before you go on a Minecraft Pi coding rampage, you might find this list of available block types useful:
ro: Inainte sa te dezlantui programand in Minecraft Pi, ai putea considera utila lista aceasta cu tipurile de blocuri disponibile:
