šŸŽµ šŸ“¦ Music Box Editor šŸ“¦ šŸŽµ
Anthony_Tonev (80)

A simple editor for creating music box melodies with an animated music box that "plays" them for you.

Very basic:
Just click on the diamonds to generate a note and press play. There are some featured melodies included.

NEW: Create a BoxHub account and share your boxes:
https://Box-hub--anthony-tonev.repl.co

The note sounds are from https://freesound.org/people/UbikPhonik/

Tech used :

Make sure you tune-up the box when first loading to cache the sounds and make sure they are loaded.

Features:
-edit notes
-play speeds
-save notes and load notes
-generate random notes
-tuning up the music box
-copy notes from sheet and auto-paste on next sheet
-add new block "+" and delete block "-" or press "++" to generate N blocks from input and "clear" to delete all.
-move notes with arrows
-toggle hold notes
-piece fast preview
-two blocks animating preview modes - show one block at a time or all blocks being visible while playing
-listen to the music only (radio icon) - remove all heavy matrix elements and generate a music output
-mixing notes - combine two or more pieces.
-build-in tunes: Ode of Joy, Twinkle Twinkle Little Star, Star Wars Theme, Jurassic Park Theme, Elf Song.

Bonus features:
--save notes to a database https://musicboxdb-2--anthony-tonev.repl.co/

My idea was to write an app that is simple enough to be beginner-friendly so anyone can learn to write simple music pieces without knowing complex note notations and also have an open-source note sharing system where users build melodies on top off or inspired by other users melodies.

Works best on a desktop with chrome in full-screen repl view.

I've added a guide that explains most of the stuff: https://docs.google.com/document/d/1VuNxjiUfA3SQPqONgDC-7V46lHGHZw3rfcvPiS7jNRI/edit?usp=sharing

Here are some gifs that try to explain the rest of the stuff:



Navigate on the block with the arrows or swap between adjacent blocks or cross between adjacent blocks (there were some bugs with these - most are fixed - there is one know bug where notes in perfect vertical line will merge when doing the cross matrix thing - but making holes on them will allow them to cross)

Mix different projects by chaining their notes together - very useful if you want to create a playlist or if you want to work in parts to reduce memory consumption.

Navigate from top to bottom when loading, previewing and editing by pressing the elevator buttons.

Radio player - Press the radio icon to generate the music and DELETE the blocks with their notes and editing panels ( they can be generated again via the load button). If all you want to do is listening to your creation then you don't need all that 15x15 matrix stuff - this mode is the player part of the editor.

The fast preview feature: Preview notes at 2x speed of the current delay value. After that, it will reset back to normal speed. Sometimes you will want to preview faster to find bad notes. In that case, you don't want to switch delay all the time - just included a button for it.

Change note delay type

Issues :

  • Lack of phone support.
  • Not working in Edge.
  • Adding and removing blocks is scrolling off.
  • Too many features - after hackathon deadline ends I will try to trim it a bit.

Huge thanks to ebest and vedprad1 for the amazing content they have created - I will not be able to compose such awesome music even if I'm using professional tools. Also greatly appreciate their and everyone else's issue reports and feedback. ay

You are viewing a single comment. View All
ebest (590)

Three:
First song: THE FIRST SONG
1a-1,1c-1,1a-4,1c-4,1e-6,1g-6,1i-7,1e-8,1g-8,1i-9,2h-5,2d-6,2b-7,2h-7,2d-8,2b-9,3g-1,3i-1,3c-4,3e-4,3a-5,3g-5,3i-5,3c-6,3e-6,3a-7,4b-1,4b-4,4f-6,4h-6,4f-8,4h-8,5i-1,5e-4,5g-4,5a-5,5c-5,5i-5,5e-6,5g-6,5a-7,5c-7,6h-5,6d-6,6f-6,6h-7,6d-8,6f-8,7g-1,7c-4,7e-4,7a-5,7g-5,7c-6,7e-6,7a-7,8b-1,8d-1,8b-4,8d-4,8f-6,8h-6,8f-8,8h-8,9i-5,9e-6,9a-7,9c-7,9i-7,9e-8,9a-9,9c-9,10h-1,10d-4,10f-4,10b-5,10h-5,10d-6,10f-6,10b-7,11a-1,11c-1,11c-4,11a-5,
Optimal delay: 300

