Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
501 changes: 501 additions & 0 deletions guide/Actions.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
847 changes: 847 additions & 0 deletions guide/Heaps.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 27 additions & 2 deletions guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,35 @@ notation well enough to guess the outcome? Are you familiar with the
song we created?)
[RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1725791527821787&run=True)

### <a name="Heaps">3.1.1 Heaps</a>
![actions](./Actions.svg "running the heap using an simple coin example")

### <a name="PITCH-TRANSFORMATION">3.2 Pitch Transformations</a>
A heap in Music Blocks is just like a stack of pancakes. Imagine you are making pancakes for breakfast. You make one
pancake and place it on a plate. Then you make another one and stack it right on top of the first. Then you make a third
pancake and put that one on top of the second. Now you have a tall stack of three pancakes — one on top of the other.

There are many ways to transform pitch, rhythm, and other sonic qualities.
When it’s time to eat, you don’t start from the bottom pancake. That would be really messy! Instead, you take the top
pancake first, because it’s the easiest to grab. After you eat that, you take the next one underneath, and finally the
last one at the bottom.

That’s exactly how a heap works in Music Blocks. It remembers the things you put in it, like notes or numbers, but it
always gives you back the last thing you added — just like how you eat the top pancake first. For example, if you push
note 60 into a heap, then 62, then 64 — and then start popping them out — you’ll get 64 first, then 62, then 60.

So, a heap is like your musical pancake stack: the last note you added is always the first one to play when you take it
out. It's a fun and easy way to build backwards patterns or save notes for later. Just remember: heaps serve your notes
like pancakes — from the top down!

[RUN LIVE][https://musicblocks.sugarlabs.org/index.html?id=1725791527821787&run=True]

### <a name="box">3.1.2 Box</a>
![actions](./box.svg "demostration of how box work in mb")

Boxes are parts inside a block that store the block’s data or connect it to other blocks. Every block in Music Blocks does something — like playing a note, repeating an action, or setting a value. But to do its job, a block often needs extra information (like how many times to repeat, which note to play, etc.).

In summary, the example illustrates the use of boxes as fundamental units for storing and manipulating data, with operations like push and print acting on them. This concept mirrors real-world programming, where variables and data structures are used to organize and process information efficiently. The simplicity of the example makes it a clear introduction to how boxes function in a computational context.

[RUN LIVE][https://musicblocks.sugarlabs.org/index.html?id=1725791527821787&run=True]

#### <a name="STEP-PITCH">3.2.1 Step Pitch Block</a>

Expand Down
288 changes: 288 additions & 0 deletions guide/box.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions guide/boxes.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added guide/heaps.ogx
Binary file not shown.
Loading