Skip to content

Commit 5105417

Browse files
Table of Contents, headers and live links added
1 parent 915d397 commit 5105417

File tree

1 file changed

+39
-18
lines changed

1 file changed

+39
-18
lines changed

Debugging.md

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -35,77 +35,96 @@ you will make mistakes along the way. Music Blocks provides a number
3535
of mechanisms, reviewed below, to help you explore ideas and find
3636
mistakes.
3737

38-
## 1. Clicking on an individual stack of blocks
38+
## <a>TABLE OF CONTENTS</a>
39+
40+
1. [Clicking on an Individual Stack of Blocks](#1-clicking-on-an-individual-stack-of-blocks)
41+
2. [Print and Comment Blocks](#2-print-and-comment-blocks)
42+
3. [Status Widget](#3-status-widget)
43+
4. [Playback Modes](#4-playback-modes)
44+
5. [Show and Hide blocks](#5-show-and-hide-blocks)
45+
6. [Browser Console](#6-browser-console)
46+
47+
## <a>1. Clicking on an Individual Stack of Blocks</a>
3948

4049
The *Play* button (in top left corner) will run all of the *Start*
4150
blocks simultaneously. (Every Music Blocks project has at least one
4251
*Start* block). But you can also run an individual stack of code by
4352
clicking on a stack. This lets you test and debug small sections of
4453
code, or, as in the example below, you can play a single voice by
4554
clicking on one of the *Start* blocks or single phase by clicking on
46-
one of the *Action* blocks.
55+
one of the *Action* blocks. [RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1732463245651983&run=True)
4756

48-
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/startblocks_debug_guide.png "Start blocks")
57+
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/startblocks_debug_guide.png "Start Blocks")
4958

50-
## 2. Print and Comment blocks
59+
## <a>2. Print and Comment Blocks</a>
60+
61+
[Back to Table of Contents](#table-of-contents)
5162

5263
The *Print* block (found on the *Extras* palette) can be used to print
5364
a message while running a program. It is useful to determine if a
5465
section of code is being executed when expected or if a box or
5566
parameter contains an expected value.
5667

57-
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/print_example2_debug_guide.png "Print blocks")
68+
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/print_example2_debug_guide.png "Print Block")
5869

5970
The *Print* block is used to display the number of whole notes played,
6071
in this case, `1/4 + 1/4 + 1/2`, which adds up to `1`, which is
61-
displayed at the top of the browser window.
72+
displayed at the top of the browser window. [RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1732474452574359&run=True)
6273

6374
The *Comment* block (also found on the *Extras* palette) is similar to
6475
the *Print* block, except it only prints a message when the program is
6576
being run in *Playback Slow* mode (See below). Comments are also
66-
written to the browser console.
77+
written to the browser console. [RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1732825564345176&run=True)
78+
79+
![Comment Block](./images/Comment_block_DebuggingMd.svg "Comment Block")
6780

68-
## 3. Status widget
81+
## <a>3. Status Widget</a>
6982

70-
![alt tag](https://rawgithub.com/sugarlabs/musicblocks/master/guide/status1.svg "given Music block")
83+
[Back to Table of Contents](#table-of-contents)
7184

72-
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/status_example_debug_guide.png "status in tabular form")
85+
![Status Widget Block](./images/Status_widget_debuggingMd.svg "Status Widget Block")
86+
87+
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/status_example_debug_guide.png "Status in tabular form")
7388

7489
The *Status widget* is a tool for inspecting the status of Music
7590
Blocks as it is running. By default, the key, BPM, and volume are
7691
displayed. Also, each note is displayed as it is played. There is one
77-
row per voice in the status table.
92+
row per voice in the status table. [RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1732541757152077&run=True)
7893

7994
Additional *Print* blocks can be added to the *Status* widget to
8095
display additional music factors, e.g., duplicate, transposition,
8196
skip, [staccato](#MORE-TRANSFORMATIONS),
8297
[slur](#MORE-TRANSFORMATIONS), and [graphics](#GRAPHICS) factors,
8398
e.g., x, y, heading, color, shade, grey, and pensize.
8499

85-
![alt tag](https://rawgithub.com/sugarlabs/musicblocks/master/guide/status3.svg "additional programming within the Status block")
100+
![Additional Programming within the Status Widget Block](./images/Status_Widget_additional_programming_DebuggingMd.svg "Additional Programming within the Status Widget Block")
86101

87102
You can do additional programming within the status block. In the
88103
example above, `whole notes played` is multiplied by `4` (e.g. quarter notes)
89-
before being displayed.
104+
before being displayed. [RUN LIVE](https://musicblocks.sugarlabs.org/index.html?id=1732553086132345&run=True)
105+
106+
## <a>4. Playback Modes</a>
90107

91-
## 4. Playback modes
108+
[Back to Table of Contents](#table-of-contents)
92109

93110
Clicking on the Play button will play your program at full speed.
94111
(It will also hide the blocks while the program runs, which improves
95112
performance.) But there are two other playback modes.
96113

97114
On the Secondary Menu, there are two other Play buttons.
98115

99-
During Playback Slow mode the program will pause between the execution
116+
During *Playback Slow* mode the program will pause between the execution
100117
of each block and the block being executed will be highlighted. This is
101118
useful for following program flow, ensuring that the sequence of blocks
102119
being executed is what you expect. In addition, the value stored in any
103120
box or parameter is displayed on the block as the program runs, so you
104121
can "inspect" program elements as the program runs.
105122

106-
Run Step by Step advances one block per button press.
123+
*Run Step by Step* advances one block per button press.
107124

108-
## 5. Show and Hide blocks
125+
## <a>5. Show and Hide blocks</a>
126+
127+
[Back to Table of Contents](#table-of-contents)
109128

110129
The *Show* and *Hide* blocks (found on the *Extras* palette) are
111130
useful for setting
@@ -117,7 +136,7 @@ gets to the *Show* block. Then the blocks are displayed and
117136
run in *Playback Slow* mode. When the *Hide* block is encountered, the
118137
blocks are hidden and the program resumes running at full speed.
119138

120-
## 6. Browser console
139+
## <a>6. Browser Console</a>
121140

122141
As Music Blocks runs, some debugging information is written to the
123142
browser console, such as the notes being played and comments (See the
@@ -127,3 +146,5 @@ browser console, such as the notes being played and comments (See the
127146
![alt tag](https://github.com/sugarlabs/musicblocks/blob/master/images/browserconsole_debug_guide.png "Console blocks")
128147

129148
Shown above is the console output from three notes: `sol mi sol`.
149+
150+
[Back to Table of Contents](#table-of-contents)

0 commit comments

Comments
 (0)