Inspired by EthMoji and the Composable.sol contract, we decided to put together a game in which users can create short melodies and combine melodies to create new compositions.
What it does
A user can create a single base melody and stores it as an ERC721 token. The melody is then run through keccak256 in order to get a hash of the melody's data i.e. pitches, durations, and starting times. The melody must be sent to the contract already sorted and formatted correctly, which we take care of on the client side. We store the data in a format that checks the melody across keys, if you write your melody in C, you will still 'own' that melody in D or F#. Users may also combine other people's melodies with their own in order to create larger, more complex compositions by paying a composition price decided by a melody's owner. Composers are incentivized to write quality, unique melodies in order to get other people to use them in their own compositions. Users will also be able to choose a melody to represent themselves on the blockchain as an avatar, similar to EthMoji.
How we built it
We built this game using node.js, nunjucks, Truffle, and the OpenZeppelin libraries. We based our game off of the EthMoji game, and heavy relied on their contracts as guides, specifically their Composable.sol, and their Proxy contracts for upgradeability.
Challenges we ran into
-Finding a good way to store a melody on the blockchain so that it is provably unique across keys, and still readable with a MIDI or audio player.
-Displaying and Creating these melodies with a simple UI.
-Working together as remote partners and communicating ideas.
Accomplishments that we're proud of
-Building a MVP in a month after only finding out about the hackathon the day after it was announced.
-Working to create a music notation system that abstracts the key from a melody, and only stores the base parts of what makes up a melody.
What we learned
-How to work on a distributed team
-We learned about how to create upgradeable smart contracts through a Proxy contract
-We gained a deeper insight into Solidity, the EVM, and what is possible and practical to do on a blockchain
What's next for Motif
We plan to build an easy to use plugin/SDK that will allow sites to grab and play someone's avatar melody. We envision this being integrated into mobile wallets as a user's ringtone, or as part of a company's brand or as a jingle. The workflow for creating melodies should also be updated to be easier to use and more intuitive, we will probably try to emulate a DAW style interface. We would like to build out a larger platform for decentralized, p2p, music creation