diff options
author | Devine Lu Linvega <[email protected]> | 2018-10-17 22:16:27 +1200 |
---|---|---|
committer | Devine Lu Linvega <[email protected]> | 2018-10-17 22:16:27 +1200 |
commit | 51511851813f0da6b6b6b905ced6d42105c069e2 (patch) | |
tree | ac34910432f4eed0c8349dfcd27fb424b1743006 | |
parent | d4dc8df77b51785ed1fd42162ee2089c85b4e767 (diff) | |
download | Orca-51511851813f0da6b6b6b905ced6d42105c069e2.tar.gz Orca-51511851813f0da6b6b6b905ced6d42105c069e2.zip |
Adding midi channels to QQQ
-rw-r--r-- | README.md | 22 | ||||
-rw-r--r-- | desktop/core/lib/__bpm.js | 2 | ||||
-rw-r--r-- | desktop/core/lib/__qqq.js | 4 | ||||
-rw-r--r-- | desktop/core/lib/__vol.js | 2 | ||||
-rw-r--r-- | desktop/core/lib/t.js | 10 | ||||
-rw-r--r-- | desktop/sources/scripts/terminal.js | 7 |
6 files changed, 24 insertions, 23 deletions
@@ -40,7 +40,7 @@ - `Q`, **even**: Adds 1 southward, transforms into O on bang. - `R`, **raycast**: Sends a bang to the nearest fn following the direction of the bang. - `S`, **south**: Moves southward, or bangs. -- `T`, **trigger**: Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` westward. +- `T`, **trigger**: Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` northward. - `U`, **idle**: [TODO]Nothing.. - `V`, **value**: Creates a numerical value between 0 and 5 based on the number of present _fns_ westward. - `W`, **west**: Moves westward, or bangs. @@ -59,8 +59,9 @@ ### queries functions -- `BPM`, **bpm**: Set the speed for the Pico terminal. -- `VOL`, **volume**: Set the volume for the Pico terminal. +- `BPM`, **bpm**: Sets the speed for the Pico terminal. +- `VOL`, **volume**: Sets the volume for the Pico terminal. +- `QQQ`, **qqq**: Plays note, on channel, with octave. ## Logic Functions @@ -88,23 +89,24 @@ npm start ``` function frequencyFromNoteNumber(note) { - return 440 * Math.pow(2, (note - 69) / 12); + return 440 * Math.pow(2, (note - 69) / 12); } ``` - Note values are on a range from 0–127, lowest to highest. For example, the lowest note on an 88-key piano has a value of 21, and the highest note is 108. A “middle C” is 60. - Velocity values are also given on a range from 0–127 (softest to loudest). The softest possible “note on” velocity is 1. - ## TODO The idea is to build a synth/mini sequencer, here's some tasks I need to tackle before then. -[ ] Add `:MID[CD]` -[ ] custom synth functions, like `:SYN[ADSR](C)` -[ ] "I wanna be able to 1000x fastforward my pico programs" -[ ] sub programs scope -[ ] Implement midi +- [ ] Add `:MID[CD]` +- [ ] custom synth functions, like `:SYN[ADSR](C)` +- [ ] sub programs scope +- [ ] Implement midi +- [ ] Finish midi channel implementation +- [ ] Convert notes to midi values + ## Extras diff --git a/desktop/core/lib/__bpm.js b/desktop/core/lib/__bpm.js index 2346539..c2d97b7 100644 --- a/desktop/core/lib/__bpm.js +++ b/desktop/core/lib/__bpm.js @@ -7,7 +7,7 @@ function FnBpm (pico, x, y) { this.name = 'bpm' this.glyph = '?' - this.info = 'Set the speed for the Pico terminal.' + this.info = 'Sets the speed for the Pico terminal.' this.ports = [{ x: 1, y: 0, output: true }, { x: 2, y: 0, output: true }, { x: 3, y: 0, output: true }] diff --git a/desktop/core/lib/__qqq.js b/desktop/core/lib/__qqq.js index 69aaa95..2dc6b0c 100644 --- a/desktop/core/lib/__qqq.js +++ b/desktop/core/lib/__qqq.js @@ -7,9 +7,9 @@ function FnQqq (pico, x, y) { this.name = 'qqq' this.glyph = '?' - this.info = 'Play note.' + this.info = 'Plays note, on channel, with octave.' - this.ports = [{ x: 0, y: -1, input: true }, { x: 1, y: 0, output: true }] + this.ports = [{ x: 0, y: -1, output: true }, { x: 1, y: 0, output: true }, { x: 2, y: 0, output: true }] this.haste = function () { pico.lock(this.x, this.y - 1) diff --git a/desktop/core/lib/__vol.js b/desktop/core/lib/__vol.js index 0198062..da40ce5 100644 --- a/desktop/core/lib/__vol.js +++ b/desktop/core/lib/__vol.js @@ -7,7 +7,7 @@ function FnVol (pico, x, y) { this.name = 'volume' this.glyph = '?' - this.info = 'Set the volume for the Pico terminal.' + this.info = 'Sets the volume for the Pico terminal.' this.ports = [{ x: 1, y: 0, output: true }, { x: 2, y: 0, output: true }, { x: 3, y: 0, output: true }] diff --git a/desktop/core/lib/t.js b/desktop/core/lib/t.js index 2437c7c..dadc4ce 100644 --- a/desktop/core/lib/t.js +++ b/desktop/core/lib/t.js @@ -7,15 +7,15 @@ function FnT (pico, x, y) { this.name = 'trigger' this.glyph = 't' - this.info = 'Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` westward.' - this.ports = [{ x: -1, y: 0 }, { x: 0, y: 1, output: true }] + this.info = 'Bangs southward in the presence of `1`, `N`, `S`, `W`, `E` or `Z` northward.' + this.ports = [{ x: 0, y: -1 }, { x: 0, y: 1, output: true }] this.operation = function () { - const w = this.west() + const n = this.north() - if (!w) { return } + if (!n) { return } - if (w.glyph === '1' || w.glyph === 'w' || w.glyph === 's' || w.glyph === 'n' || w.glyph === 'e' || w.glyph === 'b' || w.glyph === 'z') { + if (n.glyph === '1' || n.glyph === 'w' || n.glyph === 's' || n.glyph === 'n' || n.glyph === 'e' || n.glyph === 'b' || n.glyph === 'z') { this.fire() } } diff --git a/desktop/sources/scripts/terminal.js b/desktop/sources/scripts/terminal.js index fcc0205..0258deb 100644 --- a/desktop/sources/scripts/terminal.js +++ b/desktop/sources/scripts/terminal.js @@ -45,7 +45,9 @@ function Terminal (pico) { this.run = function () { if (this.isPaused) { return } + this.debug = 'Idle.' this.qqq.clear() + this.clear() this.pico.run() this.qqq.run() @@ -72,9 +74,7 @@ function Terminal (pico) { } this.log = function (msg) { - console.info(msg) this.debug = msg - this.update() } this.update = function () { @@ -206,8 +206,7 @@ function Terminal (pico) { ctx.fillText(styles.isCursor && g == '.' ? (!pico.isPaused ? '@' : '~') : g.toUpperCase(), (x + 0.5) * this.tile.w, (y + 1) * this.tile.h) } - this.reset = function() - { + this.reset = function () { this.theme.reset() } |