When I made this, I noticed one thing when you load it up. If the song takes more then one block, you first have to add enough blocks for the song to fit in. This one takes 11 blocks! My suggestion is so that you can put the music code in the url.

London bridges falling up

1i-1,1a-6,1e-6,1i-6,1g-7,1a-8,1e-8,1d-9,2h-1,2h-5,2d-6,2b-7,2d-8,3g-1,3c-5,3a-6,3g-6,3c-7,3i-7,4b-6,4f-6,4b-8,4f-8,4i-9,5e-1,5g-2,5e-4,5i-4,5g-5,5a-6,5e-6,5i-6,5c-7,5g-7,5a-8,5i-8,6d-1,6h-4,6d-5,6h-6,6h-8,7c-1,7e-2,7c-4,7e-4,7c-6,

Optimal delay is 200. 7 blocks required.

A classic: Ode to joy (Symphony No. 9) just slightly simplified to fit.

1a-6,1c-6,1e-7,1g-8,1i-8,2h-4,2f-5,2d-6,2b-7,3a-4,3c-5,3e-6,3g-6,4a-5,4b-5,4f-6,4h-6,5i-6,5a-7,5g-7,5c-8,5e-8,6d-4,6f-4,6b-5,6h-5,7f-4,7g-4,7c-5,7a-6,8h-4,8b-5,8d-5,8f-6,9g-4,9a-5,9i-5,9c-6,9e-6,9d-7,10h-4,10f-5,10b-6,10d-6,10c-7,11c-1,11a-5,11g-6,11i-6,12b-7,12h-7,12d-8,12f-8,13e-4,13g-4,13c-5,13i-5,13a-6,14h-4,14i-4,14d-5,14b-6,

Optimal delay: 300. Blocks: 14

Any more songs to use?

-Ebest

Anthony_Tonev (80)

@ebest wow, thanks alot I will add your song in the collection.

And yes that thing about loading them is not working well - it just loads notes. I have an object where I store notes, delay info and block count for community contributions. I will fix that to work the same way.

I will have to implement the url load for sure so I can make it like a community sharing thing but do you have any suggestions about a database maybe. I was thinking about firebase database where you just add a name and you get unique key plus that name and a version number if it's the same name - soma data about the song author etc. Or I can just make a node server and store them locally.

Anthony_Tonev (80)

@ebest Just added your songs - amazing job! Thank you for providing me with a decent content for the editor. This helps a lot.

ebest (590)

@Anthony_Tonev The first song is twinkle twinkle little star.

Also, change THE FIRST SONG's author to Jane Taylor
London Bridges falling down's author to Alice Bertha Gomme
and Ode to Joy to Ludwig van Beethoven.

Anthony_Tonev (80)

@ebest Yes I recognised them right away. I still think there should be the name of the person that added it as a box music. So I will name them like so : A. B. Gomme's "London Bridges falling down" by ebest.

BTW I have also added a button to generate n number of blocks (++ button next to load button).

ebest (590)

