Battle of Tunes is an innovative Telegram-based music battle minigame with a "winner takes all" approach. Players stake a set amount of BNB, join a lobby with other participants, and generate music using a custom music generation model. The generated tracks are evaluated by an advanced machine learning model, and the winner claims the entire pool of staked tokens.
- Time-Consuming: Determining a winner through traditional voting mechanisms is often a lengthy process.
- Lack of Transparency: Winners are frequently decided by subjective, biased voting without a clear set of evaluation metrics.
- Inefficient and Costly Transactions: Traditional centralized payment methods often involve high fees, slower transaction times, and less secure, mutable systems.
Our system utilizes a Random Forest Regressor to evaluate music submissions based on the following parameters:
- Acousticness
- Energy
- Danceability
- Liveness
- Loudness
- Instrumentalness
- Key
- Elimination of Bias: The use of an unbiased regression model ensures results are precise and evidence-based.
- Faster Results: The automated evaluation process is significantly quicker than traditional voting.
A smart contract deployed on the Binance Smart Chain (BSC) Testnet ensures secure, transparent, and low-fee staking and prize distribution, offering a robust alternative to traditional systems.
Our game is managed through three specialized Telegram bots:
-
Battle of Tunes Entry Bot:
- Manages user registration and staking functionality.
- How to Use:
-
Save the
stakingbot.py
file locally. -
Install dependencies:
pip install telebot mysql-connector-python web3
-
Run the following command:
python3 stakingbot.py
-
-
SubmissionHandler Bot:
- Oversees battles after all players have staked and entered the lobby.
- How to Use:
-
Save the
submissionhandler.py
file locally. -
Install dependencies:
pip install telebot mysql-connector-python web3
-
Run the following command:
python3 submissionhandler.py
-
-
MusicGenBot:
- Enables players to generate music using custom prompts.
- How to Use:
-
Save the
musicgenbot.py
file locally. -
Install dependencies:
pip install telebot mysql-connector-python web3
-
Run the following command:
python3 musicgenbot.py
-
- Built using Facebook’s music-gen model.
- How to Use:
- Open the Musicgen Colab Notebook.
- Run All Cells to get an API endpoint to utilize the model in your MusicGenBot.
- Employs a Random Forest Regression model to evaluate music submissions based on seven distinct metrics.
- How to Use:
- Open the Musiceval Colab Notebook.
- Run All Cells to get an API endpoint to utilize the evaluation model in your submissionHandler bot.
- A contract deployed on the BSC testnet handles staking and prize distribution.
Contract address: 0xA546819d48330FB2E02D3424676d13D7B8af3bB2
View contract in block explorer : https://testnet.bscscan.com/address/0xa546819d48330fb2e02d3424676d13d7b8af3bb2
- Use the Telegram PC/Mac App for the best experience (avoid Telegram Web).
- Install the MetaMask Wallet Chrome Extension to stake tokens.
- The game requires exactly 3 players.
- Each player needs at least 0.04 tBNB (BSC Testnet tokens) to cover staking and network fees.
Battle of Tunes Entry Bot Link
- Press the Start button or type /start.
- Stake 0.0002 tBNB using /stake <wallet_address>.
- If previously staked, verify using /verify <wallet_address>.
- Once verified, join the group link to enter your lobby.
- Press the “Connect Wallet” button and approve the connection in MetaMask.
- Stake tokens and sign the transaction in MetaMask.
- Wait for other players to stake and join the group.
- After the battle starts, use /gentrack to get the MusicGenBot link.
- Type /start and verify your identity with your wallet address.
- Type /generate and provide a prompt to generate music.
- Submit or regenerate the track as needed.
Once submitted, evaluation takes 10-15 minutes, and the winner receives the pot.
This project is licensed under the MIT License.
Built with ❤️ by @Marshal-AM and @SamFelix03.