Code Monkey home page Code Monkey logo

levada's Introduction

This project aims to be a website in which you can practice your rhythmic solfège through simple one-beat rhythmic figures. Try out the site at https://vernalhav.github.io/levada/

Overview

Sight reading sheet music is a daunting task. Not only do you need to worry about key signatures, accidentals, chords, articulations, but also about rhythm! This project emerged as a result of my journey trying to be a better musician and wanting a good way to practice understanding the most common rhythmic figures. The project was heavily inspired by Saher Galt's videos on rhythm.
Currently the site is in its barest-bones version possible, but it's enough to start practicing!

  1. Use the add or remove beats button to specify the desired amount of beats
  2. Set the BPM to the desired amount
  3. Select the rhythm you want to practice by either
    3.1. Selecting which figures you want to appear by opening the "Select figures" (checked crotchet) pane and adding beats
    3.2. Setting a specific rhythm by choosing each figure individually in the "Choose figure" (plus) pane and choosing the desired figures
  4. Click the mute button
  5. Play the sequence and click anywhere below the button menu whenever you think the note should be played.
  6. Unmute, play the sequence again and check your progress :)

Screenshots

Desktop screenshot Mobile screenshot

Browser Support

Platform               Chrome Edge Firefox Safari
Computer Yes Yes Yes Untested
iOS Yes Untested Untested Yes
Android Yes Untested Yes Untested

Feel free to test this in other browsers and update this README :)

Project Structure

├── image-generators            # All automation to generate the rhythmic figure images and specify the way they will be played 
│   ├── lilypond                # Rhythmic figures' lilypond files. This directory is completely optional.
│   ├── scripts                 # Python scripts that build and patch the corresponding template and index files
│   └── templates               # Lilypond and typescript template common to all rhythmic figures
├── sceenshots                  # Project screenshots
├── public                      # Basic HTML and website icon
└── src                         
    ├── assets                  
    │   ├── RhythmicFigures     # All rhythmic figure images and rhythm specifications (as per image-generators/rhythms_data.json)
    │   │   └─── ...
    │   ├── images              # Icons and general purpose images
    │   ├── sounds              # Metronome beat and snap sounds
    │   └── styles              # Global CSS styling
    ├── components              # React components and their individual CSS
    │   └── ...
    ├── pages                   # React elements that correspond to each page and their individual CSS
    │   └── ...
    └── utils                   # Utility functions (playBeat is here!)

The main logic of the application is contained in pages/MainPage/index.tsx, as it controls all other events.
The sound-playing logic is in utils/playBeat.tsx.
All of the process of generating new rhythmic figures and their images and adding them to the site can be found in image-generators and better explained on its README.

Contributing

If you wish to contribute to this project, thank you! You're more than welcome :)
If you have any questions about the project's code and structure, please open an issue and I'll reply as soon as possible. There should be a few issues opened, so check if there are any that you would like to work on. Don't be shy on joining the discussion even if the issue is already assigned to someone.
To contribute, fork the project, open up a new branch (preferably with a semantic name) and then when you're done, open up a Pull Request. I'll review them as soon as possible, so you won't be left waiting long for a merge or for feedback.
To set up the development environment, simply run npm install on the root directory and then npm start.

This is my first React project, so if you see any anti-patterns, hacky solutions or things that could be improved in general, please open an issue with the [Improvement] tag! I'm always looking for ways to make my code better :)
Feedback is ALWAYS appreciated!

TODO:

  • Scoring system!!
  • Remove rhythmic figure to image-generators' make
  • Better parsing of dotted notes in image-generators/rhythms_data.json
  • Play multi-beat rhythmic figures (and possibly display them in a different way)
    All these issues are better detailed in the Issues tab. Feel free to contribute!

levada's People

Contributors

vernalhav avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

levada's Issues

[BUG] Refactor code to Web Audio API

Describe the bug
On Firefox, the audio isn't properly synced up on BPMs < 60 and doesn't play at all on BPMs > 60 On mobile, similar issues appear, but it seems as though only the beat plays and not the snap.

To Reproduce
Play any rhythm on any of the platforms mentioned.

Desktop (please complete the following information):

  • Firefox

Smartphone (please complete the following information):

  • iOS: Chrome and Safari (at least)

Additional context
The issue with Firefox's audio not playing on faster BPMs seems to be the audio's playbackSpeed attribute is greater than 2 (see utils/playBeat.ts). With regards to the syncing and mobile issues, I don't know what could be causing it. Maybe it's an issue with the browser, but there might be some workaround.

[Improvement] Create a separate component for the buttons/bpm menu

Description:
The top container could be separated into its own component to reduce clutter in MainPage/index.tsx.

Current situation:
The top menu layout takes up the most space in the JSX representation of the main page. If it could be separated into its own component and communicate its events properly with the main page, it would be overall better to the codebase.
The element is the div with class "center-container" in the return value of MainPage.

Proposed solution:
This could probably be solved with custom events fired by the buttons/selector that the main page handles with dispatchEvent.

[Feature] Add simple tutorial

Is your feature request related to a problem? Please describe.
A one-time tutorial could be played when the user arrives in the site explaining what each button does.

[BUG] Crashing on iOS after rhythm stops playing

Describe the bug
Whenever the rhythm ends, the site crashes on iOS.

To Reproduce
Open up the site in Safari or Chrome, click "Play" and wait for the rhythm to end.

Expected behavior
The sound would stop playing.

Smartphone (please complete the following information):

  • iOS: Chrome and Safari (at least)

Error message
nvalidStateError: The object is in an invalid state. runtime.js:747

Additional context
This should be related to some Web Audio API call, since this was introduced after the refactoring to this API. The rhythm loop is found in src/pages/MainPage/index.tsx in the useEffect function.

[BUG] Audio not playing on iOS

Describe the bug
Audio isn't playing when using either Chrome or Safari on iOS.

To Reproduce
Access the website in any of the browsers and click on "Play".

Smartphone (please complete the following information):

  • iOS: Chrome and Safari (at least)

Additional context
This could be related to some form of suppressing the Web Audio API's start calls even after user input

[Feature] Add scoring system

Describe the solution you'd like
The user should be able to get scored after playing the generated rhythm., possibly even displaying which figures the user was better and worse at.

[Feature] Allow rhythm looping

Is your feature request related to a problem? Please describe.
It might get frustrating to keep listening to the initial metronome measure each time if the user wants to play several times.

Describe the solution you'd like
There should be a toggle button in the menu that enables the rhythm to loop.

Additional context
The relevant logic should be mostly contained in src/pages/MainPage in the useEffect function.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.