Giter Club home page Giter Club logo

midibridge-js's Introduction

midibridge-js's People

Contributors

abudaan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

midibridge-js's Issues

Weird console message

Midibridge 5.0.2: Testing http://abumarkub.net/midibridge/examples/base64.html.
Hitting the stop button while playing a file results in the following console message (from MidiBridge.js line 250):
"weird MIDI message intercepted 191".

Maybe there should be a flag we could set for a "verbose" mode?
If messages are sent, they should be more helpful. In this case, nothing more serious seems to have happened than
"performance stopped".

problem with the "playmidifile" example

This example works fine from your web site, but not from my local hard disk.

To get it to work here, I have to comment out line 8 of playmidifile.js:
"use strict;"

If I don't comment out that line, I get an "uncaught reference error" at line 66:
sliderThumb = document.createElement("div");
Very odd!

What, exactly does"use strict;"do? Sorry if that's a silly question, but I can't see any documentation for it.

Two quibbles:

  1. The Chopin file is loaded automatically, even though the top line of the display says "No file loaded". That's a bit confusing if one is trying to figure out what is supposed to be happening when its not.
  2. The STOP button should rewind the display. The docs say (correctly) that that is what stopSequencer() does.

I've now been through all the examples in version 5.0.2, and very impressive the are too! Wonderful stuff!! Bravo!

Java file not loading

On Mac OSX Lion in Chrome 15, when I open up "index.html," the page content doesn't load and in the console it complains that it can't find "/midibridge-js/net.abumarkub.midi.applet.MidiApplet."

Bug: infinite loop on PROGRAM CHANGE

Sending a PROGRAM_CHANGE message causes an infinite loop.

Try the following code:

midiBridge.init({
    ready: function (msg)
    {
    },
    data: function (midiEvent)
    {
        contentDiv.innerHTML += "Sending PROGRAM CHANGE<br/>";
        midiBridge.sendMidiEvent(midiBridge.PROGRAM_CHANGE, 0, 13, 0);
    }
});

Playing any key on the midi input device triggers the infinite loop.
(Stop it by putting a break point inside the data function!)

documentation

Since I've now got all the examples working, and I want to get to know midibridge as well as possible (and get more familiar with Javascript), I've decided to go through the documentation at
http://abumarkub.net/abublog/?page_id=399#documentation
systematically.

I've already discovered quite a lot that seems out of date, or I think could be improved, so I'm rewriting as I go. (A beginner's outside perspective on all this is probably a help.) I'll post the result here as a wiki page when I'm done. Fortunately, midibridge is fairly small, so this should not take too long.
Apropos: I think midibridge should resist attempts to add new features! Small is beautiful! :-)

I think you could/should eventually move the main docs out of their current page, and just provide a link to the up-to-date docs kept here. You will, of course, be able to edit/delete anything I post. I'm doing this for me! :-)

Best,
j

Feature request: midiBridge.SLEEP

I know I said you should resist requests for new features, but this is different! :-)

I want to program a button to play a simple sequence of midiEvents. Pressing the button should play the sequence.

Currently, as far as I can see, the only way to do this is to use the sequencer to send a standard midi file (as illustrated in the playmidifile example), but it would be very useful if the sequence could be defined some other way.

  • One should not have to go to the trouble of creating and setting up a whole sequencer just to play a small sequence. It should be possible to store sequences directly in the button's javascript definition.
  • I actually want to store my midi data in a more useful, non-standard file format (SVG-MIDI files).

The best way to do this would, I think, be to define a new static member midiBridge.SLEEP, which would be used like this:

midiBridge.sendMidiEvent(midiBridge.SLEEP, number_of_milliseconds);

A button could then be programmed to play a simple sequence as follows:

btnPlay = document.createElement("div"); btnPlay.innerHTML = "PLAY"; btnPlay.className = "button"; controls.appendChild(btnPlay); btnPlay.addEventListener("click", function() { midiBridge.sendMidiEvent(midiBridge.NOTE_ON, 1, 84, 100); midiBridge.sendMidiEvent(midiBridge.SLEEP, 513); midiBridge.sendMidiEvent(midiBridge.NOTE_OFF, 1, 84, 0); midiBridge.sendMidiEvent(midiBridge.NOTE_ON, 1, 85, 100); midiBridge.sendMidiEvent(midiBridge.SLEEP, 1001); midiBridge.sendMidiEvent(midiBridge.NOTE_OFF, 1, 85, 0); midiBridge.sendMidiEvent(midiBridge.SLEEP, 700); midiBridge.sendMidiEvent(midiBridge.NOTE_ON, 1, 86, 100); midiBridge.sendMidiEvent(midiBridge.SLEEP, 602); midiBridge.sendMidiEvent(midiBridge.NOTE_OFF, 1, 86, 0); midiBridge.sendMidiEvent(midiBridge.NOTE_ON, 1, 87, 100); midiBridge.sendMidiEvent(midiBridge.SLEEP, 286); midiBridge.sendMidiEvent(midiBridge.NOTE_OFF, 1, 87, 0); }, false);

This example was adapted from the PLAY button in the playmidifile example. In the original example, a whole sequencer has had to be set up and loaded with a file, and the eventListener then calls

midiBridge.startSequencer();

If you choose not to implement this, I could probably find a way to write my own javascript Sleep() function, but I think this is something a lot of people might like to have, and it makes for far more elegant code.

Is there already a way to do this, that I've overlooked?

best, j

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.