@Anthony_Tonev
Improved Ode to Joy:
1c-4,1a-6,1c-6,1i-6,1e-7,1g-8,1i-8,2f-1,2d-4,2h-4,2f-5,2d-6,2h-6,2b-7,3c-1,3a-4,3c-5,3a-6,3e-6,3g-6,3e-8,3g-8,4a-1,4f-4,4h-4,4a-5,4b-5,4e-5,4d-6,4f-6,4h-6,4c-7,5c-6,5e-6,5i-6,5a-7,5g-7,5c-8,5e-8,6d-1,6d-4,6f-4,6b-5,6h-5,7f-4,7g-4,7c-5,7a-6,7f-6,7g-6,8d-1,8h-4,8b-5,8d-5,8f-6,8f-8,9a-1,9i-1,9c-4,9e-4,9g-4,9a-5,9i-5,9c-6,9e-6,9d-7,10b-4,10d-4,10h-4,10f-5,10b-6,10d-6,10c-7,11c-1,11g-4,11i-4,11a-5,11f-5,11e-6,11g-6,11i-6,11d-7,12d-6,12f-6,12b-7,12h-7,12d-8,12f-8,13c-1,13e-4,13g-4,13c-5,13i-5,13a-6,13e-6,13g-6,14b-4,14h-4,14i-4,14d-5,14b-6,

ebest (590)

@Anthony_Tonev So many songs can't be done because of sharps (#). And can you add higher and lower notes so there's a longer line of notes available?

Anthony_Tonev (80)

@ebest yes I will consider adding more notes - how many do you think are enough? Now they are 9.

ode of joy is updated - or you wan't it as a separate peace called improved ode of joy?

Anthony_Tonev (80)

@ebest I've added more notes - you can switch between 9 notes and 16 notes mode by pressing "more cowbells!/less cowbells" button. Old songs will still sound the same but now songs will also have a type - 'mini' for simple 9 notes one and 'grand' for 16 notes one. These are all the notes I could find - not sure if they work for all songs but at least they can cover more than before.

ebest (590)

@Anthony_Tonev You may or may not have a BIG problem. Comparing this to a piano, I now notice that you are missing d and e. Change Ode to Joy's name to Ode to Joy in eā™­.

ebest (590)

@ebest Also, it's 15 notes. Not 16

Anthony_Tonev (80)

@ebest
I have used a pack of sounds from freesounds.org that are named like so :
eb1,eb2,dd2,c2,dd1,bb2,c1,ab1,ab2,ab3,bb1,f1,f2,g1,g2

  • I saw that some are missing, so I will try to find a pack with all notes - but this is very strange since this pack should have all notes from the box recorded. I guess it was not a note rich box.
ebest (590)

@Anthony_Tonev can you make some way to make held notes?

Anthony_Tonev (80)

@ebest it turns out I can - this is the code snippet
previewNote.currentTime = 0;
previewNote.volume = (volumeVal / 100);

//held notes part
previewNote.mozPreservesPitch = false; //something that does something
previewNote.playbackRate = 0.5; //the lower this is the longer the note will be heard

previewNote.play();

ebest (590)

@Anthony_Tonev Then add some way to like hold the pedal or make longer notes

Anthony_Tonev (80)

@ebest I will try adding this - if you hold a button 1,2,3,4,5,6,7,8 or 9 and then click on the note, you will add a different color note indicating the level of delay it will get when it is played. Will have to not effect other notes - only this one.

ebest (590)

@Anthony_Tonev lol almost done with the main theme of star wars

ebest (590)

