Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	.github/FUNDING.yml
#	.gitignore
#	README.md
#	docs/latest/classes/Input.html
#	docs/latest/classes/Output.html
#	docs/latest/classes/WebMidi.html
#	docs/latest/data.json
#	docs/latest/files/src_webmidi.js.html
#	docs/latest/index.html
#	package-lock.json
#	package.json
#	src/webmidi.js
#	webmidi.min.js
#	yarn.lock
  • Loading branch information
Jean-Philippe Côté committed Nov 26, 2021
2 parents 1e05555 + 234f139 commit f0b2f96
Show file tree
Hide file tree
Showing 264 changed files with 140,835 additions and 61,508 deletions.
12 changes: 12 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"presets": [
[
"@babel/preset-env", { "targets": {"node": "current"} }
]
],
"env": {
"test": {
"plugins": [ "istanbul" ]
}
}
}
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# EditorConfig helps maintain consistent coding styles for multiple developers working on the same
# project across various editors and IDEs: https://editorconfig.org

root = true

[*]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
max_line_length = 100
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[COMMIT_EDITMSG]
max_line_length = 0
29 changes: 22 additions & 7 deletions .eslintrc.js → .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,31 @@ module.exports = {
"amd": true,
"browser": true,
"mocha": true,
"node": true
"node": true,
"es6": true
},

"parserOptions": {
"ecmaVersion": 6
"ecmaVersion": "latest",
"sourceType": "module"
},

"globals": {
"Promise": "readonly",
"WebMidi": "readonly",
"chai": "readonly",
"sinon": "readonly",
"expect": "readonly",
"sinon": "readonly"
"Note": "readonly",
"isNative": "readonly",
"config": "readonly"
},

"extends": ["eslint:recommended", "prettier"],
"extends": [
"eslint:recommended",
"prettier",
"plugin:react/recommended"
],

// The idea here is to stick to the rules defined by Prettier (https://prettier.io/) and only make
// exceptions in ESLint when absolutely necessary.
Expand All @@ -34,9 +44,14 @@ module.exports = {
"no-multi-spaces": ["error", { "ignoreEOLComments": true }],
"linebreak-style": ["error", "unix"], // Force \n instead of Prettier's auto-detect behaviour
"no-trailing-spaces": ["error", { "skipBlankLines": true, "ignoreComments": true }],
"max-len": ["error", { "code": 100 }], // Prettier's 80 is too small. Period.
"no-console": ["error", { "allow": ["info", "warn", "error"] }] // Only some (unlike Prettier)
"max-len": ["error", { "code": 100, "comments": 120 }], // Prettier's 80 is too small. Period.
"no-console": ["error", { "allow": ["info", "warn", "error"] }], // Only some (unlike Prettier)

// Other rules
"no-prototype-builtins": "off",

"react/prop-types": "off"

}

};
};
14 changes: 7 additions & 7 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@
github: [djipco]

# Single Patreon username
#patreon:
#patreon:

# Replace with a single Open Collective username
#open_collective:
#open_collective:

# Replace with a single Ko-fi username
#ko_fi:
#ko_fi:

# Replace with a single Tidelift platform-name/package-name e.g., npm/babel
#tidelift:
#tidelift:

# Replace with a single Community Bridge project-name e.g., cloud-foundry
#community_bridge:
#community_bridge:

# Replace with a single Liberapay username
#liberapay:
#liberapay:

# Replace with a single IssueHunt username
#issuehunt:
Expand All @@ -26,4 +26,4 @@ github: [djipco]
#otechie:

# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
#custom:
#custom:
18 changes: 8 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,30 +10,28 @@ Desktop.ini

### Editors ########################################################################################
.idea
.vscode/

.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

*.sublime-project
*.sublime-workspace

### Dependency Directories #########################################################################
node_modules
bower_components

### Logs ###########################################################################################
*.log

### Grunt ##########################################################################################
.grunt

### Circle CI ######################################################################################
.circleci

### Test coverage ##################################################################################
.nyc_output
coverage

### Scratch spaces #################################################################################
playground
!/.vscode/

### Sensitive stuff ################################################################################
### Passwords, tokens and such #####################################################################
.credentials
4 changes: 4 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"report-dir": "./node_modules/nyc/.nyc_output",
"temp-dir": "./node_modules/nyc/.coverage"
}
4 changes: 0 additions & 4 deletions BANNER

This file was deleted.

16 changes: 16 additions & 0 deletions BANNER.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<%= pkg.webmidi.name %> v<%= pkg.version %>
<%= pkg.webmidi.tagline %>
<%= pkg.homepage %>
Build generated on <%= moment().format('MMMM Do, YYYY') %>.

© Copyright 2015-<%= moment().format('YYYY') %>, Jean-Philippe Côté.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License
is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
or implied. See the License for the specific language governing permissions and limitations under
the License.
153 changes: 153 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# Changelog

