• Stars
    star
    560
  • Rank 79,541 (Top 2 %)
  • Language
    JavaScript
  • License
    GNU Affero Genera...
  • Created over 9 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Music Blocks -- A musical microworld

Music Blocks

β€œAll musicians are subconsciously mathematicians.” β€” Monk

β€œMusic is a hidden arithmetic exercise of the soul, which does not know that it is counting.” β€” Leibniz

Music Blocks is a Visual Programming Language and collection of manipulative tools for exploring musical and mathematical concepts in an integrative and fun way.

Getting Started

Music Blocks is an interactive Web Application β€” the interaction is done via basic mouse events like click, right click, click and drag, etc. and keyboard events like hotkey press. The application is audio-visual; it produces graphics artwork and music. Here are a couple of screenshots to give you an idea of how the application looks like:

alt tag

alt tag

Visit the Music Blocks website for a hands on experience: https://musicblocks.sugarlabs.org.

Or get Music Blocks from the Google Play Store

Some background on why we combine music and programming can be found here.

Refer to the following sections to get familiar with this application:

If you are a developer (beginner, experienced, or pro), you are very welcome to participate in the evolution of Music Blocks.

Refer to the following sections to get an idea:

Refer to the following for more information regarding the evolution of this project:

Running Music Blocks

Music Blocks is available under the GNU Affero General Public License (AGPL) v3.0, a free, copyleft license.

Music Blocks is designed to run in a web browser. The ideal way to run Music Blocks is to visit the URL musicblocks.sugarlabs.org in your browser β€” Google Chrome (or Chromium), Microsoft Edge (Chromium-based), Mozilla Firefox, and Opera work best.

To run from the latest master branch (experimental), visit sugarlabs.github.io/musicblocks.

How to set up a local server

Music Blocks is written using native browser technologies. The bulk of the functionality is in vanilla JavaScript. This means that most of the functionality can be accessed by launching the index.html file in the browser using file:///absolute/path/to/index.html.

