![]() each time our program starts, processing fills the candy space with candies. This imaginary candy space is full of candies of different colors. the z represents the depth, so we no longer are limited to the display surface, but we can imagine objects behind the display and objects in front of the display. we are used to x and y now from working with the screen. to locate each candy we need to give noise() three parameters: x, y and z. we present noise as a function that picks up candies from inside a box. When we use noise() with one parameter processing assumes the missing two parameters are 0. Try to use noise() in any of the programs we created in past episodes! ![]() for example if we multiply noise() by 100, we will get a number between 0 and 100. we solve this by multiplying whatever number comes out of noise(). Normally we will be interested in ranges of numbers greater than the default 0. this is great for animating positions, sizes, rotation or colors. So if i call noise(3.00) and then noise(3.01), they will return a random number, but in both cases the number will not be very different. the only parameter used in noise() is used to get random numbers that do not change too much. the parameters used when calling random set the minimum and maximum values. random() returns a number between a minimum and a maximum value. There are some differences between random() and noise(). the noise() function allows us to get that kind of random numbers. things in real life do not jump from place to place, but move in small increments. we could say random() has one problem: it's too random. We have used random() in many of our episodes. It is possible to convert from one type to another. The reason i used float is because random() gives you back a float. other available types are "string" (for text), "int" (for integer numbers like 6 or -523), or "boolean" (for true/false). a "float" is like a box that can store numbers with decimals (like 6.259305). you have to choose the right kind of box for your item. imagine having boxes that could only contain pencils, or only bananas. this means each box can only store certain types of things. New: sam below requested more info about "float", so here it goes: variables (these boxes where you can store things) in processing have a "type". to make sure both points are at the same distance from the top (both have the same y value), we use twice a variable that contains our y value. a variable is like a box where we can store a value and reuse this same value multiple times in our program.Ī horizontal line has a starting and an ending point, and both are at the same distance from the top border of the screen. to achieve this we use "variables" for the first time. Modify the program from episode 6 to make all lines horizontal. If you type the code yourself :) Interesting links The source code for all episodes, but you will learn more Where NNN is the episode number you want, then click download. ![]() It always makes me happy to see what you create, no matter how simple :) The SuperCollider forum can be found here. If you are stuck with a Processing project, You can post questions and comments below each video. Have fun mixing code and your creativity! The newer episodes combine graphics generated with ProcessingĪnd sound produced with the SuperCollider The first episodes talk about a programming language To explain one idea, and builds on top of previous episodes. Most episodes include a very short program that tries This is my attempt to share with you how I learnt coding. That's how I learnt programming and math: byĮxperimenting and building things I could see and hear. Playing with graphics and sound is a great way Programming can be fun and a very creative activity.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |