Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanoMarina committed Nov 13, 2021
1 parent 7031ce9 commit 190be16
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ See SYNTAX.md for binding syntax.

As a standalone class, knot works pretty simply:

```
```javascript
const KNOT = require ('./knot.js');
//open your OSC UDP channel
const knot = new KNOT.Knot(/* optional oscChannel */);
```

open up a configuration by loading one or more json files:

```
```javascript
try {
knot.loadConfiguration(["file1.json", "file2.json"]);
} catch (err) {
Expand All @@ -63,7 +63,7 @@ When you load a bind map over an existing one, conflicting binds are handled
by discarding the original bind. With presere mode, the previous map will be kept
in full.

```
```javascript
try {
//this will remove any bind found in file1.json already presentin file1_alternate.json
knot.loadConfiguration(["file1.json", "file1_alternate.json"], false);
Expand All @@ -79,7 +79,7 @@ try {
If you need extra security, add true as a 3rd parameter on loadConfiguration. this will remove
any "shell" bind from the configuration.

```
```javascript
try {
//this will remove any shell bind in file.json1
knot.loadConfiguration("file1.json", false, true);
Expand All @@ -103,7 +103,7 @@ bind to the first matching ``request``;
If midi input is instantiated by knot, it will be also opened. the special
``midiCallback`` method is used to process and filter bindings.

```
```javascript
knot.setMidi("AKAI"); //bind to the first 'akai' device
knot.setMidi(0); //bind to device #0;
knot.setMidi(alreadyBuildInput); //reference custom midi input
Expand All @@ -124,7 +124,7 @@ not triggered.

Any weird thing you want to do the bindings, you can get the ``filterMap`` property:

```
```javascript
const KNOT = require('./knot.js');
const filterMap = knot.filterMap.filterMap;

Expand Down Expand Up @@ -154,7 +154,7 @@ Note that a Filter object does not reflect the structure of a bind object. Bind
to be more pratical on writing, while Filters try to be practical on access.

### Example of a FilterMap.filterMap property
```
```json
{
"11A" : {"74" : [ *filter1*, *filter2* ] }
}
Expand All @@ -179,7 +179,7 @@ will not send or execute anything. To discard midi re-routing, just ``setMidiOut

Knot uses SimpleTextParser to handle OSC syntax and to parse midi messages with ${} paths.

```
```javascript
const KNOT = require('./knot.js');
let myParser = new KNOT.OSCParser();
let result = myParser.translate("/myosc 'string' 2 3.0 T");
Expand All @@ -194,7 +194,7 @@ MIDI Parsers are used internally, but you can use them to extend midi message sy
MIDI Parsers are used by Filters. If ``Filter.parser`` is set, you can use a custom midi parser.
Note that new rules should follow your own syntax, the ${} syntax is reserved.

```
```javascript
const KNOT = require('./knot.js');
let myMidiParser = new KNOT.MIDIParser();
myMidiParser.addRule(/*add your own rule*/);
Expand Down

0 comments on commit 190be16

Please sign in to comment.