Skip to content

Latest commit

 

History

14 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

osc-cr

A simple framework for OSC communication in the Crystal language.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      osc-cr:
        github: M1sui/osc-cr
  2. Run shards or shards instal

Usage

See your-project/lib/example/OSC-Example.cr for details.

# 1. Initialize
require "osc-cr"
osc = OSC.new("127.0.0.1", 9000, 9001)

# 2. Receive Event
osc.message(path: "/test/aba") { |event|
	puts(event.data)      #-> OSC argument - Value
	puts(event.data.path) #-> OSC Message - "/test/aba"
	puts(event.data.type) #-> Bool | Int32 | Float32 | String | Nil

	# Send can be used anywhere after initialization
	osc.sendb("/test/aba/respond".true)
}

# 3. Recieve Server Run
osc.run()

# 4. Other Process
osc.sendb("/test/hoge", true) # -> Bool
osc.sendi("/test/fuga", 123)  # -> Int
osc.sendf("/test/piyo", 1.23) # -> Float

loop {
  osc.sendi("/test/minute", Time.local.minute)
  sleep(1.second)
}

The order must be in accordance with the numbering.

Contributors

About

A simple framework for using OSC (Open-Sound-Control) with Crystal

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages