Pianotypes Devlog 5

Not many code changes as of late but I’ve been more active on one of the packages I’m using to play sound, smplr. It’s such an amazing package for playing instrument sounds with an incredibly simple and powerful api. Kudos to danigb. A bunch of new changes were made recently that have added some awesome features as well as some bugs I found while using them. Note Scheduling Throughput The first change was a tweak to note scheduling that fixes an issue of the web audio getting overloaded and introducing lot’s of static....

October 1, 2023

Habits and Goals and Gratitude

Having Goals I have goals and I like the fact that I do. It makes me feel like I have purpose, that I have some direction I need to follow. However, it often feels suffocating, demotivating, it makes me feel envious of others, it makes me feel that I’m unaccomplished or that I’m falling behind because of I haven’t done enough. These are the feelings of having goals. But how do you achieve goals....

September 28, 2023

Stack and Heap

Declaring Data Structures on the Heap https://stackoverflow.com/questions/8036474/when-vectors-are-allocated-do-they-use-memory-on-the-heap-or-the-stack vector<Type> vect; will allocate the vector, i.e. the header info, on the stack, but the elements on the free store (“heap”). vector<Type> *vect = new vector<Type>; allocates everything on the free store (except vect pointer, which is on the stack). vector<Type*> vect; will allocate the vector on the stack and a bunch of pointers on the free store, but where these point is determined by how you use them (you could point element 0 to the free store and element 1 to the stack, say)....

September 27, 2023

Useful Linear Algebra

Dot Product Find the interior angle between two vectors $$ A\cdot B = |A||B|cos\theta $$ $$ \theta = \arccos(\dfrac{A\cdot B}{|A||B|}) $$ $$ where\ A\cdot B = A_x \times A_y + B_x \times B_y $$ Cross Product Get perpendicular vector from two vectors Find area created by two vectors (for 2D, parallelogram area, for 3D, parallelepiped area) This is the magnitude of perpendicular vector Matrix Multiplication There is a formula for calculating the resultant matrix from a matrix multiplication....

September 25, 2023

Dot Product and How it Relates to Light

What Matters The dot product has a bunch of properties when you use it’s raw scalar output but honestly most of the times you will use the dot product is to find the angle between two vectors by rearranging to equation as follows $$ A\cdot B = |A||B|cos\theta $$ $$ \theta = \arccos(\dfrac{A\cdot B}{|A||B|}) $$ $$ where\ A\cdot B = A_x \times A_y + B_x \times B_y $$ In games, this equation is used exhaustively to calculate light projections and field of view....

September 14, 2023

Signed Ints and Two's Complement

Two’s Complement Representation Why We Use It In c++, signed integers are represented in two’s complement notation. Before I get to how that notation works, I want to explain why we use it. Comparing both representations, -1 would look like this // Decimal 4294967295 // Binary Signed Int 10000000000000000000000000000001 // Two's Complement Signed Int 11111111111111111111111111111111 The normal signed binary representation is pretty easily understood if you know what a sign bit is....

September 12, 2023

PGDAP Log 2

I’m on my second week and to my surprise, all my anxieties and insecurities subsided really quickly. It had been while since I’ve had a proper schedule or talk to people in person on a frequent basis but I’m glad at how smoothly I’ve been able to reacclimate and I’ve been feeling a lot happier as a result. Anyways so far, it’s just been a lot of intro talk and fundamentals of concepts I’ve already learned before....

September 12, 2023

Starting the School Year

Today is my first official day of class attending the Advanced Programming program at Sheridan College. To commemorate this, I’ve reorganized my whole directory structure for this blog to be organized by year and month rather than sub topics. I’ve been finding the subtopic folders to be growing far to fast (particularly the dev folder) to keep posting all in one place. This way, my working directory is ever only so large for each month and I’m also relieved of the duty of figuring out which folder I should be making my post in....

September 5, 2023

Pianotypes Devlog 5

I finally put a start into replacing the current ribbon visualizer implementation with an HTML canvas drawn one. Why Bother? To reiterate, the current visualizers works by filling the screen with vertical divs that are positioned identically to the piano keys so each key essentially has a identically width column above it. I then spawn divs inside each lane that act as each of the ribbons. The extending animation works by settings each ribbon to the max size of the lane and running a scaleY transition from 0 to 1 to mimic the ribbon growing from nothing....

September 4, 2023

Shader Layering

I’ve been working on putting together a layered parallax scene as per https://www.youtube.com/watch?v=XaiYKkxvrFM. I’m a good ways there writing most of the code on my own. I’ve made series of repeating trees across a sloping hill and it’s time for me to start layering them on top with a for loop. In the tutorial, he wrote all of the shape functions to return vec4 so they include the alpha channel in addition to the colours....

August 26, 2023