Coder Social home page Coder Social logo

regexpoetics's Introduction

Regular Expressions

Regular Expressions Screengrab

Poems & patterns in your ears. A simple interface for converting written text into OSC messages.

Setup

Install npm dependencies:

npm install

Install bower dependencies:

bower install

Start the server:

grunt

Open up your browser to http://localhost:3000

OSC Endpoints

  • /com/notioncollective/key - fires on every keydown in text input
  • /com/notioncollective/[n] - all messages for expression #n
  • /com/notioncollective/notes - each individual matched note is a separate param, with a number
  • /com/notioncollective/[n]/notes - same as above, but only for the selected regex
  • /com/notioncollective/words - word count for entire contents of text input
  • /com/notioncollective/[n]/words - word count for matches of expression n
  • /com/notioncollective/chars - chartacter count for entire contents of text input
  • /com/notioncollective/[n]/chars - character count for matches for expression n
  • /com/notioncollective/count - count of matches for all regexes
  • /com/notioncollective/[n]/count - count of matches for regex #n

Some handy regular expressions

  • /[^\s]*?abc[^\s]*?$/ - Capture words that contain "abc" only if they are the last word in the line
  • /\w+\.$/ - Capture the last word in a sentence followed by a period.
  • /(^|\n)+?\n$/ - Capture the last line
  • /(\n|^).*?\n/ - Capture every line
  • How to do not a word? Almost there but not quite

Todo

  • Change OSC namespacing from notioncollective to regexpoetics
  • Write instructions for setup
  • Clean up samples/scores
  • Figure out a way to have pd samples auto-load? (might not be possible)
  • Figure out how to have mixer automatically set itself up? (might be a pain)
  • Button to show/hide regular expressions
  • send ascii characters instead of notes
  • Add ability to do sharps/flats
    • captial letter is sharp?
  • Add ability to add flags to regex
  • Control panel buttons
    • There should be an "Update" button for updating the fields
      • This will just send both the host and port (on client)
    • "Reset" button
      • Send an OSC reset message (on server)
      • Clear all input fields (on client)
    • "Sync" button?
  • Maybe we should use captures and not matches? Have to think about this a bit
  • Abstract messaging a bit so that all osc messages are also sent back to the client
  • Update namespacing to "/com/nc/regexpoetics/" ? Or something project-specific.
  • BUG: Sometimes live updating interferes with your typing.
    • Possible fix: each client gets a client id, sends that id with messages.

Release Notes

0.1.1

  • Some style tweaks
  • This is the version used for the 4/4/2014 performance

0.1.0

  • Added /watch view for live display of text/rules
    • includes highlighting rules when there is a match
    • read-only

0.0.7

  • Tagging master before merging in "watch" branch

0.0.6

  • Menu bar for various options
    • OSC send parameters (ip, port)
    • Reset button

0.0.5

  • Updated osc channels so that expression number comes first (/com/notioncollective/0/chars)

0.0.4

  • Added osc paths or individual expression word count, or individual expression char count.
  • A few bug fixes

0.0.3

  • Updated messages to include the following
    • Global
      • Word count
      • Char count
      • Bang per key press
    • Per regex
      • Count (global and per expression)
      • Musical notes (global and per expression)
  • Update so text area content will not update when focused

0.0.2

  • Set interface to automatically sync text fields
    • text updates
    • regex updates with info about whether regexes are evaluating correctly

0.0.1

  • Basic system working and in place
    • Capturing input
    • Checking for regular expressions in rules input
    • Evaluating text using rules
    • Sending osc messages based on matches in text

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.