However, using so, some functionality will not be available. On top of that, some web browsers (e.g., Firefox v68) have restrictions that prevent Music Blocks from running using file:///. Therefore, it is best to launch a local web server from the directory of Music Blocks.

  1. Download Music Blocks, or clone (https://github.com/sugarlabs/musicblocks.git for HTTPS, or gh repo clone sugarlabs/musicblocks for GitHub CLI), on your local machine.

  2. In a terminal, cd to the directory where you downloaded/cloned Music Blocks, using cd path/to/musicblocks/.

  3. If you do not have Python installed, you'll need to install it. You can test for Python in a terminal using python. Type exit() to exit Python. (Note that on some older Linux systems, the python3 command is not bound to python. You may need to perform a sudo apt install python-is-python3 on Debian-like distros, or equivalent on others.)

  4. After cloning the musicblocks repository, run

    for Linux and macOS:

    python -c "import os, sys; os.system('python -m SimpleHTTPServer 3000 --bind 127.0.0.1') if sys.version_info.major==2 else os.system('python -m http.server 3000 --bind 127.0.0.1')"

    for Windows:

    python -c "import os, sys; os.system('python -m SimpleHTTPServer 3000') if sys.version_info.major==2 else os.system('python -m http.server 3000 --bind 127.0.0.1')"

    If you have npm installed, simply run npm run serve for Linux and macOS, and npm run winserve for Windows.

    NOTE: Make sure you can run either python or py from your terminal, to launch the Python prompt.

  5. You should see a message Serving HTTP on 127.0.0.1 port 3000 (http://127.0.0.1:3000/) ... since the HTTP Server is set to start listening on port 3000.

  6. Open your favorite browser and visit localhost:3000 or 127.0.0.1:3000.

NOTE: Use ctrl + c or cmd + c to quit the HTTP Server to avoid socket.error:[Errno 48].

Using Music Blocks

Once Music Blocks is running, you'll want suggestions on how to use it. Follow Using Music Blocks and Music Blocks Guide.

Looking for a block? Find it in the Palette Tables.

Code of Conduct

The Music Blocks project adheres to the Sugar Labs Code of Conduct

Contributing

Please consider contributing to the project, with your ideas, your music, your lesson plans, your artwork, and your code.

Special Notes

Music Blocks is being built from the ground-up, to address several architectural problems with this run. Since Music Blocks is a fork of Turtle Blocks JS, musical functionality was added on top of it. However, music is fundamental to Music Blocks. Besides, the Turtle Blocks JS started initially with handful of features and was written without a complex architecture. As Music Blocks got built on top of that, it got incrementally complex, but the architecture remained simple, thus resulting in a monolith. Also, the functionality is tightly coupled with the interface and native client API (Web API).

Keeping these problems in mind, we have considered a foundational rebuild that will address all these issues, whilst adding buffers for future additions. We'll also be using a more elegant tech-stack to develop and maintain this project given its scale. After the core is built, we'll be porting features from this application to it.

Refer to the repository sugarlabs/musicblocks-2 for more information about the new project β€” Music Blocks 2.0.

Tech Stack

Music Blocks is a Web Application and is written using browser technologies β€” HTML, CSS (SCSS), JavaScript, SVG, etc.

If you're just getting started with development, you may refer to the following resources:

Programmers, please follow these general guidelines for contributions.

New Contributors

Use the discussions tab at the top of the repository to:

  • Ask questions you’re wondering about.
  • Share ideas.
  • Engage with other community members.

Feel free. But, please don't spam :p.

Keep in Mind

  1. Your contributions need not necessarily have to address any discovered issue. If you encounter any, feel free to add a fix through a PR, or create a new issue ticket.

  2. Use labels on your issues and PRs.

  3. Do not spam with lots of PRs with little changes.

  4. If you are addressing a bulk change, divide your commits across multiple PRs, and send them one at a time. The fewer the number of files addressed per PR, the better.

  5. Communicate effectively. Go straight to the point. You don't need to address anyone using 'sir'. Don't write unnecessary comments; don't be over-apologetic. There is no superiority hierarchy. Every single contribution is welcome, as long as it doesn't spam or distract the flow.

  6. Write useful, brief commit messages. Add commit descriptions if necessary. PR name should speak about what it is addressing and not the issue. In case a PR fixes an issue, use fixes #ticketno or closes #ticketno in the PR's comment. Briefly explain what your PR is doing.

  7. Always test your changes extensively before creating a PR. There's no sense in merging broken code. If a PR is a work in progress (WIP), convert it to draft. It'll let the maintainers know it isn't ready for merging.

  8. Read and revise the concepts about programming constructs you're dealing with. You must be clear about the behavior of the language or compiler/transpiler. See JavaScript docs.

  9. If you have a question, do a web search first. If you don't find any satisfactory answer, then ask it in a comment. If it is a general question about Music Blocks, please use the new discussions tab on top the the repository, or the Sugar-dev Devel <[email protected]> mailing list. Don't ask silly questions (unless you don't know it is silly ;p) before searching it on the web.

  10. Work on things that matter. Follow three milestones: Port Ready, Migration, and Future. Those tagged Port Ready are priority. Those tagged with Migration will be taken care of during or after the foundation rebuild. Feel free to participate in the conversation, adding valuable comments. Those tagged with Future need not be addressed presently.

Please note there is no need to ask permission to work on an issue. You should check for pull requests linked to an issue you are addressing; if there are none, then assume nobody has done anything. Begin to fix the problem, test, make your commits, push your commits, then make a pull request. Mention an issue number in the pull request, but not the commit message. These practices allow the competition of ideas (Sugar Labs is a meritocracy).

Modifying Music Blocks

The core functionality for Music Blocks resides in the js/ directory. Individual modules are described in more detail in js/README.md.

NOTE: As for any changes, please make a local copy by cloning this repository. Make your changes, test them, and only then make a pull request.

Contributing Code provides a general overview of Sugar Lab's guidelines. See Contributing section for specific details about this repository.

Reporting Bugs

Bugs can be reported in the issues tab of this repository.

If possible, please include the browser console log output, and steps to reproduce, when reporting bugs. To access the console, type Ctrl-Shift-J/F12 on most browsers. Alternately, right click and select Inspect. You may need to set the Default levels for the console to Verbose in order to see all of the output, however, in most cases that won't be required. In fact, it'll only clutter the list, so select it only when required.

Credits

Music Blocks is a fork of Turtle Blocks JS created by Walter Bender (@walterbender).

Devin Ulibarri has contributed functional and user-interface designs. Many of his contributions were inspired by the music education ideas, representations and practices (e.g. aspects of matrix, musical cups) developed and published by Larry Scripp with whom Devin studied at New England Conservatory and for whom he worked at Affron Scripp & Associates, LLC, Center for Music and the Arts in Education (CMAIE), and Music in Education. Some of the initial graphics were contributed by Chie Yasuda.

Much of the initial coding specific to Music Blocks was done by Yash Khandelwal (@khandelwalYash) as part of Google Summer of Code (GSoC) 2015. Hemant Kasat (@hemantkasat) contributed to additional widgets as part of GSoC 2016. Additional contributions were made by Tayba Wasim (@Tabs16), Dinuka Tharangi Jayaweera (@Tharangi), Prachi Agrawal (@prachiagrawal269), Cristina Del Puerto (@cristinadp), and Hrishi Patel (@Hrishi1999) as part of GSoC 2017. During GSoC 2018, Riya Lohia (@riyalohia) developed a Temperament widget. Ritwik Abhishek (@a-ritwik) added a keyboard widget and a pitch-tracking widget. During GSoC 2019, Favor Kelvin (@fakela) refactored much of the code to use promises. During GSoC 2020, Anindya Kundu (@meganindya) did a major refactoring of the code base to support JavaScript export. Aviral Gangwar (@aviral243) enhanced the internal representation of mode and key. Saksham Mrig (@sksum) fixed 70+ bugs and added support for pitch tracking and MIDI import.

Many students contributed to the project as part of Google Code-in (2015–2019). Sam Parkinson (@samdroid-apps) built the Planet during GCI. Emily Ong (@EmilyOng) designed our mouse icon and Euan Ong (@eohomegrownapps) redesigned the Planet code as a series of GCI tasks. Austin George (@aust-n) refactored the toolbars as a series of GCI tasks. Bottersnike (@Bottersnike) redesigned the widgets and the Block API, Andrea Gonzales (@AndreaGon) made the widgets responsive, Marcus Chong (@pidddgy) refactored the update code, resulting in an order-of-magnitude improvement in CPU usage, and Samyok Nepal (@nepaltechguy2) updated the local storage mechanism to use localForage.

A full list of contributors is available.

Music Blocks in Japan

Gakken STEAM

License

Music Blocks is licensed under the AGPL, which means it will always be free to copy, modify, and hopefully improve. We respect your privacy: while Music Blocks stores your session information in your browser's local storage, it does not and will never access these data for purpoes other than to restore your session. Music Blocks will never share these data with any third parties.

There is a Planet where you can share your projects with others and remix projects created by other Music Blocks users. Use of the Planet is anonymous and not required in order to enjoy Music Blocks.

Have fun, play hard, and learn.

More Repositories

1

GSoC

A guide for participating in Google Summer of Code with Sugar Labs
Shell
286
star
2

sugar

Sugar GTK shell
Python
227
star
3

turtleblocksjs

Javascript/HTML5 port of Turtle Blocks
JavaScript
89
star
4

sugar-docs

Documentation for Contributors and Developers
75
star
5

musicblocks-v4

A complete overhaul of Music Blocks
TypeScript
66
star
6

www

The Sugar Labs web site
HTML
61
star
7

sugar-toolkit-gtk3

Sugar Learning Environment, Activity Toolkit, GTK 3.
Python
20
star
8

turtleart-activity

A block-based Logo programming environment
Python
17
star
9

musicblocks-v4-lib

The programming framework of the new Music Blocks (v4) application.
TypeScript
14
star
10

sugar-web

Components for Sugar web activities
JavaScript
13
star
11

sugar-build

Sugar build and development scripts
Python
13
star
12

Pippy

Pippy allows the student to examine, execute, and modify simple Python programs. In addition it is possible to write Python statements to play sounds, calculate expressions, or make simple text based interactive games.
Python
12
star
13

sugar-artwork

Sugar icons and themes
C
11
star
14

edit-fonts-activity

A font editor activity for Sugar
Python
10
star
15

speak

Sugar voice synthesizer
Python
9
star
16

browse-activity

Sugar activity to browse the internet; WebKit on GTK on Sugar Toolkit
Python
9
star
17

aslo-v4

A simple app store for sugarlabs
Python
7
star
18

physics

a box2d playpen
Python
7
star
19

sugar-live-build

Configuration for Debian Live Build to make a Sugar Live Build
Shell
6
star
20

periodic-table

A periodic table for Sugar
Python
6
star
21

sugar-datastore

Sugar datastore service
Python
6
star
22

chat

The Sugar chat activity
Python
5
star
23

GSoD

A guide for participating in Google Season of Documentation with Sugar Labs
5
star
24

sugargame

Python
5
star
25

musicblocks-launcher

Music Blocks launcher for Flatpak
JavaScript
5
star
26

activity-abacus

a tool for simple arithmetic calculations
Python
4
star
27

CowBulls-activity

Sugar activity of the math puzzle game "CowBulls"
Python
4
star
28

typing-turtle-activity

A typing tutor for the sugar learning environment
Python
4
star
29

terminal-activity

A traditional linux terminal activity for the Sugar learning environment
Python
4
star
30

aslo

PHP
3
star
31

gst-plugins-espeak

GStreamer espeak plugin
C
3
star
32

sugarchess

A gnuchess implementation for Sugar
Python
3
star
33

iknowmyabcs

Python
3
star
34

automake

Automake with fast python installation
Shell
3
star
35

getiabooks

Get Internet Archive Books
Python
2
star
36

get-books-activity

Activity to download books from online repositories
Python
2
star
37

turtle-blocks-embedded-activity

Turtle Blocks JS embedded inside the Sugar Labs Browse activity
Python
2
star
38

baltigames-activity

Python
2
star
39

finance-activity

Python
2
star
40

sugar-runner

Scripts to run Sugar
Python
2
star
41

musicblocks-v4-builder-framework

The project builder blocks UI framework for Music Blocks (v4).
TypeScript
2
star
42

biorhythm

A sugar activity that calculates your biorhythm
Python
2
star
43

sugar-web-samples

Samples of sugar-web
JavaScript
2
star
44

infoslicer

Python
2
star
45

irc-activity

A irc activity for Sugar the learning environment
Python
2
star
46

teachershare

Sugar webservice for sharing with Journal Share
Python
2
star
47

write-activity

A simple word processor for the Sugar learning environment
Python
2
star
48

myosa-examples

Sample code for the book Make Your Own Sugar Activities!
Python
2
star
49

slideruler

Python
2
star
50

readetexts

Read Etexts Activity -- Read Plain Text books published by Project Gutenberg.
Python
2
star
51

labyrinth-activity

Labyrinth is a lightweight mind-mapping activity allowing text, images, and drawings to be connected together to help explore and document ideas. It is a fork from a GNOME desktop application of the same name; reworked to run as a well behaving Sugar activity.
Python
2
star
52

Measure

The Sugar Measure activity
Python
2
star
53

maps-activity

The Map Activity uses a quick version of Google Maps for exploring the world. Mapmaking tools add photos, text, and Wikipedia articles to the map. You can also download maps and lessons from an online library.
Python
2
star
54

Musicblocks-AI

Python
2
star
55

textquest

Text based game for SugarLabs
Python
1
star
56

maze-activity

A simple maze game for the Sugar learning environment
Python
1
star
57

connect-the-dots-activity

a very simple js game
JavaScript
1
star
58

fedora

fedora spec/srpm files -- copr
1
star
59

cellgame

A sugar activity
Python
1
star
60

Snow

Snow Bundle
Python
1
star
61

icon-change-activity

Python
1
star
62

dimensions

a pattern-matching game
Python
1
star
63

gci2016

gci 2016 work
JavaScript
1
star
64

moon-activity

A activity to show moon phases and more information
JavaScript
1
star
65

flipsticks

Python
1
star
66

stopwatch

Python
1
star
67

memorize-activity

A memory game, not only to play but also to create you own games, for the Sugar learning environment
Python
1
star
68

2-cars-activity

An arcade game for Sugar XOs
Python
1
star
69

numbers

Clone of Peter Hewitt's numbers game
Python
1
star
70

sugar-web-template

Sugar web activity template
JavaScript
1
star
71

activity-turtle-confusion

Python
1
star
72

record-activity

A activity to record audio, video and take photos, for Sugar, the learning environment.
Python
1
star
73

cuidarme-activity

Python
1
star
74

letters

Spell words from a group of random letters
Python
1
star
75

flappy

A python-pygame Flappy Bird clone
Python
1
star
76

cardsort

Python
1
star
77

flappy-birds-activity

An arcade game for Sugar XOs.
1
star
78

read-activity

A activity to read PDF and TXT files in the Sugar learning environment
Python
1
star
79

derecho-a-transitar-activity

Python
1
star
80

DrGeo

DrGeo Sugar activity
Roff
1
star
81

cartoon-builder

Python
1
star
82

jumble-activity

Python
1
star
83

solar-system

A Solar System for Sugar
HTML
1
star
84

arithmetic

Python
1
star
85

words-activity

A multilingual dictionary activity for the Sugar environment
Python
1
star
86

makeymakey

Makey Malkey activity for Sugar
Python
1
star
87

log-activity

Log activity for the Sugar learning environment
Python
1
star
88

story

The Sugar Story activity
Python
1
star
89

sugar-logos

Read-only mirror of https://src.fedoraproject.org/rpms/sugar-logos.
1
star
90

i-can-read-activity

Python
1
star
91

sugar-gitbot

Integration between buildbot and github
JavaScript
1
star
92

turtlepond

Python
1
star
93

sugar-toolkit

Sugar Learning Environment, Activity Toolkit, GTK 2, deprecated for new activities, but supported for old activities.
Python
1
star
94

collabedit

A collaborative text editor widget that sugar activities can embed.
Python
1
star
95

planet-server

A server for the Turtle/Music Blocks Planet.
PHP
1
star
96

cookie-search-activity

Python
1
star
97

distance-activity

Sugar desktop Python activity Distance, for measuring distance between two computers using sound; requires speaker and microphone.
Python
1
star
98

ordinals-activity

ordinals game as a sugar activity
Python
1
star
99

falabracman-activity

Python
1
star
100

riverhex-activity

RiverHex is a connection game. Each player should make a continuous link of hexagons from one side to the opposite side of the board game. RiverHex could be played against the XO or with 2 players on the same machine.
Python
1
star