Starting with version 3.x, all notable changes to WebMidi.js will be documented in this file. The
format used is the one suggested by [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [3.0.0]

### Added

- WebMidi.js now has builtin **Node.js** support thanks to the [jzz](https://www.npmjs.com/package/jzz)
node module by Jazz-Soft.

- WebMidi.js is now available in IIFE (Immediately Invoked Function Expression), CJS (CommonJS) and
ESM (ECMAScript module) flavours (all with normal and minifed versions with sourcemaps).

- WebMidi.js now publishes a **TypeScript** definition file for CJS and ESM with all releases.

- WebMidi.js now explicitly checks for Jazz-Plugin support in environments with no native support
for the Web MIDI API.

- The `WebMidi.enable()` method now returns a promise. The promise is fulfilled with the `WebMidi`
object. It still supports using a callback.

- `Input` and `Output` objects now emit `opened`, `closed` and `disconnected` events.

- Hundreds of unit tests have been added and test coverage is now available.

- There are new `InputChannel` and `OutputChannel` objects. They are used to communication with a
single channel of an input or output.

- All emitted events now have a `target` property referencing the object that triggered the event.

- The `sendNoteOn()` method has been added. It behaves the same way as `playNote()` does except it
does not accept a `duration` option. It was added mostly for completeness' sake.

- The `sendNoteOff()` method has been added. It behaves the same way as `stopNote()` does.
Actually, `stopNote()` is an alias to `sendNoteOff()`.

- All methods of the `Output` object that communication with a device are prefixed with "send". This
makes it easier to find the right method. Old method names are still usable but are deprecated.

- The `sendChannelAftertouch()`, `sendKeyAftertouch()` and `sendPitchbend()` method now have a
`useRawValue` options allowing the assignment of value using an integer between 0 and 127 instead of
a float between 0 and 1.

- There is a new `Note` object that can be used in various places such as when calling `playNote()`
or `stopNote()`. It carries with it the note number, the duration (if any), the attack and release
information, etc.

- A `WebMidi.validation` property (defaults to `true`) can be used to disable all argument checking
and legacy support throughout the library (for performance). This property can also be in the
options of `WebMidi.enable()`.

- The `send()` and `sendSysex()` methods of `Output` and `OutputChannel` can now officially use
`Uint8Array` input (not supported on Node.js however).

- Licence has been changed to Apache 2.0

- An `octaveOffset` property has been added to `Input`, `InputChannel`, `Output` and
`OutputChannel`. This means you can offset the octave globally, at the input/output level or at the
channel level

- A `Message` object has been added. This allows easier routing of messages.

- Added support for RPN messages and improved NRPN parsing.

- A two-position array can now be passed to `sendControlChange()` to specify both MSB and LSB at
once.

- The `InputChannel` object offers a `getNoteState()` method that reports if a note is currently
playing or not. It also has a new `notesState` property which is an array holding the playing status
of all notes (0-127).

- It is now possible to add a forwarder to an `Input` that will forward MIDI messages to a specified
output. Also, the inbound messages can be filtered for forwarding by message type and channel. A new
`Forwarder` class has been added for that purpose.

- Added `WebMidi.version`

- The `WedMidi` object now has a `defaults` property where you can set system-wide defaults such as
the default `attack` and `release` velocity. More defaults to come!

### Changed

- [BREAKING CHANGE] Passing `undefined` as the `channel` value to `addListener()` no longer means
that all channels should be listening. This was a terrible design decision and it ends with version
3.

- Documentation is now generated with [jsdoc](https://www.npmjs.com/package/jsdoc) instead of the
outdated [yuidoc](https://www.npmjs.com/package/grunt-contrib-yuidoc).

- [BREAKING CHANGE] The `"controlchange"` event's `value` property is now a float between 0 and 1.
Its `rawValue` property now contains the 7bit integer value (between 0 and 127).

- [BREAKING CHANGE] The `"nrpn"` event's `value` property is now a float between 0 and 1.
Its `rawValue` property now contains the 16bit integer value (between 0 and 65535).

- Grunt has been replaced with NPM scripts for all build purposes.

- [BREAKING CHANGE] The `nrpnEventsEnabled` property has been moved from the `Input` class to the
`InputChannel` class. Trying to access it will trigger a warning in the console.

- [BREAKING CHANGE] The `getCcNameByNumber()` method has been moved from the `Input` class to the
`InputChannel` class and now returns `undefined` instead of `false` when no matching name is found.

- [BREAKING CHANGE] The `"tuningrequest"` event has been renamed `"tunerequest"`.

- The event received by listeners registered on `Input` and `InputChannel` objects has been slightly
changed. Its `data` property now contains a regular array (instead of a `Uint8Array`). Its `rawData`
property now contains the `Uint8Array`.

- Several methods have been moved from the `WebMidi` object to the `Utilities` object. Using the old
methods will continue to work but will trigger a deprecation warning in the console.

- The `send()` method now accepts a `Message` object.

- If a device is disconnected and connected back, it will retain its state (such as listeners,
etc.). This is particularly useful when the computer goes to sleep and is brought back online.

- Several conversion methods have been added to the new `Utilities` class such as
`from7bitToFloat()`, `fromFloatTo7Bit()`, `fromMsbLsbToFloat()`, `fromFloatToMsbLsb()`, etc.

- All enumerations have been move to the `Enumerations` object (e.g. `MIDI_CHANNEL_MESSAGES`,
`MIDI_CHANNEL_NUMBERS`, etc.)

### Deprecated

- The `velocity` option parameter has been renamed `attack`. There are new `rawAttack` and
`rawRelease` parameters that should be used instead of setting `rawVelocity` to `true`.

- The `WebMidi.noteNameToNumber()` method was renamed and moved to `Utilities.toNoteNumber()`. The
old method has been deprecated but will continue to work in v3.x.

- The `WebMidi.toMIDIChannels()` method was renamed and moved to `Utilities.sanitizeChannels()`. The
old method has been deprecated but will continue to work in v3.x.

- The name of the `Output.sendTuningRequest()` method was changed to `Output.sendTuneRequest()`. The
old name has been deprecated but will continue to work in v3.x.

- The `on()` method of the `Input` class has been deprecated. Use `addListener()` instead.

- The `InputChannel.nrpnEventsEnabled` property has been renamed to
`InputChannel.parameterNumberEventsEnabled`. The old property is deprecated but will be kept for
backwards compatibility.

### Removed

- Support for Bower.


## [2.5.1] - 2019-08-25

Versions 2.5.x and earlier have not been tracked in this changelog.
Loading

0 comments on commit f0b2f96

Please sign in to comment.