GithubHelp home page GithubHelp logo

fmodica / fretboard Goto Github PK

View Code? Open in Web Editor NEW
22.0 22.0 5.0 1.33 MB

A configurable fretboard for displaying notes programatically and capturing user input. Built with HTML/CSS/JavaScript.

License: MIT License

HTML 11.75% JavaScript 85.51% CSS 2.74%

fretboard's People

Contributors

fmodica avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fretboard's Issues

Add ability to update callbacks

The api needs:

api.removeNotesClickedCallback(functionName);

The angular directive needs to bind new callbacks:

$scope.config.notesClickedCallbacks = [ functionName ];

Vertical Fretboard for Octave shapes, arpeggios, etc.

A common documentation method for chords, arpeggios, octaves, etc is a vertical fretboard. I know there has not been a lot of movement on this code in a while, but it would be great to have an option to rotate the fretboard 90 degrees to display patterns and such while keeping the text correctly oriented. The minimum number of fret could also be 5 for this view.

Bulk updates each cause a new animation

This will trigger 2 animations of everything on the fretboard (strings, notes, etc.):

api.setTuning(someOtherTuning);
api.setNumFrets(24);

While it is probably rare to change multiple things at once after the fretboard is created, a potential solution is to combine all of the API into one update method:

api.update({
    tuning: someOtherTuning,
    numFrets: 24
});

Another potential solution is to use setTimeout to schedule a calculation which will only happen once.

Animations occur multiple times on initial render (AngularJS directive)

If a config property is defined, it will render and then the corresponding set API method will be called, causing another render.

Example: Set your tuning

$scope.config = {
    tuning: someTuning
};

The initial render will happen, and then the directive will call:

api.setTuning(someTuning);

Tuning cannot have 2 notes with the same pitch

You can have:

[{
    letter: "E",
    octave: 4
}, {
    letter: "E",
    octave: 2
}]

But not:

[{
    letter: "E",
    octave: 4
}, {
    letter: "E",
    octave: 4
}]

Hopefully it is rare to want a tuning with 2 notes of the same pitch.

The object structure for clicked notes is awkward

When multiple notes exist on the same string, specifying the stringItsOn property each time is awkward:

var clickedNotes = [{
    stringItsOn: {
        letter: "E",
        octave: 4
    },
    fret: 3
}, {
    stringItsOn: {
        letter: "E",
        octave: 4
    },
    fret: 5
}, {
    stringItsOn: {
        letter: "E",
        octave: 4
    },
    fret: 6
}, {
    stringItsOn: {
        letter: "B",
        octave: 3
    },
    fret: 3
}, {
    stringItsOn: {
        letter: "B",
        octave: 3
    },
    fret: 5
}, {
    stringItsOn: {
        letter: "B",
        octave: 3
    },
    fret: 6
}];

api.setClickedNotes(clickedNotes);

Solution:

var clickedNotes = [{
    string: {
        letter: "E",
        octave: 4,
    },
    notes: [{
        fret: 3
    }, {
        fret: 5
    }, {
        fret: 6
    }]
}, {
    string: {
        letter: "B",
        octave: 3,
    },
    notes: [{
        fret: 3
    }, {
        fret: 5
    }, {
        fret: 6
    }]
}];

api.setClickedNotes(clickedNotes);

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.