xi-superdirt 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6900bf81dae98e35be9679003f2a2efde4835697e15b1da350401ae0843c5bbf
4
- data.tar.gz: 21ddf1daf425fd300087160abda1aefd315143d36af0458c6d4b35026998a51a
3
+ metadata.gz: fdec189cdf14f13ffc21d86f96ca59477d02cb9ab6bff533e21d72e5409a9d3c
4
+ data.tar.gz: 789340f614f12bdf1b9917f80bb76ca43694dd89726a23296a62a27b27050f51
5
5
  SHA512:
6
- metadata.gz: fd8d132d380dbd52d348bb8c88af732c981c13582eb4ce6df4fb07b0fcf60f7cdca6e3d1d1ec7ff06895ff09c0a2d041ddb9d713d1a5be68be264b87e6a7268c
7
- data.tar.gz: f5c84b47ea258eeb4e77275ce3b9a82fbd25cd896ac53032ef9bc29dcf8775f80c6be065f5d3faf62774d8a6f41d3317cb484fde5e58dd2efd04314642ec3406
6
+ metadata.gz: 909bf5b98f5820bcc91adb17a77fc513af7b2f3acd7632adea08f33304d7b555182397370f7f22533ad5611a7fd7725fc97e375266076cf8c876c1d8a48d5a80
7
+ data.tar.gz: 87d5332cf21174c26193bdb60fe3f4b02da9aa9727575208f2c8194583196f171fd4ade7dd22724194f975ff0b3c4865d277d8679dd55a88a5ccee589062257e
data/.gitignore CHANGED
@@ -1,8 +1,9 @@
1
1
  /.bundle/
2
- /.yardoc
3
- /_yardoc/
4
2
  /coverage/
5
3
  /doc/
4
+ /Gemfile.lock
6
5
  /pkg/
7
6
  /spec/reports/
8
7
  /tmp/
8
+ /_yardoc/
9
+ /.yardoc
@@ -6,6 +6,11 @@ module Xi::Superdirt
6
6
  class Stream < Xi::Stream
7
7
  include Xi::OSC
8
8
 
9
+ DEFAULT_PARAMS = {
10
+ freq: 440,
11
+ speed: 1
12
+ }
13
+
9
14
  def initialize(name, clock, server: "localhost", port: 57120, base_node_id: 2000, **opts)
10
15
  debug "Xi::Superdirt initialized"
11
16
  super
@@ -20,11 +25,18 @@ module Xi::Superdirt
20
25
  def transform_state
21
26
  super
22
27
 
28
+ @state = DEFAULT_PARAMS.merge(@state)
29
+
23
30
  if changed_param?(:db) && !changed_param?(:amp)
24
31
  @state[:amp] = @state[:db].db_to_amp
25
32
  @changed_params << :amp
26
33
  end
27
34
 
35
+ if changed_param?(:speed) && !changed_param?(:freq)
36
+ @state[:freq] = 440 * @state[:speed]
37
+ @changed_params << :freq
38
+ end
39
+
28
40
  if changed_param?(:midinote) && !changed_param?(:freq)
29
41
  @state[:freq] = Array(@state[:midinote]).map(&:midi_to_cps)
30
42
  @changed_params << :freq
@@ -1,5 +1,5 @@
1
1
  module Xi
2
2
  module Superdirt
3
- VERSION = "0.1.0"
3
+ VERSION = "0.2.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xi-superdirt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - rapofran
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-28 00:00:00.000000000 Z
11
+ date: 2019-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,9 +69,7 @@ dependencies:
69
69
  description:
70
70
  email:
71
71
  - rapofran@riseup.net
72
- executables:
73
- - console
74
- - setup
72
+ executables: []
75
73
  extensions: []
76
74
  extra_rdoc_files: []
77
75
  files:
@@ -82,8 +80,6 @@ files:
82
80
  - LICENCE.txt
83
81
  - README.md
84
82
  - Rakefile
85
- - bin/console
86
- - bin/setup
87
83
  - lib/xi/superdirt.rb
88
84
  - lib/xi/superdirt/stream.rb
89
85
  - lib/xi/superdirt/version.rb
data/bin/console DELETED
@@ -1,14 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "xi/superdirt"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- # (If you use this, don't forget to add pry to your Gemfile!)
10
- # require "pry"
11
- # Pry.start
12
-
13
- require "irb"
14
- IRB.start(__FILE__)
data/bin/setup DELETED
@@ -1,8 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
- set -vx
5
-
6
- bundle install
7
-
8
- # Do any other automated setup that you need to do here