Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add design document for Masonry (previously Project-builder/code-builder) #404

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 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
359 changes: 359 additions & 0 deletions modules/code-builder/docs/Masonry_Design_Document.md

Large diffs are not rendered by default.

177 changes: 177 additions & 0 deletions modules/code-builder/docs/PRD.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@

# Product Requirements Document (PRD): Masonry Framework

## 1. Bricks

### a. Brick Types

#### 1. Data Bricks: These represent simple data values, such as numbers or strings, and serve as inputs for other bricks.
- Number Data Brick (representing note values, durations, etc.)

![duration bricks](./images/image.png)
- String Data Brick (representing note names, pitches, etc.)

![pitches and note names](./images/image-1.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are two variations to these. Ones that allow editing and ones that don't. 10 is editable, sol isn't. Might be worth discussing if we'd want specific visual characteristics for ones that can be edited. For instance, Scratch and Blockly have textboxes and dropdowns.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, after reviews from others , we can finalize things. For now we can add these sub points to each data brick:

  • Editable Data Bricks: Contain editable text fields or drop-down menus for selecting predefined options.
  • Non-editable Data Bricks: Display fixed note names or pitches.


#### 2. Expression Bricks: These perform logical or mathematical operations.
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved
- Equal Expression Brick
- Not Equal Expression Brick
- Greater Than Expression Brick
- Less Than Expression Brick
- And Expression Brick
- Or Expression Brick
- Not Expression Brick
- Random Expression Brick
- Length Expression Brick
- Letter Expression Brick
- Number Expression Brick
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved

![alt text](./images/image-2.png)

#### 3. Statement Bricks: These define actions to be taken.
- Play Note Statement Brick
- Rest Statement Brick
- Set Instrument Statement Brick
- Increase Volume Statement Brick
- Decrease Volume Statement Brick
- Set Tempo Statement Brick
- Set Key Statement Brick
- Set Mode Statement Brick
- Start Drum Statement Brick
- Start Chord Statement Brick
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved

![example](./images/image-3.png)

#### 4. Brick Bricks:
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved
- Repeat Brick
- Forever Brick
- If Brick
- If-Else Brick
- Action Brick
- Start Brick
- Clamp Brick
- Store In Brick
- Box Brick
- Pitch Brick
- Rhythm Brick
- Meter Brick (representing time signatures)
- Volume Brick
- Articulation Brick
- Pitch-Time Matrix Brick
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved

### b. Brick Appearance
- **Distinct Shapes**: Each brick type has a unique shape to differentiate its function visually.
- **Colors**: Color-coding helps users quickly identify the type of brick.
- **Icons and Labels**: Visual symbols and text labels indicate the brick's function.
- **Input/Output Ports**: Connectors visually represent where bricks can attach to each other.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add a bit for specific information.

- **Editable Text Labels/Fields**: Users can input data directly into the bricks, such as note names, durations, and numerical values.

### c. Brick Interactions
- **Inline Text Editing**: Users can click on text fields within bricks to edit labels and values directly.
![alt text](./images/image-4.png)
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved
- **Drop-Down Menus/Selectors**: For choosing predefined options, enhancing ease of use.
- **Dedicated Editors/Dialogs**: For more complex properties, a separate interface allows detailed configuration.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What in specific? Also I think you meant to add the image for the previous bullet.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct? If yes, will attach a screenshot in the file. Also tell me how much detail is required

  • Drop-Down Menus/Selectors: For choosing predefined options from a list, enhancing ease of use and reducing the potential for user errors.
    • Clearly labeled drop-down menus or selector widgets within the bricks, indicating the type of option to be chosen.
    • Visual cues or icons alongside the menu options for better recognition and understanding.
    • Keyboard navigation support (e.g., up/down arrows, type-ahead search) for efficient option selection.
    • Customizable menu styles (fonts, colors, icons) to match the application's visual theme.
    • Tooltips or descriptions for each menu option, providing additional context or guidance.
    • Validation and error handling for invalid or unsupported selections.
    • Examples:
      • A drop-down menu within a Pitch Brick to select a specific note name (C, D, E, F, G, A, B).
      • A drop-down menu within an Instrument Brick to select from a list of available instrument sounds (Piano, Guitar, Violin, etc.).
      • A selector within a Duration Brick to choose from predefined note duration values (whole, half, quarter, eighth, etc.).
Screencast.from.17-05-24.09.46.57.PM.IST.webm

Example: A drop-down menu within a Pitch Brick to select a specific note name (C, D, E, F, G, A, B).

![alt text](./images/image-5.png)
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved
- **Resizing and Rotation**: Bricks can be resized and rotated to fit the workspace better.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"scale"

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct?

  • Drop-Down Menus/Selectors: For choosing predefined options, enhancing ease of use.
  • Dedicated Editors/Dialogs: For more complex properties, a separate interface allows detailed configuration.
    alt text
  • Scaling and Rotation: Bricks can be scaled (resized) and rotated to fit the workspace better.

- **Cloning/Duplication**: Users can easily create copies of bricks for repeated use.
- **Context Menus**: Right-click options for advanced customization and settings.

## 2. Stack of Bricks

### a. Stack Validation:
- **Visual Feedback**: Indicators show whether brick combinations are valid.

![alt text](./images/image-6.png)
- **Error Indicators**: Explanations for incompatible connections help users troubleshoot.
- Add a reddish boundary for users to easily tell whether the bricks are mergeable or not.
![alt text](./images/image-7.png)


- **Disable Validation**: Temporarily turn off validation for complex or experimental setups.

### b. Stack Editing:
- **Connection Editing**: Options for rerouting, splitting, or merging connections.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rerouting as in? pick from one connection and drop somewhere else?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Connection Editing: Options for rerouting (i.e., picking a connection from one point and dropping it somewhere else), splitting, or merging connections.

- **Quick Edit Shortcuts**: Context menus or keyboard shortcuts speed up editing.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add some examples.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will discuss in a meet. Ig nothing like this exists as of now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a note on the lines of "this is up for further discussion"

- **Undo/Redo**: Users can revert or reapply changes to their stacks.

### c. Stack Grouping:
- **Grouping Bricks**: Multiple bricks or connections can be grouped for better organization.
![alt text](./images/image-8.png)
- **Visual Boundaries**: Outlines or boundaries define groups clearly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think I understand these two.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Grouping Bricks: Multiple bricks or connections can be grouped together to form a single unit, allowing for better organization and easier management. For example, if you have a set of bricks that define a musical phrase, you can group them together to move or edit them as one.

image

  • Visual Boundaries: Clear outlines or boundaries around groups of bricks visually indicate the grouped unit, helping users distinguish between different groups. This might involve a colored border or a shaded background around the group to make it stand out. (This is an additional feature to be discussed with community)

- **Collapsible Groups**: Groups can be collapsed or expanded to manage complexity.

![alt text](./images/image-9.png)


## 3. Palette:
### a. **Layout and Organization**:
- Collapsible/expandable categories or sections for different Brick types
- Customizable order and arrangement of categories
- Visual separators or dividers between categories

![alt text](./images/image-10.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to compare with what Scratch has. Is there a sizeable benefit to being able to toggle the list on/off if we made the left list narrower?

For another point, we could also consider discussing grouping similar bricks in the right list, e.g. there are 7 variations of "note".


### b. **Brick Previews**:
- Thumbnail or icon previews for each Brick within a category
- Tooltips or pop-ups displaying Brick names and brief descriptions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some examples maybe?

- Color-coding or visual cues for distinguishing different Brick types

### c. **Search and Filtering**:
- Search bar or input field for locating specific Bricks by name or keyword
- Filter options for narrowing down Bricks based on category, type, or properties
- Live search results or suggestions as the user types
meganindya marked this conversation as resolved.
Show resolved Hide resolved

![alt text](./images//image-11.png)

### d. **Drag and Drop**:
- Ability to drag and drop Bricks from the palette onto the workspace
- Visual indicators (e.g., ghost preview, outline) for valid drop locations
- Snap-to-grid or precise positioning when dropping Bricks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps a bit more details about these two.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct?

  • Visual indicators (e.g., ghost preview, outline) for valid drop locations: When dragging a Brick from the palette to the workspace, a semi-transparent "ghost" image of the Brick appears to show where it will be placed. Additionally, an outline or highlight may appear on valid drop areas to guide the user.
  • Snap-to-grid or precise positioning when dropping Bricks: Bricks will align to a grid to ensure organized placement. Users can also position Bricks precisely according to their preferences. This helps maintain a clean and structured workspace, and users can toggle snapping on or off depending on their needs.


![alt text](./images/image-12.png)

### e. **Brick Creation**:
- Options for creating new Bricks or Brick instances directly from the palette
- Context menus or shortcuts for duplicating or cloning existing Bricks
- Visual feedback or animations when creating or instantiating new Bricks
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Creating as in?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added this point in regards to a bi-weekly meet where it was discussed to have some kind of custom thing there users can create bricks(ex, Happy birthday some-one wants to play, so user can instantiate that stack of bricks required to create a Happy birthday program in MB and then name it "Happy-birthday-brick" and drag it) from the palette itself.
This would be a feature that may or may not be implemented but it came across my mind so I wrote it down


### f. **Customization**:
- User-defined categories or custom groupings for organizing Bricks
- Ability to rename, reorder, or hide/show specific categories
- Import/export functionality for sharing or backing up custom palette configurations

### g. **Palette Behavior**:
- Dockable or floating palette panel for flexible positioning
- Resizable palette window or panel for adjusting its size
- Auto-hide or collapse functionality for maximizing workspace area
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved

## 4. Workspace:

![alt text](./images/image-13.png)

### a. Canvas Area:
- **Grid-Like Surface**: A grid helps in arranging bricks and stacks.
- **Staff Lines/Notation**: Visual representation of musical notation on the canvas.
- **Connection Indicators**: Visual cues for valid/invalid connections.

### b. Navigation and Viewing:
- **Panning/Scrolling**: Navigate large compositions easily.
- **Zoom Controls**: Adjust the workspace scale for detailed or broad views.
- **Minimap/Overview**: A bird's-eye view of the entire composition for quick navigation.

### c. Musical Notation Rendering:
- **Traditional Notation**: Render staff, notes, rests, etc., based on the brick composition.
- **Real-Time Updates**: Notation updates as bricks are added, removed, or modified.
- **Notation Styles**: Switch between staff, piano roll, guitar tablature, etc.
- **Synchronized Highlighting**: Highlight or animate notation during audio playback.

### d. Audio Playback and Visualization:
- **Playback Controls**: Play, pause, stop, and seek with visual feedback.
- **Synchronized Visualizations**: Piano roll, waveform, and other visualizations during playback.
- **Instrument Icons**: Select different instrument sounds visually.

### e. Workspace Customization:
- **Toggle Visual Aids**: Options to show or hide grid lines, staff lines, and other aids.
- **Background Themes**: Change the workspace background color or theme.
- **Save/Load Layouts**: Save and load workspace layouts or configurations.
Karan-Palan marked this conversation as resolved.
Show resolved Hide resolved

Binary file added modules/code-builder/docs/images/image-1.png
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 modules/code-builder/docs/images/image-10.png
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 modules/code-builder/docs/images/image-11.png
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 modules/code-builder/docs/images/image-12.png
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 modules/code-builder/docs/images/image-13.png
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 modules/code-builder/docs/images/image-2.png
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 modules/code-builder/docs/images/image-3.png
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 modules/code-builder/docs/images/image-4.png
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 modules/code-builder/docs/images/image-5.png
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 modules/code-builder/docs/images/image-6.png
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 modules/code-builder/docs/images/image-7.png
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 modules/code-builder/docs/images/image-8.png
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 modules/code-builder/docs/images/image-9.png
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 modules/code-builder/docs/images/image.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.