@Anthony_Tonev Finished! It uses all 16 notes.
1e-1,1b-5,1c-5,1d-5,1e-5,1m-6,1e-8,1i-8,1m-8,1o-9,1i-10,1n-10,1m-11,1i-12,2g-6,2e-8,2g-8,2n-8,2i-9,2a-10,2e-10,2h-10,2j-10,2n-10,2g-11,2a-12,2e-12,2j-12,2n-12,2a-15,2j-15,3k-3,3d-5,3h-5,3j-5,3k-5,3a-7,3k-8,3o-8,3a-9,3d-9,3b-10,3o-10,3a-11,3c-11,3o-12,4d-6,4m-7,4d-8,4k-8,4f-9,4m-9,4o-9,4e-10,4g-10,4k-10,4n-10,4d-11,4m-11,4g-12,4k-12,4g-15,5j-5,5n-5,5g-7,5e-8,5g-9,5j-9,5a-10,5e-10,5h-10,5g-11,5i-11,5a-12,5e-12,5a-15,6b-1,6b-4,6a-5,6b-6,6f-6,6g-6,6k-6,6g-8,6j-8,6k-8,6i-9,6l-9,6n-9,6h-10,6m-10,6g-11,7g-1,7b-2,7g-4,7b-5,7d-5,7f-5,7a-6,7g-6,7k-6,7l-6,7b-7,7l-8,7o-8,7n-9,7m-10,7l-11,8l-1,8l-4,8d-5,8h-5,8j-5,8l-6,8a-7,8c-9,8d-9,8a-12,9f-4,9i-4,9a-6,9b-6,9f-6,9i-6,9k-6,9l-7,9b-8,9e-8,9f-8,9d-9,9g-9,9i-9,9c-10,9h-10,9b-11,9m-12,9o-12,10a-8,10c-8,10e-8,10g-8,10i-8,10n-8,10l-9,10a-11,10c-11,10e-11,10i-11,10g-12,10o-12,10e-13,10c-14,10a-15,11j-3,11d-4,11f-4,11h-5,11i-5,11j-5,11j-8,11n-8,11d-9,11f-9,11n-10,11n-12,12c-6,12l-6,12c-8,12j-8,12l-8,12e-9,12n-9,12d-10,12f-10,12j-10,12m-10,12o-10,12c-11,12l-11,12f-12,12j-12,12o-12,12f-15,12o-15,13i-5,13m-5,13o-5,13f-7,13d-8,13f-9,13i-9,13d-10,13g-10,13f-11,13h-11,13d-12,14a-3,14a-5,14i-6,14a-8,14e-8,14i-8,14k-9,14e-10,14j-10,14l-10,14i-11,14e-12,14l-12,14l-15,15o-5,15c-6,15l-7,15a-8,15c-8,15j-8,15e-9,15l-9,15o-9,15a-10,15d-10,15f-10,15j-10,15m-10,15c-11,15l-11,15n-11,15a-12,15f-12,15j-12,15f-15,16d-5,16n-5,16l-6,16h-8,16f-10,16d-12,16f-12,16f-15,17j-1,17e-2,17c-3,17a-4,17g-5,17j-8,17g-10,17h-10,17i-10,17j-10,17g-12,17h-12,17i-12,17j-12,17g-15,17h-15,17i-15,17j-15,

Anthony_Tonev (80)

@ebest wow - john williams, his jurrasic park score and starwars are the most recognisable - everyone can guess them.
btw I have just added the hold note - only 1 type for now - delay 0.4 and it activates when holding 1 right before clicking on a note. Just need to fix it in the load function.

ebest (590)

@Anthony_Tonev Thanks! I noticed if your setting is "less cowbells" and you load up star wars, it won't automatically switch into "More cowbells"

Anthony_Tonev (80)

@ebest what is the optimal delay for it - just loaded it in. It's amazing!

Anthony_Tonev (80)

@ebest load function is very primitive - not keeping it up with the new features. Load notes is just loading notes - it does not care for anything else. I will try to add it. On the button for community contribution it is updating the size. However it is recommended you switch to 16 first because you will need to tune the box anyway...

ebest (590)

@Anthony_Tonev do you have a email address

Anthony_Tonev (80)

@ebest If you switch to 16 first - you should have no problem loading them.

Anthony_Tonev (80)

@ebest Granted. I haven't thought about it..

ebest (590)

@Anthony_Tonev Do you have any other music suggestions?

ebest (590)

@Anthony_Tonev Could you add a way to like stretch a note so it gets held for longer?

Anthony_Tonev (80)

@ebest hold key '1' and press the note right away it will make a note 40% longer--it will be played but it does not work with load and move arrows yet, however it keeps it in save by adding a dot after the note coordinates. I plan to add more delay type although they seem very similar but first I will have to make some audio correction on the files because they have some amount of silence which affects the stretch or if I will edit them anyway I think I can make better long notes by adding sound effects on the audio file in audacity... I think this will be a better solution than roughly stretching it.