1
0
Fork 0
Use Comment Macro syntax as a remote scripting language to control a Hog4 over the network via OSC.
Go to file
Kevin Matz 345c51e6ca implement Page Change 2018-10-22 18:16:08 -04:00
.gitignore grammar has stabilized. distribute antlr files. 2018-10-20 18:25:04 -04:00
CommentMacro.g4 multi-target keystroke macro support 2018-10-22 17:58:13 -04:00
CommentMacroLexer.py grammar has stabilized. distribute antlr files. 2018-10-20 18:25:04 -04:00
CommentMacroListener.py grammar has stabilized. distribute antlr files. 2018-10-20 18:25:04 -04:00
CommentMacroParser.py multi-target keystroke macro support 2018-10-22 17:58:13 -04:00
LICENSE.md add license and manifest 2018-10-17 21:32:31 -04:00
MANIFEST.in grammar has stabilized. distribute antlr files. 2018-10-20 18:25:04 -04:00
OscCommentMacroListener.py parser can be recalled from the ctx context 2018-10-21 15:52:14 -04:00
OscMacroDefinitions.py implement Page Change 2018-10-22 18:16:08 -04:00
README.md implement Page Change 2018-10-22 18:16:08 -04:00
comment.py variable rename for consistency 2018-10-21 22:15:40 -04:00
server.cfg better default config 2018-10-22 14:20:43 -04:00

README.md

Bacon Script

A theoretical exersise to control a Hog 4 via OSC, with comment macros.

The comment macro grammer described in CommentMacro.g4 is based upon the Hog 3.9 manual, Chapter 22.4. The python3 implementation in OscMacroDefinitions.py is based on Chapter 24.2 in the same manual.

Some macros are unsupported/unsupportable with this method. Some macro freatures, like timing, are not yet implemented. Refer to the Features table for specific notes.

Installing

Install Python-OSC for output.

$ pip install python-osc

Install Antlr4 for input.

$ pip install antlr4-python3-runtime

Use git to retrieve a copy of the code.

$ git clone http://company235.com/git/kevin/baconscript.git
$ cd baconscript

Testing

Edit server.cfg to the correct values for your Hog4.

comment.py will accept macros on the command line, or will run an interactive prompt.

$ ./comment.py
comment#

Use the builtin command exit to quit the interacive prompt.

Developing

You must also install the ANTLR tool. On a mac with homebrew, do:

$ brew install antlr

Update the lexer and parser for Python3

$ antlr -Dlanguage=Python3 CommentMacro.g4

Features

Only features that are supported in both OSC and Comment Macros are able to be implimented in baconscript. This table lists all comment macros (as of 3.9) that are implimented in python.

Grammar Feature eg. Supported
fade times t5 no
multiple targets 1,2 Yes
ranges 1>4 Yes, intigers only
multiple macros GM1:GL3 Yes
network devies h4 Yes, H devies only
Macro Function Supported Notes
GM Go Master Yes
HM Halt Master Yes
AM Assert Master Partial on current master only
RM Release Master Partial on current master only
RA Relase All Yes
RO Release Others no
FM Fade Master Partial no times, no *
FGM Fade Grand Master Partial no times
CM Choose Master Yes
GL Go List Yes
HL Halt List Yes
AL Assert List no
RL Release List Yes
GB Go Batch no
HB Halt Batch no
AB Assert Batch no
RB Release Batch no
GS Go Scene Yes
HS Halt Scene Yes
AS Assert Scene no
RS Release Scene Yes
CP Change Page Partial only CP+ and CP-
RV Recall View no
ET Enable Timecode no
DT Disable Timecode no
OT Open Timecode Toolbar no
MS Midi String no possible?
MN Midi Note no
RN Reset Node no
GK Go Keystroke Macro Yes
HK Pause Keystroke Macro Yes
RK Stop Keystroke Macro Yes .

Future Work

Pleas feel welcome to submit pull requests or patches that enable support for:

  • Sending target ranges as OSC batches
  • Send multi-macro line as an OSC batch
  • Timing on master fades