Skip to content

Commit

Permalink
2.1.0 Release (#114)
Browse files Browse the repository at this point in the history
* Fixes #35 by guarding SCENE from initial I script

Added an initialization flag to the scene state to denote when a scene
is first loading.  SCENE operator aborts if the flag is present.

* Fixes #63 by overhauling data entry in tracker

Buffered input
Clear-on-new-entry
Apply-on-Enter
Abort-on-navigation
Incrementers wrap around 16-bit limits
Number entry blocks if it would exceed limits

* New Op: MSPB (milliseconds per beat)

* Fixes #14 by allowing code commenting with alt-/

* New Op: LAST - delta between script run times

Now tracking script number in the execution state and script last run
times in the script state.

One line tap tempo (hit F1 twice):
1: M LAST
M: TR.P 1

* Fixes #38 by making AVG round UP

AVG -32767 -32768 == -32767
AVG 32767 32766 == 32767

* Fixes #38 by making Q.AVG round UP

* New Op: BREAK (alias BRK): Terminates a script

* New Op: W (while loop)

Maximum depth set by WHILE_DEPTH (default 10000)

* Bugfix for W op: while counter for each exec_depth

SCRIPT was breaking W.  Now it doesn't.

* Added documentation for W op

* Added docs for BREAK op

* Added docs for LAST op

* Updated keystroke documentation

* Updated keystroke documentation

* Updated SCENE documentation to reflect I behaviour

* Fixes #94 by tracking execution states by depth

If conditions and for loop iterators do not transcend their execution
depth.

Live mode now behaves like this:

> L 1 4: A I
> A => 4
> I => 0

I is 0 because it exists in a different context than the first command.

* Bugfix: fixes recursion crash

As a result, the code is cleaner and easier to read.

Short story: only SCRIPT should call es_push and es_pop

* Formatting mistake

* Renamed MSPB to BPM

* Fixes #2 by correcting fencepost error in P.RM

* Teletype 2.1 beta 1 build

* Poor merging discipline problems fixed

PEBCAK / ID 10 T error

* Added built zip.

* Fixes M in beta1

* Changed LAST, added THIS, fixed behaviour

* Added beta2 build

* Code cleanup, commenting

* Half-fixes operator table in documentation

* Beta2 tag in Makefile

* Forced L to respect BREAK's authority

* Fixes #93 by clearing TRs in tele_kill

* Added turtle structures and function prototypes

* Added turtle function bodies, updated prototypes.

* Added Turtle operators to turtle.c

* Finished up operators, needs testing.

* Fixed WRAP and BUMP turtle behaviour

and various other things that needed fixing.

* Preparing for beta3 release

* Released beta3

* A turtle that works and is partially tested

Fixed WRAP behaviour
Changed UP to N, etc.
Added FX1, FY1, FX2, FY2 individual get/set for fence
Added HX, HY for home get/set
Added tests for fence and WRAP behaviour (more to come)

* Test revealed bug with new operator

* Fixed test framework and some bugs with turtle

* Test naming fix

* Fixed bugs with WRAP mode

* Prevent a crash with bounds checking

* Fixed confusion between Q15 and Q12 in sin call

* Updated makefile for beta4 release

* Added beta4 build

* Added some tests, fixed others

* Fixed divide by zero in Q.AVG

* Modified operators to match approved set

* Fixed a test

* Added es_push() after es_init()

* Cleaned up test file.

* Implemented @script

* Updated to approved syntax and began testing

* Moved turtle stuff out of state.h/c into new files

* Committed to sin() logic for all calculations

* Added release files for beta5

* Fixed various turtle bugs

* Added final beta5 build

* Trigger Travis build

* Added turtle object files

* Ninja patch to beta5

CTRL-F numbers now enable disable scripts
CTRL-F9 toggles the metro
KILL updated

* Adjusted travis build to detect test errors

* Updated changelog

* Updated broken tests to reflect bounce behaviour

Also to test travis-ci

* Fixed travis-test Makefile deps

* Added a few tests and squashed the sin() bug

Should really have tested it this way sooner.

* Removed hex file from repo.

* Beta 6 prep

* Removed hex file.

* Implemented @show

@show 1 now produces an @ sign beside the current turtle cell in pattern
(tracker) mode.

* Temp script no longer accessible via [ and ]

* Changed THIS -> SCRIPT getter

Now instead of SCRIPT THIS for recursion, SCRIPT SCRIPT.
Per @tehn.

* Fixes fix of [ and ] accessing temp script.

A shameful commit.

* Changed Turtle @show symbol to <

* Changed COMMAND_MAX_LENGTH to 16

* Changed STACK_OP_SIZE to 16

* Changed Q_LENGTH to 64

* Updated CHANGELOG

* Fixed [ still showing temp script

The second such shameful commit.

* SCRIPT now returns 0 in live mode

* Added more 2.1 documentation

- Turtle operator
- Minor other fixes

* Changed @Bounce and @bump behaviour at fence

@bump won't actually change behaviour, but its internal fraction will
remain at a 0.5 offset.

* Fixed @Bounce where x2 = x1 + 1

* Fixed test case

* Added Shift-2 = Toggle @show in TRACKER

Plus a little refactor of access to turtle.shown

* Reverted to git dirty flag for release

* Initial implementation of EVERY

* Fixed simulator Makefile for EVERY

* Added SKIP, OTHER, and SYNC

* Changed OTHER to reflect any last EVERY or SKIP

OTHER now makes sense at the top of the script.

* Cleared the every_last flag on SYNC

* Tracker entry mode changes

Enter no longer moves down a cell
Increment and decrement no longer exceed int16 limits

* Unified in/decrement between edit and nav modes

Now wraps around limits instead of bumping

* Updated CHANGELOG for 2.1.0-rc1

* Removed references to @accel and @frict

* Fixed formatting for 2.1 release

* Included EVERY in changelog

* Removed old, commented-out code.

* Updated help mode for 2.1

* Fixed line overflow in @f doc line

* Fixed formatting

One more pass at make format

* Changed sin() to _sin() to avoid warning

Not like we were linking against libmath but GCC won't shut up.

* Changed documentation header for Turtle

removed word 'operator'.

* Added some missing documentation

@step, BRK were missing
TR.P alias was broken

* Fixed ss_clear_script()

I must have been out of it when I wrote that code!
  • Loading branch information
burnsauce authored and tehn committed Oct 12, 2017
1 parent 0a212fa commit ad358cd
Show file tree
Hide file tree
Showing 55 changed files with 2,339 additions and 198 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ script:
- cd ../simulator
- make clean && make
- cd ../tests
- make clean && make test
- make clean && make test-travis
23 changes: 22 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,28 @@
# Changelog

## v2.0.1
## V2.1
- **BREAKING**: the `I` variable is now scoped to the `L` loop, and does not exist outside of an execution context. Scripts using `I` as a general-purpose variable will be broken.
- **FIX**: `SCENE` will not run from `INIT` script during scene load.
- **NEW**: Tracker data entry overhaul. Type numbers, press enter to commit.
- **NEW**: new op: `BPM` to get milliseconds per beat in given BPM
- **NEW**: script lines can be disabled / enabled with ctrl-/
- **NEW**: shift-enter in scene write mode now inserts a line
- **NEW**: new ops: `LAST x` for the last time script `x` was called
- **NEW**: `SCRIPT` with no arguments gets the current script number.
- **FIX**: `AVG` and `Q.AVG` now round up properly
- **NEW**: new op: `BREAK` to stop the remainder of the script
- **NEW**: new mod: `W [condition]: [statement]` will execute `statement` as long as `condition` is true (up to an iteration limit).
- **NEW**: new mods: `EVERY x:`, `SKIP x:`, `OTHER:` to alternately execute or not execute a command.
- **NEW**: new op: `SYNC x` will synchronize all `EVERY` and `SKIP` line to the same step.
- **NEW**: new feature: @ - the turtle. Walks around the pattern grid. Many ops, see documentation.
- **OLD**: ctrl-F1 to F8 mute/unmute scripts.
- **NEW**: ctrl-F9 enables/disables METRO.
- **FIX**: recursive delay fix. Now you can `1: DEL 500: SCRIPT 1` for temporal recursion.
- **FIX**: KILL now clears TR output as well as disabling the METRO script.
- **FIX**: if / else conditions no longer transcend their script
- **IMP**: functional exectuion stack for `SCRIPT` operations

## v2.0.1
- **FIX**: update IRQ masking which prevents screen glitches and crashing under heavy load

## v2.0
Expand Down
2 changes: 1 addition & 1 deletion docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Teletype is a dynamic, musical event triggering platform.
&mdash; [PDF scene recall sheet](https://monome.org/docs/modular/teletype/TT_scene_RECALL_sheet.pdf)
&mdash; [Default scenes](http://monome.org/docs/modular/teletype/scenes-1.0/)

* Current version: 2.0.1
* Current version: 2.1.0
&mdash; [Firmware update procedure](https://monome.org/docs/modular/update/)


Expand Down
12 changes: 8 additions & 4 deletions docs/keys.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ These bindings work everywhere.
| `alt-<F1>` to `alt-<F8>` | edit corresponding script |
| `alt-<F9>` | edit metro script |
| `alt-<F10>` | edit init script |
| `ctrl-<F1>` to `ctrl-<F8>` | mute/unmute corresponding script |
| `ctrl-<F9>` | enable/disable metro script |
| `<numpad-1>` to `<numpad-8>` | run corresponding script |
| `<num lock>` / `<F11>` | jump to pattern mode |
| `<print screen>` / `<F12>` | jump to live mode |
Expand Down Expand Up @@ -61,13 +63,14 @@ In most cases, the clipboard is shared between _live_, _edit_ and the 2 _preset_
| `]` | next script |
| `<enter>` | enter command |
| `shift-<enter>` | insert command |
| `alt-/` | toggle line comment |

## Tracker mode

The tracker mode clipboard is independent of text and code clipboard.

| Key | Action |
|---------------------|-------------------------------------------------|
| Key | Action |
|---------------------|---------------------------------------------------------------------------------------|
| `<down>` | move down |
| `alt-<down>` | move a page down |
| `<up>` | move up |
Expand All @@ -80,8 +83,8 @@ The tracker mode clipboard is independent of text and code clipboard.
| `]` | increment by 1 |
| `<backspace>` | delete a digit |
| `shift-<backspace>` | delete an entry, shift numbers up |
| `<enter>` | move down (increase length only if on the entry immediately after the current length) |
| `shift-<enter>` | duplicate entry and shift downwards (increase length as `<enter>`) |
| `<enter>` | commit edit (increase length if cursor in position after last entry) |
| `shift-<enter>` | commit edit, then duplicate entry and shift downwards (increase length as `<enter>`) |
| `alt-x` | cut value (n.b. `ctrl-x` not supported) |
| `alt-c` | copy value (n.b. `ctrl-c` not supported) |
| `alt-v` | paste value (n.b. `ctrl-v` not supported) |
Expand All @@ -95,6 +98,7 @@ The tracker mode clipboard is independent of text and code clipboard.
| `-` | negate value |
| `<space>` | toggle non-zero to zero, and zero to 1 |
| `0` to `9` | numeric entry |
| `shift-2` (`@`) | toggle turtle display marker (`<`) |

## Preset read mode

Expand Down
105 changes: 89 additions & 16 deletions docs/ops/controlflow.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,6 @@ If `x` is not zero execute command
(see example 2)
```
5. Dependent scripts
```text
SCRIPT 1:
IF 0: TR.P 1 => do nothing
SCRIPT 2 => will pulse output 2
SCRIPT 2:
ELSE: TR.P 2 => will not pulse output 2 if called directly,
but will if called from script 1
```
"""

[ELIF]
Expand All @@ -76,30 +65,114 @@ L 4 1: TR.PULSE I => pulse outputs 4, 3, 2 and 1
```
"""

[W]
prototype = "W x: ..."
short = "run the command while condition x is true"
description = """
Runs the command while the condition `x` is true or the loop iterations exceed 10000.
For example, to find the first iterated power of 2 greater than 100:
```
A 2
W LT A 100: A * A A
```
A will be 256.
"""

[EVERY]
prototype = "EVERY x: ..."
short = "run the command every `x` times the command is called"
description = """
Runs the command every `x` times the line is executed. This is tracked on a per-line basis, so each script can have 6 different "dividers".
Here is a 1-script clock divider:
```
EVERY 2: TR.P 1
EVERY 4: TR.P 2
EVERY 8: TR.P 3
EVERY 16: TR.P 4
```
The numbers do _not_ need to be evenly divisible by each other, so there is no problem with:
```
EVERY 2: TR.P 1
EVERY 3: TR.P 2
```
"""

[SKIP]
prototype = "SKIP x: ..."
short = "run the command every time except the `x`th time."
description = """
This is the corollary function to `EVERY`, essentially behaving as its exact opposite.
"""


[OTHER]
prototype = "OTHER: ..."
short = "runs the command when the previous `EVERY`/`SKIP` did not run its command."
description = """
`OTHER` can be used to do somthing alternately with a preceding `EVERY` or `SKIP` command.
For example, here is a script that alternates between two triggers to make a four-on-the-floor beat with hats between the beats:
```
EVERY 4: TR.P 1
OTHER: TR.P 2
```
You could add snares on beats 2 and 4 with:
```
SKIP 2: TR.P 3
```
"""

[SYNC]
prototype = "SYNC x"
short = "synchronizes _all_ `EVERY` and `SKIP` counters to offset `x`."
description = """
Causes all of the `EVERY` and `SYNC` counters to synchronize their offsets, respecting their individual divisor values.
Negative numbers will synchronize to to the divisor value, such that `SYNC -1` causes all every counters to be 1 number before their divisor, causing each `EVERY` to be true on its next call, and each `SKIP` to be false.
"""

[PROB]
prototype = "PROB x: ..."
short = "potentially execute command with probability `x` (0-100)"

[SCRIPT]
prototype = "SCRIPT x"
short = "execute script `x` (1-8), recursion allowed"
prototype = "SCRIPT"
prototype_set = "SCRIPT x"
short = "get current script number, or execute script `x` (1-8), recursion allowed"
description = """
Execute script `x` (1-8), recursion allowed.
There is a limit of 8 for the maximum number of nested calls to `SCRIPT` to stop infinite loops from locking up the Teletype.
"""

[SCENE]
prototype = "SCENE x"
short = "load scene `x` (0-31)"
prototype = "SCENE"
prototype_set = "SCENE x"
short = "get the current scene number, or load scene `x` (0-31)"
description = """
Load scene `x` (0-31).
Does _not_ execute the `I` script.
Will _not_ execute from the `I` script on scene load. Will execute on subsequent calls to the `I` script.
**WARNING**: You will lose any unsaved changes to your scene.
"""

[KILL]
prototype = "KILL"
short = "clears stack, clears delays, cancels pulses, cancels slews"
short = "clears stack, clears delays, cancels pulses, cancels slews, disables metronome"

[BREAK]
prototype = "BREAK"
aliases = ["BRK"]
short = "halts execution of the current script"
2 changes: 1 addition & 1 deletion docs/ops/hardware.toml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Flip the state of trigger output `x`.

["TR.PULSE"]
prototype = "TR.PULSE x"
aliases = ["TR.P x"]
aliases = ["TR.P"]
short = "Pulse trigger output x"
description = """
Pulse trigger output x.
Expand Down
4 changes: 4 additions & 0 deletions docs/ops/maths.toml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,10 @@ For more info, see the post on [samdoshi.com][samdoshi_com_euclidean]
[^euclidean_rhythm_citation]: Toussaint, G. T. (2005, July). The Euclidean algorithm generates traditional musical rhythms. _In Proceedings of BRIDGES: Mathematical Connections in Art, Music and Science_ (pp. 47-56).
"""

[BPM]
prototype = "BPM x"
short = "milliseconds per beat in BPM `x`"

[N]
prototype = "N x"
short = "converts an equal temperament note number to a value usable by the CV outputs (`x` in the range `-127` to `127`)"
Expand Down
4 changes: 4 additions & 0 deletions docs/ops/turtle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
## Turtle

A 2-dimensional, movable index into the pattern values as displayed on the TRACKER screen.

81 changes: 81 additions & 0 deletions docs/ops/turtle.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
["@"]
prototype = "@"
prototype_set = "@ x"
short = "get or set the current pattern value under the turtle"

["@X"]
prototype = "@X"
prototype_set = "@X x"
short = "get the turtle X coordinate, or set it to x"

["@Y"]
prototype = "@Y"
prototype_set = "@Y x"
short = "get the turtle Y coordinate, or set it to x"

["@MOVE"]
prototype = "@MOVE x y"
short = "move the turtle x cells in the X axis and y cells in the Y axis"

["@F"]
prototype = "@F x1 y1 x2 y2"
short = "set the turtle's fence to corners x1,y1 and x2,y2"

["@FX1"]
prototype = "@FX1"
prototype_set = "@FX1 x"
short = "get the left fence line or set it to x"

["@FX2"]
prototype = "@FX2"
prototype_set = "@FX2 x"
short = "get the right fence line or set it to x"

["@FY1"]
prototype = "@FY1"
prototype_set = "@FY1 x"
short = "get the top fence line or set it to x"

["@FY2"]
prototype = "@FY2"
prototype_set = "@FY2 x"
short = "get the bottom fence line or set it to x"

["@SPEED"]
prototype = "@SPEED"
prototype_set = "@SPEED x"
short = "get the speed of the turtle's @STEP in cells per step or set it to x"

["@DIR"]
prototype = "@DIR"
prototype_set = "@DIR x"
short = "get the direction of the turtle's @STEP in degrees or set it to x"

["@STEP"]
prototype = "@STEP"
short = "move `@SPEED`/100 cells forward in `@DIR`, triggering `@SCRIPT` on cell change"

["@BUMP"]
prototype = "@BUMP"
prototype_set = "@BUMP 1"
short = "get whether the turtle fence mode is BUMP, or set it to BUMP with 1"

["@WRAP"]
prototype = "@WRAP"
prototype_set = "@WRAP 1"
short = "get whether the turtle fence mode is WRAP, or set it to WRAP with 1"

["@BOUNCE"]
prototype = "@BOUNCE"
prototype_set = "@BOUNCE 1"
short = "get whether the turtle fence mode is BOUNCE, or set it to BOUNCE with 1"

["@SCRIPT"]
prototype = "@SCRIPT"
prototype_set = "@SCRIPT x"
short = "get which script runs when the turtle changes cells, or set it to x"

["@SHOW"]
prototype = "@SHOW"
prototype_set = "@SHOW 0/1"
short = "get whether the turtle is displayed on the TRACKER screen, or turn it on or off"
15 changes: 15 additions & 0 deletions docs/ops/variables.toml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,21 @@ prototype = "TIME.ACT"
prototype_set = "TIME.ACT x"
short = "enable or disable timer counting, default `1`"

[LAST]
prototype = "LAST x"
short = "get value in milliseconds since last script run time"
description = """
Gets the number of milliseconds since the current script was run. From the live mode, shows time elapsed since last run of I script.
For example, one-line tap tempo:
```
M LAST SCRIPT
```
Running this script twice will set the metronome to be the time between runs.
"""

[X]
prototype = "X"
prototype_set = "X x"
Expand Down
2 changes: 1 addition & 1 deletion docs/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ The *INIT* script (represented as `I`) is executed when a preset is recalled. Th
* VALUE -- a number
* OPERATOR -- a function, may need value(s) as argument(s), may return value
* VARIABLE -- named memory storage
* MOD -- condition/rule that applies to rest of the *command*, ie del, prob, if, s
* MOD -- condition/rule that applies to rest of the *command*, e.g.: del, prob, if, s

### Syntax

Expand Down
Loading

0 comments on commit ad358cd

Please sign in to comment.