cw 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7e3d3d2ac3c6f0d0768543c4140ca14035c23c65
4
- data.tar.gz: c110606d40f04c564262883c565fe38c99fed9f3
3
+ metadata.gz: 6f9afa759907fb0e7b21040a2ded39c2f63afa1c
4
+ data.tar.gz: 80e9d68f993ec46c96c4ca791f8a9330b24ce110
5
5
  SHA512:
6
- metadata.gz: 4794a516a4b8881d24d1bebc9f0c9bc63921b8a4eca97a8ce551ac111055d9afbd86fc290502ba36f8bec78f20ef2f6036303060c1b826430137725d03d6c7b4
7
- data.tar.gz: 20cf42901391040da1865eb6cf6092e8ba22e707578b7fc7ae19d8df091a8f1c23a47741f27670883ebd8e93973e0374b2cb928195cf55eef7f8f0aea70709b0
6
+ metadata.gz: 7a46e8ee242b6b3d6e1c1dd603dd7afae2e945debdc32cd3eb9e9c5256ab4260c7690fbcbe34bd582f269444eed110977c2dc210521574fc5b3f55e1e1e0e5b4
7
+ data.tar.gz: f4adad501d5e1a397eceeb966a2339af495bc49c5a60565d11da97e40924c99c195336ed050d84ced79c1ae6385100f1a22c2ac60e89a69321fa289b2d0a9e53
data/.cw_config CHANGED
@@ -1,18 +1,9 @@
1
- wpm = 25
2
- frequency = 450
3
- volume = 1
4
- book_name = book.txt
5
- book_dir = data/text/
6
- success_colour = green
7
- fail_colour = red
8
- list_colour = default
9
- ebook2cw_path = /usr/bin/ebook2cw
10
- run_default = test_letters
11
- dictionary_dir = data/text/
12
- dictionary_name = english.txt
13
- audio_filename = audio_output
14
- audio_dir = audio
15
- book_name = book.txt
16
- book_dir = data/text/
17
- run_default = test_letters
18
- word_count = 16
1
+ wpm = 25
2
+ frequency = 450
3
+ volume = 1
4
+ success_colour = green
5
+ fail_colour = red
6
+ list_colour = default
7
+ ebook2cw_path = /usr/bin/ebook2cw
8
+ run_default = test_letters
9
+ word_count = 16
data/.gitignore CHANGED
@@ -41,3 +41,4 @@ audio/audio_output.wav
41
41
  /.yardoc/
42
42
  /.yardoc/
43
43
  /.yardoc/
44
+ /.cw/
data/README.md CHANGED
@@ -1,3 +1,4 @@
1
+ [![Join the chat at https://gitter.im/mjago/CW](https://badges.gitter.im/mjago/CW.svg)](https://gitter.im/mjago/CW?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1
2
  [![Gem Version](https://badge.fury.io/rb/cw.svg)](https://badge.fury.io/rb/cw)
2
3
  [![Build Status](https://travis-ci.org/mjago/CW.svg?branch=master)](https://travis-ci.org/mjago/CW)
3
4
  [![Code Climate](https://codeclimate.com/github/mjago/CW/badges/gpa.svg)](https://codeclimate.com/github/mjago/CW)
@@ -11,10 +12,15 @@
11
12
 
12
13
  **CW** is a program for learning and practicing Morse Code (CW). It is written in the form of a [DSL](https://en.wikipedia.org/wiki/Domain-specific_language/) in the [Ruby](https://www.ruby-lang.org/en/downloads/) language.
13
14
 
14
- **CW** can read _books_ (and remember where you are), _rss feeds_ (your daily quotation for instance), common _phrases_, _QSO_ codes etc, in
15
- addition to generating random words, letters, and numbers that possibly match some required pattern (i.e. words_beginning_with 'v').
15
+ **CW** can read _books_ (and remember where you are), _rss feeds_
16
+ (your daily quotation for instance), common _phrases_, _QSO_ codes
17
+ etc, in addition to generating random words, letters, and numbers that
18
+ possibly match some required pattern (i.e. words_beginning_with 'v').
16
19
 
17
- **CW** also allows for real-time progress marking by indicating correct and incorrect characters and words copied in real-time. A follow mode also exists which prints the output just after it has played it (for `in head' practice).
20
+ **CW** also allows for real-time progress marking by indicating
21
+ correct and incorrect characters and words copied in real-time. A
22
+ follow mode also exists which prints the output just after it has
23
+ played it (for `in head' practice).
18
24
 
19
25
  **CW** is thoroughly [documented](http://mjago.github.io/CW/), and includes a [hands-on tutorial](http://martynjago.co.uk/CW/mydoc_learning_the_alphabet/).
20
26
 
@@ -28,7 +34,7 @@ cw example.rb
28
34
  ### Note:
29
35
 
30
36
  - Requires Ruby 2+
31
- - Tested on OS X, and Linux.
37
+ - Tested on OS X, and Linux. A Vagrantfile is available in the root directory.
32
38
 
33
39
  # Example CW Script
34
40
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -0,0 +1,63 @@
1
+ SHOW_ALL = true
2
+ SHOW_TONE = true if SHOW_ALL
3
+ SHOW_N = true if SHOW_ALL
4
+ SHOW_BINWIDTH = true if SHOW_ALL
5
+ SHOW_COEFFS = true if SHOW_ALL
6
+
7
+ @sample_rate = 44100
8
+ #@sample_rate = 48000
9
+ #@sample_rate = 96000
10
+ #@sample_rate = 192000
11
+
12
+ def sample_period ; 1.0 / @sample_rate ; end
13
+ def k ; (0.5 + ((n * @tone) / @sample_rate)).to_i ; end
14
+ def w ; ((2 * Math::PI) / n) * k ; end
15
+ def n ; @sample_rate/@bin_width ; end
16
+ def cosine ; Math.cos(w) ; end
17
+ def sine ; Math.sin(w) ; end
18
+ def coeff ; 2 * cosine ; end
19
+ def bin_width(val) ; @bin_width = val ; end
20
+ def tone(val) ; @tone = val ; end
21
+ def n_delay_ms ; ((1.0/@sample_rate) * n * 1000); end
22
+ def centre_freq ; @sample_rate / n ; end
23
+ @data = [
24
+ {tone: 400, bin_width: 40},
25
+ {tone: 400, bin_width: 80},
26
+ {tone: 450, bin_width: 45},
27
+ {tone: 450, bin_width: 90},
28
+ {tone: 500, bin_width: 50},
29
+ {tone: 500, bin_width: 100},
30
+ {tone: 550, bin_width: 55},
31
+ {tone: 550, bin_width: 110},
32
+ {tone: 600, bin_width: 60},
33
+ {tone: 600, bin_width: 120},
34
+ {tone: 700, bin_width: 70},
35
+ {tone: 700, bin_width: 140},
36
+ {tone: 800, bin_width: 80},
37
+ {tone: 800, bin_width: 160},
38
+ {tone: 900, bin_width: 90},
39
+ {tone: 900, bin_width: 180},
40
+ {tone: 1000, bin_width: 50},
41
+ {tone: 1000, bin_width: 100},
42
+ ]
43
+ puts "Calculator"
44
+ puts "----------"
45
+ puts
46
+ puts "Sample Rate: #{@sample_rate} Hz"
47
+ puts "Sample Period: #{sample_period * 1000000.0} usec"
48
+ puts
49
+ @data.each do |dat|
50
+ puts "* * * * * * * *"
51
+ puts "Desired Tone: #{tone(tone dat[:tone])} Hz" if SHOW_TONE
52
+ puts "Desired binwidth: #{bin_width dat[:bin_width]}" if SHOW_BINWIDTH
53
+ puts "N value: #{n}" if SHOW_N
54
+ puts "N delay: #{n_delay_ms} msec" if SHOW_N
55
+ puts "(Sample Rate / N): #{@sample_rate.to_f / n.to_f}" if SHOW_N
56
+ puts "Tone / (Sample rate / N): #{(@tone.to_f / (@sample_rate.to_f / n.to_f))} is multiple?" if SHOW_N
57
+ puts "k: #{k}" if SHOW_COEFFS
58
+ puts "w: #{w}" if SHOW_COEFFS
59
+ puts "cosine: #{cosine}" if SHOW_COEFFS
60
+ puts "sine: #{sine}" if SHOW_COEFFS
61
+ puts "coeff: #{coeff}" if SHOW_COEFFS
62
+ puts
63
+ end
@@ -0,0 +1,33 @@
1
+ require 'gruff'
2
+
3
+ 0.upto(112) do |count|
4
+ puts "#{count}, #{100 + count * 8}"
5
+ end
6
+
7
+ def test_line_small_values
8
+ @datasets = [
9
+ [:narrow, [0.0,0.198,0.156,0.356,0.333,0.356,0.227,0.255,0.317,0.409,0.402,0.393,0.343,0.109,0.305,0.428,0.456,0.392,0.242,0.419,0.296,0.467,0.585,0.458,0.454,0.253,0.286,0.762,0.672,0.595,0.577,0.443,0.275,0.603,0.81,0.909,0.716,0.632,0.264,1.368,1.356,1.352,1.221,1.155,2.182,4.018,4.095,3.919,4.933,5.584,5.78,5.78,5.543,4.931,3.782,3.318,1.608,0.637,1.861,1.339,1.371,1.275,1.098,0.647,0.619,0.952,0.932,0.786,0.814,0.366,0.384,0.567,0.599,0.771,0.425,0.478,0.881,0.519,0.485,0.566,0.331,0.25,0.159,0.325,0.403,0.526,0.381,0.206,0.236,0.25,0.339,0.393,0.289,0.26,0.311,0.187,0.287,0.32,0.269,0.324,0.409,0.514,0.242,0.282,0.251,0.405,0.471,0.225,0.201,0.366,0.241,0.271,0.306]],
10
+ [:wide, [0.198,0.092,0.187,0.257,0.334,0.369,0.369,0.397,0.4,0.368,0.317,0.323,0.333,0.099,0.165,0.264,0.392,0.428,0.474,0.492,0.48,0.436,0.661,0.395,0.253,0.137,0.147,0.853,0.602,0.7,0.637,0.876,0.733,0.733,1.055,0.634,0.531,0.347,0.133,1.272,1.376,1.061,1.724,2.287,2.009,2.268,2.507,2.688,2.815,2.883,2.89,2.89,2.882,2.794,2.676,2.496,2.267,1.953,2.47,1.511,1.05,0.832,0.848,0.63,0.333,1.429,0.617,0.685,0.744,0.727,0.703,0.622,0.508,0.858,0.265,0.478,0.914,0.296,0.333,0.525,0.435,0.444,0.47,0.526,0.406,0.485,0.212,0.13,0.243,0.134,0.21,0.36,0.31,0.33,0.346,0.328,0.302,0.351,0.2,0.308,0.398,0.514,0.138,0.193,0.234,0.26,0.268,0.26,0.289,0.236,0.169,0.42,0.341]],
11
+ [:v_narrow, [0.0,0.198,0.175,0.326,0.301,0.189,0.109,0.243,0.292,0.37,0.214,0.27,0.33,0.201,0.438,0.47,0.17,0.489,0.296,0.412,0.48,0.45,0.349,0.486,0.479,0.357,0.501,0.67,0.554,0.506,0.637,0.443,0.511,0.769,0.762,0.742,0.923,0.81,0.511,1.292,1.494,0.683,1.73,1.479,1.957,2.885,2.288,2.188,6.903,9.976,11.56,11.56,10.212,5.167,6.356,3.505,2.15,1.184,1.497,1.331,0.72,1.127,0.959,0.646,0.902,0.786,0.45,0.744,0.608,0.469,0.622,0.492,0.45,0.522,0.522,0.478,0.881,0.454,0.418,0.363,0.564,0.313,0.296,0.414,0.372,0.497,0.39,0.3,0.314,0.364,0.238,0.199,0.337,0.235,0.277,0.302,0.336,0.493,0.277,0.274,0.385,0.514,0.259,0.207,0.214,0.26,0.359,0.189,0.256,0.255,0.149,0.25,0.214]]
12
+ ]
13
+
14
+ g = Gruff::Line.new
15
+ g.title = 'Different bin widths'
16
+ @datasets.each do |data|
17
+ g.hide_dots = true
18
+ g.data(data[0], data[1])
19
+ g.labels = {0 => '100', 50 => '500', 112 => '1000'}
20
+ end
21
+ g.write('test/output/different_bin_widths.png')
22
+
23
+ g = Gruff::Line.new(400)
24
+ g.title = 'Different bin widths'
25
+ g.hide_dots = true
26
+ @datasets.each do |data|
27
+ g.data(data[0], data[1])
28
+ g.labels = {0 => '100'}
29
+ end
30
+ g.write('test/output/different_bin_widths_small.png')
31
+ end
32
+
33
+ test_line_small_values
@@ -0,0 +1,35 @@
1
+ require 'gruff'
2
+
3
+ count = 0
4
+ (0..1000).step(8) do |idx|
5
+ puts "#{count}, #{idx}"
6
+ count += 1
7
+ end
8
+
9
+ def test_line_small_values
10
+ @datasets = [
11
+ [:wide, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.112,0.288,0.365,0.272,0.313,0.142,0.061,0.167,0.219,0.302,0.337,0.39,0.405,0.39,0.39,0.312,0.288,0.354,0.27,0.462,0.218,0.315,0.641,0.455,0.487,0.489,0.461,0.461,0.402,0.702,0.623,0.073,0.451,0.362,0.498,0.607,0.686,0.728,0.712,0.748,0.671,1.177,0.432,0.233,0.977,0.576,0.897,1.225,1.538,2.088,2.546,2.398,2.604,2.758,2.856,2.894,2.894,2.89,2.85,2.764,2.546,2.374,2.102,1.831,1.752,1.211,1.887,0.568,0.698,0.87,0.422,0.564,0.683,0.701,0.701,0.7,0.869,0.656,0.88,0.565,0.414,0.424,0.188,0.29,0.368,0.42,0.443,0.438,0.429,0.514,0.351,0.276,0.189,0.389,0.36,0.547,0.242,0.471,0.322,0.332,0.321,0.319,0.288,0.237,0.177,0.158,0.237,0.106,0.167,0.215,0.38,0.413,0.266,0.25,0.301,0.214,0.281,0.215,0.062]],
12
+ [:narrow, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.385,0.267,0.321,0.246,0.272,0.087,0.191,0.25,0.369,0.375,0.272,0.119,0.241,0.375,0.419,0.37,0.324,0.27,0.395,0.38,0.424,0.453,0.281,0.573,0.463,0.392,0.513,0.596,0.562,0.629,0.145,0.412,0.586,0.634,0.556,0.516,0.678,0.44,0.726,0.845,0.845,0.729,0.388,0.977,1.01,1.307,1.313,1.241,0.951,2.313,3.813,3.32,4.463,5.325,5.742,5.742,5.729,5.304,4.458,4.101,2.027,3.256,0.952,1.302,1.365,1.345,0.974,0.698,1.058,0.739,0.822,1.224,0.682,0.464,1.211,0.677,0.602,0.671,0.499,0.545,0.473,0.349,0.469,0.47,0.723,0.292,0.609,0.244,0.598,0.405,0.379,0.331,0.476,0.291,0.42,0.352,0.336,0.24,0.199,0.12,0.247,0.309,0.29,0.223,0.188,0.219,0.197,0.27,0.274,0.212,0.25,0.079,0.155,0.235,0.255,0.249,0.232,0.118]],
13
+ [:v_narrow, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.385,0.328,0.32,0.138,0.461,0.124,0.039,0.141,0.233,0.407,0.23,0.264,0.263,0.329,0.266,0.383,0.352,0.321,0.395,0.4,0.406,0.341,0.455,0.548,0.341,0.501,0.333,0.31,0.55,0.538,0.281,0.601,0.649,0.319,0.659,0.523,0.733,0.712,0.707,0.769,0.811,0.94,0.632,0.977,1.082,1.022,1.118,1.538,1.53,2.081,2.603,2.571,2.758,7.909,11.123,11.123,11.04,7.693,2.668,4.383,2.543,3.41,1.541,1.491,1.109,1.067,1.155,1.109,1.058,1.074,0.736,0.704,0.701,0.701,1.061,0.717,0.559,0.345,0.651,0.56,0.549,0.509,0.559,0.261,0.456,0.431,0.529,0.396,0.402,0.243,0.358,0.326,0.559,0.312,0.463,0.28,0.358,0.322,0.296,0.223,0.315,0.515,0.207,0.303,0.291,0.258,0.288,0.18,0.18,0.324,0.259,0.112,0.25,0.277,0.199,0.286,0.24,0.203]]
14
+ ]
15
+
16
+ g = Gruff::Line.new
17
+ g.title = 'Different bin widths'
18
+ @datasets.each do |data|
19
+ g.hide_dots = true
20
+ g.data(data[0], data[1])
21
+ g.labels = {0 => '0', 31 => '248', 62 => '498', 93 => '744', 124 => '992', 125 => nil}
22
+ end
23
+ g.write('test/output/differing_bin_widths.png')
24
+
25
+ g = Gruff::Line.new(400)
26
+ g.title = 'Different bin widths'
27
+ g.hide_dots = true
28
+ @datasets.each do |data|
29
+ g.data(data[0], data[1])
30
+ g.labels = {0 => '100'}
31
+ end
32
+ g.write('test/output/differing_bin_widths_small.png')
33
+ end
34
+
35
+ test_line_small_values
@@ -0,0 +1,47 @@
1
+ require 'gruff'
2
+
3
+ count = 0
4
+ (0..1000).step(2) do |idx|
5
+ puts "#{count}, #{idx}"
6
+ count += 1
7
+ end
8
+
9
+ def test_line_small_values
10
+ @datasets = [
11
+ [:wide, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.033,0.114,0.0,0.0,0.0,0.282,0.117,0.032,0.19,0.272,0.362,0.366,0.319,0.208,0.149,0.319,0.114,0.309,0.085,0.289,0.256,0.239,0.222,0.197,0.18,0.315,0.142,0.117,0.095,0.464,0.043,0.397,0.292,0.109,0.369,0.467,0.12,0.23,0.193,0.298,0.264,0.208,0.301,0.236,0.339,0.3,0.319,0.329,0.345,0.342,0.359,0.379,0.388,0.388,0.412,0.322,0.397,0.35,0.404,0.403,0.394,0.421,0.375,0.373,0.367,0.354,0.329,0.326,0.322,0.288,0.286,0.29,0.248,0.221,0.308,0.193,0.483,0.459,0.103,0.055,0.497,0.412,0.344,0.513,0.173,0.111,0.138,0.165,0.192,0.218,0.243,0.262,0.291,0.315,0.337,0.464,0.371,0.396,0.413,0.428,0.442,0.454,0.465,0.49,0.481,0.487,0.318,0.492,0.492,0.49,0.486,0.486,0.472,0.614,0.664,0.463,0.47,0.413,0.482,0.379,0.462,0.311,0.371,0.681,0.255,0.233,0.519,0.171,0.417,0.098,0.068,0.034,0.154,0.074,0.269,0.561,0.578,0.222,0.362,0.715,0.446,0.366,0.8,0.434,0.845,0.497,0.527,0.556,0.582,0.607,0.63,0.839,0.869,0.686,0.858,0.712,0.554,0.728,0.732,0.784,0.831,0.731,0.719,0.718,0.706,1.125,0.661,0.739,0.609,0.596,0.575,1.16,0.575,1.302,0.417,0.86,0.922,1.328,1.682,0.181,0.148,1.134,0.306,0.724,1.188,1.691,0.343,1.031,0.506,1.114,0.655,0.735,0.815,0.897,0.979,1.06,1.143,2.217,1.307,1.389,1.76,1.545,1.793,1.709,1.787,2.505,2.434,2.009,2.079,2.148,2.214,2.267,2.388,2.398,2.454,2.507,2.548,2.604,2.648,2.688,2.725,2.759,2.788,2.815,2.837,2.856,2.87,2.883,2.89,2.894,2.894,2.89,2.894,2.894,2.89,2.882,2.874,2.868,2.854,2.833,2.789,2.781,2.763,2.687,2.683,2.623,2.6,2.553,2.485,2.441,2.392,2.325,2.252,2.458,2.136,2.444,1.951,1.853,1.931,2.357,2.07,2.318,1.809,1.446,1.42,1.765,1.215,1.766,1.017,1.869,2.023,0.801,1.056,0.687,1.112,0.485,2.05,0.773,0.721,0.421,0.975,1.226,1.7,1.407,0.363,1.33,0.302,1.786,0.673,0.422,0.462,0.921,0.533,0.792,0.592,0.616,0.636,0.657,0.673,0.685,0.695,0.694,0.705,0.706,0.705,0.718,0.705,0.696,0.822,0.657,0.926,0.636,0.65,0.6,0.599,0.629,0.509,0.5,0.472,0.903,0.848,0.593,1.014,0.313,0.437,0.41,0.569,0.144,0.983,0.095,0.669,0.238,0.874,0.716,0.118,0.353,0.388,0.485,0.215,0.889,0.266,0.736,0.432,0.332,0.352,0.369,0.374,0.398,0.41,0.42,0.428,0.433,0.445,0.453,0.444,0.444,0.436,0.451,0.437,0.431,0.527,0.404,0.404,0.393,0.38,0.353,0.346,0.329,0.557,0.277,0.263,0.379,0.423,0.222,0.189,0.187,0.144,0.109,0.589,0.137,0.342,0.439,0.409,0.047,0.286,0.109,0.352,0.285,0.155,0.174,0.192,0.21,0.478,0.242,0.491,0.27,0.279,0.292,0.338,0.424,0.317,0.322,0.327,0.33,0.332,0.357,0.284,0.38,0.325,0.324,0.314,0.411,0.305,0.302,0.288,0.47,0.299,0.53,0.228,0.218,0.198,0.193,0.177,0.165,0.146,0.13,0.206,0.268,0.441,0.38,0.034,0.032,0.442,0.037,0.055,0.556,0.088,0.432,0.122,0.138,0.153,0.167,0.267,0.193,0.204,0.311,0.218,0.234,0.242,0.249,0.255,0.256,0.329,0.344,0.268,0.268,0.268,0.266,0.264,0.26,0.274,0.249,0.302,0.399,0.367,0.226,0.214,0.367,0.187,0.256,0.22,0.159,0.309,0.367,0.12,0.149,0.09,0.319,0.061,0.26,0.228,0.163]],
12
+ [:narrow, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.145,0.0,0.2,0.0,0.239,0.224,0.0,0.069,0.085,0.158,0.046,0.049,0.041,0.186,0.198,0.215,0.308,0.078,0.298,0.266,0.127,0.208,0.238,0.253,0.394,0.188,0.21,0.18,0.411,0.093,0.397,0.0,0.285,0.307,0.502,0.19,0.213,0.275,0.299,0.429,0.397,0.405,0.381,0.363,0.472,0.387,0.364,0.34,0.342,0.301,0.301,0.185,0.172,0.141,0.239,0.3,0.171,0.101,0.308,0.395,0.232,0.281,0.317,0.332,0.388,0.481,0.407,0.469,0.289,0.391,0.41,0.383,0.383,0.417,0.293,0.36,0.486,0.182,0.111,0.476,0.416,0.344,0.468,0.167,0.211,0.256,0.283,0.346,0.38,0.411,0.424,0.445,0.459,0.386,0.552,0.442,0.524,0.398,0.405,0.35,0.281,0.656,0.215,0.644,0.545,0.559,0.379,0.65,0.216,0.238,0.456,0.744,0.392,0.433,0.467,0.531,0.513,0.525,0.495,0.643,0.517,0.488,0.809,0.419,0.401,0.635,0.322,0.507,0.202,0.121,0.06,0.132,0.145,0.283,0.578,0.447,0.412,0.468,0.525,0.648,0.593,0.617,0.633,0.755,0.634,0.604,0.652,0.793,0.517,0.571,0.401,0.375,0.939,0.253,0.664,0.16,0.847,0.258,0.275,0.697,0.443,1.069,0.717,0.669,0.726,0.821,0.809,0.956,0.845,0.843,0.817,0.968,1.06,0.751,1.119,1.057,1.113,1.635,0.324,0.255,1.164,0.306,0.66,1.278,1.57,0.66,1.346,0.902,1.009,1.106,1.189,1.256,1.307,1.34,1.352,1.346,1.313,1.311,1.26,1.159,1.43,0.955,1.876,0.702,1.749,0.967,2.188,2.261,1.133,3.353,2.026,3.652,4.001,2.365,2.687,3.006,3.32,3.625,3.919,4.2,4.464,4.719,4.933,5.135,5.311,5.465,5.584,5.678,5.742,5.776,5.78,5.78,5.77,5.712,5.661,5.526,5.46,5.279,5.082,4.93,4.689,4.68,4.869,3.786,3.617,4.049,2.897,3.425,2.347,2.029,1.673,3.017,3.505,3.399,3.299,0.524,1.776,3.383,2.169,0.806,0.951,1.972,1.174,1.25,1.302,1.326,1.47,1.394,1.314,1.242,1.175,1.145,1.091,1.246,0.832,1.815,1.023,0.751,0.547,1.076,1.267,1.7,1.395,0.362,1.38,0.54,1.594,0.826,0.739,0.797,1.082,0.821,0.9,0.884,0.805,0.863,0.746,0.785,0.802,1.294,1.094,0.497,0.343,0.399,1.324,1.291,0.093,0.433,0.308,0.568,0.383,0.531,0.787,1.033,0.749,0.583,0.683,0.606,0.6,0.586,0.562,0.757,0.491,0.478,0.44,0.688,0.268,0.919,0.156,0.693,0.212,0.874,0.691,0.206,0.273,0.503,0.375,0.389,0.799,0.45,0.513,0.581,0.485,0.518,0.608,0.475,0.452,0.676,0.407,0.421,0.802,0.46,0.688,0.165,0.476,0.757,0.405,0.108,0.708,0.636,0.429,0.667,0.325,0.353,0.376,0.392,0.403,0.407,0.404,0.396,0.395,0.403,0.351,0.331,0.267,0.259,0.219,0.63,0.209,0.386,0.457,0.394,0.093,0.278,0.178,0.412,0.25,0.279,0.305,0.325,0.339,0.424,0.353,0.351,0.344,0.329,0.318,0.3,0.281,0.43,0.211,0.199,0.148,0.339,0.299,0.056,0.062,0.081,0.12,0.268,0.188,0.485,0.47,0.269,0.287,0.299,0.309,0.312,0.311,0.351,0.304,0.278,0.258,0.241,0.22,0.174,0.192,0.446,0.358,0.071,0.046,0.444,0.073,0.108,0.548,0.169,0.467,0.221,0.242,0.258,0.27,0.278,0.281,0.28,0.281,0.319,0.268,0.233,0.259,0.263,0.296,0.286,0.167,0.069,0.185,0.063,0.164,0.15,0.378,0.127,0.157,0.334,0.201,0.22,0.419,0.267,0.253,0.256,0.255,0.25,0.25,0.242,0.267,0.209,0.193,0.146,0.344,0.119,0.285,0.24,0.173]],
13
+ [:v_narrow, [0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.145,0.0,0.0,0.316,0.0,0.0,0.0,0.171,0.0,0.08,0.0,0.025,0.0,0.208,0.205,0.0,0.1,0.037,0.101,0.225,0.0,0.09,0.145,0.268,0.166,0.141,0.349,0.273,0.428,0.077,0.033,0.397,0.285,0.275,0.238,0.437,0.162,0.136,0.242,0.37,0.318,0.229,0.144,0.379,0.178,0.365,0.214,0.262,0.342,0.374,0.299,0.138,0.332,0.259,0.15,0.296,0.212,0.192,0.319,0.217,0.375,0.371,0.363,0.407,0.294,0.3,0.335,0.19,0.051,0.154,0.555,0.265,0.378,0.362,0.447,0.404,0.364,0.295,0.199,0.406,0.416,0.344,0.43,0.29,0.371,0.401,0.414,0.414,0.482,0.352,0.532,0.35,0.293,0.328,0.277,0.273,0.351,0.424,0.459,0.47,0.475,0.591,0.405,0.713,0.488,0.559,0.379,0.647,0.341,0.423,0.508,0.526,0.629,0.46,0.397,0.431,0.42,0.139,0.136,0.194,0.31,0.415,0.491,0.537,0.549,0.52,0.471,0.45,0.384,0.181,0.114,0.144,0.271,0.403,0.498,0.568,0.583,0.597,0.554,0.476,0.366,0.554,0.231,0.154,0.367,0.373,0.505,0.601,0.658,0.668,0.675,0.649,0.941,0.432,0.614,0.176,0.847,0.361,0.511,0.927,0.717,0.733,0.769,0.98,0.627,0.719,0.805,0.516,0.106,0.517,0.729,0.68,0.811,0.894,0.921,1.162,0.891,1.301,0.609,0.458,1.164,0.306,0.533,1.405,1.153,1.068,1.144,1.169,1.082,1.548,1.05,0.674,0.457,0.843,0.786,0.821,2.237,1.35,1.508,1.768,1.545,1.565,1.467,1.077,1.541,1.075,2.162,2.493,1.497,2.634,2.267,3.293,2.604,2.6,4.55,3.257,2.232,2.458,0.493,3.459,8.02,4.01,5.286,6.546,7.743,9.437,9.787,10.558,11.123,11.461,11.56,11.56,11.433,11.036,10.555,10.611,8.762,7.732,6.365,5.159,3.936,4.241,3.031,4.116,1.258,5.142,2.284,2.528,2.652,2.504,2.502,2.252,3.631,2.692,3.569,0.524,1.729,3.382,2.216,1.412,1.539,1.567,1.497,1.546,1.692,1.108,1.134,0.476,0.763,0.466,1.313,0.93,1.067,1.21,1.128,1.136,1.359,1.091,0.664,1.243,1.267,1.738,1.462,0.651,1.222,0.874,0.982,0.874,0.853,0.745,0.573,0.633,0.743,1.346,0.805,0.461,0.6,0.695,0.744,0.772,0.757,0.615,0.612,0.479,1.284,1.278,0.17,0.434,0.458,0.559,0.619,0.766,0.629,0.596,0.6,0.364,0.299,0.727,1.049,0.219,1.035,0.751,0.523,0.562,0.566,0.599,0.469,0.723,0.322,0.684,0.212,0.874,0.789,0.358,0.438,0.618,0.509,0.514,0.496,0.383,0.729,0.243,0.387,0.812,0.187,0.279,0.363,0.423,0.621,0.46,0.651,0.437,0.548,0.26,0.559,0.77,0.374,0.21,0.664,0.484,0.411,0.537,0.414,0.388,0.606,0.32,0.223,0.105,0.42,0.148,0.635,0.307,0.358,0.386,0.477,0.401,0.326,0.607,0.213,0.405,0.457,0.363,0.18,0.254,0.311,0.427,0.364,0.356,0.327,0.4,0.275,0.265,0.085,0.55,0.129,0.203,0.267,0.334,0.434,0.34,0.322,0.296,0.285,0.319,0.338,0.08,0.082,0.158,0.223,0.274,0.305,0.434,0.345,0.29,0.255,0.481,0.185,0.202,0.077,0.215,0.177,0.237,0.277,0.299,0.353,0.281,0.295,0.438,0.313,0.143,0.078,0.444,0.141,0.2,0.491,0.274,0.316,0.282,0.309,0.253,0.211,0.32,0.224,0.109,0.414,0.231,0.214,0.25,0.27,0.274,0.269,0.234,0.235,0.158,0.203,0.053,0.15,0.128,0.347,0.223,0.249,0.262,0.344,0.333,0.235,0.182,0.148,0.09,0.167,0.2,0.146,0.356,0.228,0.247,0.25,0.23,0.351,0.17,0.266,0.258,0.19]]
14
+ ]
15
+
16
+ g = Gruff::Line.new
17
+ g.title = 'Different bin widths'
18
+ @datasets.each do |data|
19
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
20
+ g.hide_dots = true
21
+ g.data(data[0], data[1])
22
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
23
+ end
24
+ g.write('test/output/differing_bin_widths.png')
25
+
26
+ g = Gruff::Line.new(400)
27
+ g.title = 'Different bin widths'
28
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
29
+ g.hide_dots = true
30
+ @datasets.each do |data|
31
+ g.data(data[0], data[1])
32
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
33
+ end
34
+ g.write('test/output/differing_bin_widths_small.png')
35
+
36
+ g = Gruff::Line.new(1600)
37
+ g.title = 'Different bin widths'
38
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
39
+ g.hide_dots = true
40
+ @datasets.each do |data|
41
+ g.data(data[0], data[1])
42
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
43
+ end
44
+ g.write('test/output/differing_bin_widths_large.png')
45
+ end
46
+
47
+ test_line_small_values
@@ -0,0 +1,45 @@
1
+ require 'gruff'
2
+
3
+ count = 0
4
+ (0..1000).step(2) do |idx|
5
+ puts "#{count}, #{idx}"
6
+ count += 1
7
+ end
8
+
9
+ def test_line_small_values
10
+ @datasets = [
11
+ [:millisecs, [70.0,63.333333333333336,62.22222222222223,58.14814814814815,58.76543209876544,59.176954732510296,59.45130315500686,59.634202103337905,59.75613473555861,56.50408982370575,54.3360598824705,52.89070658831366,51.927137725542444,51.284758483694965,50.85650565579664,50.57100377053109,50.38066918035406,50.25377945356937,50.16918630237958,50.11279086825306,50.07519391216871,50.050129274779145,50.03341951651944,50.02227967767963,50.01485311845308,46.67656874563539,47.78437916375693,48.52291944250462,49.01527962833641,49.34351975222427,49.56234650148284,49.708231000988555,49.80548733399237,49.87032488932825,46.580216592885506,44.38681106192367,42.92454070794912,41.94969380529941,44.63312920353294,43.088752802355295,42.05916853490353,41.372779023269025,40.91518601551269,40.61012401034179,40.40674934022786,40.27116622681857,40.18077748454571,40.12051832303047,40.08034554868698,40.05356369912465,40.035709132749766,40.02380608849984,40.01587072566656,40.01058048377771,40.00705365585181,40.00470243723455,40.00313495815637,40.00208997210425,40.00139331473616,36.66759554315744,37.77839702877162,38.518931352514414,39.01262090167628,39.34174726778419,39.56116484518947,39.70744323012631,39.804962153417534,39.86997476894502,39.91331651263001,36.60887767508668,34.40591845005779,36.27061230003852,37.51374153335902,38.34249435557268,35.561662903715124,37.041108602476754,38.027405734984505,38.68493715665634,39.12329143777089,36.08219429184726,37.38812952789817,34.925419685265446,36.61694645684363,34.41129763789576,36.27419842526384,34.1827989501759,36.121865966783936,34.081243977855955,36.05416265190397,37.369441767935974,38.24629451195731,38.83086300797154,39.2205753386477,39.48038355909847,39.65358903939898,39.76905935959932,39.84603957306621,39.89735971537747,39.93157314358498,36.62104876238999,34.41403250825999,36.27602167217333,37.51734778144888,35.011565187632584,36.67437679175506,34.44958452783671,32.96638968522448,31.977593123482986,34.65172874898866,33.10115249932577,32.067434999550514,34.71162333303368,33.141082222022455,32.094054814681634,34.72936987645443,33.15291325096962,32.10194216731308,34.734628111542044,33.15641874102803,32.10427916068535,31.402852773790233,30.93523518252682,33.95682345501788,35.971215636678586,33.980810424452386,32.65387361630159,31.769249077534393,31.179499385022933,34.11966625668196,36.07977750445465,37.386518336303105,38.25767889086874,38.838452593912486,35.89230172927498,47.261534486183315,54.84102299078887,46.56068199385925,41.040454662572834,50.69363644171523,57.12909096114348,39.83515153828599,49.890101025524,56.59340068368266,47.728933789121776,55.15262252608119,46.76841501738746,54.51227667825831,46.34151778550554]]
12
+ ]
13
+
14
+ g = Gruff::Line.new
15
+ g.title = 'Millisecs'
16
+ @datasets.each do |data|
17
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
18
+ g.hide_dots = true
19
+ g.data(data[0], data[1])
20
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
21
+ end
22
+ g.write('test/output/millisecs.png')
23
+
24
+ g = Gruff::Line.new(400)
25
+ g.title = 'Millisecs'
26
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
27
+ g.hide_dots = true
28
+ @datasets.each do |data|
29
+ g.data(data[0], data[1])
30
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
31
+ end
32
+ g.write('test/output/millisecs_small.png')
33
+
34
+ g = Gruff::Line.new(1600)
35
+ g.title = 'Millisecs'
36
+ # g.theme = Gruff::Themes::THIRTYSEVEN_SIGNALS
37
+ g.hide_dots = true
38
+ @datasets.each do |data|
39
+ g.data(data[0], data[1])
40
+ g.labels = {0 => '0', 125 => '250', 250 => '500', 375 => '750', 500 => '1000'}
41
+ end
42
+ g.write('test/output/millisecs_large.png')
43
+ end
44
+
45
+ test_line_small_values
data/cw.gemspec CHANGED
@@ -24,15 +24,17 @@ Gem::Specification.new do |spec|
24
24
  spec.add_runtime_dependency 'paint', '>= 1.0.1'
25
25
  spec.add_runtime_dependency 'rake', '>= 11.2.2'
26
26
  spec.add_runtime_dependency 'ruby-progressbar', '>= 1.8.1'
27
- spec.add_runtime_dependency 'sanitize', '~> 4.1.0'
27
+ spec.add_runtime_dependency 'sanitize', '~> 4.2.0'
28
28
  spec.add_runtime_dependency 'wavefile', '>= 0.7.0'
29
29
  spec.add_runtime_dependency 'parseconfig', '~> 1.0.8'
30
30
  spec.add_dependency 'os', '~> 0.9.6'
31
31
 
32
+ # remove dependency for live version (used for reading on OSX) spec.add_runtime_dependency 'coreaudio', '~> 0.0.11'
33
+
32
34
  spec.add_development_dependency 'version', '>= 1.0.0'
33
35
  spec.add_development_dependency 'minitest', '>= 5.8.4'
34
36
  spec.add_development_dependency 'simplecov', '>= 0.12.0'
35
37
  spec.add_development_dependency 'yard', '~> 0.9.5'
36
- spec.add_development_dependency 'sequel'
37
- spec.add_development_dependency 'sqlite3'
38
+ spec.add_development_dependency 'sequel', '~> 4.38.0'
39
+ spec.add_development_dependency 'sqlite3', '~> 1.3.11'
38
40
  end
@@ -0,0 +1,78 @@
1
+ ---
2
+ :uk:
3
+ :partial_0:
4
+ :option:
5
+ - g
6
+ - m
7
+ - 2e
8
+ - gm
9
+ - mm
10
+ - gw
11
+ - mw
12
+ - ei
13
+ - mi
14
+ - gb
15
+ :weight:
16
+ - 40
17
+ - 20
18
+ - 10
19
+ - 4
20
+ - 2
21
+ - 4
22
+ - 2
23
+ - 5
24
+ - 9
25
+ - 4
26
+ :partial_1:
27
+ :option:
28
+ - '0'
29
+ - '4'
30
+ - '1'
31
+ - '2'
32
+ - '3'
33
+ - '4'
34
+ - '5'
35
+ - '6'
36
+ - '7'
37
+ - '8'
38
+ - '9'
39
+ - '0'
40
+ :weight:
41
+ - 10
42
+ - 10
43
+ - 10
44
+ - 10
45
+ - 10
46
+ - 10
47
+ - 10
48
+ - 10
49
+ - 10
50
+ - 10
51
+ - 10
52
+ - 10
53
+ :partial_2:
54
+ :option:
55
+ - !ruby/range
56
+ begin: a
57
+ end: z
58
+ excl: false
59
+ :weight:
60
+ - 100
61
+ :partial_3:
62
+ :option:
63
+ - !ruby/range
64
+ begin: a
65
+ end: z
66
+ excl: false
67
+ :weight:
68
+ - 100
69
+ :partial_4:
70
+ :option:
71
+ - !ruby/range
72
+ begin: a
73
+ end: z
74
+ excl: false
75
+ - ''
76
+ :weight:
77
+ - 99
78
+ - 1
@@ -0,0 +1,215 @@
1
+ ---
2
+ a:
3
+ - :dot
4
+ - :dash
5
+ b:
6
+ - :dash
7
+ - :dot
8
+ - :dot
9
+ - :dot
10
+ c:
11
+ - :dash
12
+ - :dot
13
+ - :dash
14
+ - :dot
15
+ d:
16
+ - :dash
17
+ - :dot
18
+ - :dot
19
+ e:
20
+ - :dot
21
+ f:
22
+ - :dot
23
+ - :dot
24
+ - :dash
25
+ - :dot
26
+ g:
27
+ - :dash
28
+ - :dash
29
+ - :dot
30
+ h:
31
+ - :dot
32
+ - :dot
33
+ - :dot
34
+ - :dot
35
+ i:
36
+ - :dot
37
+ - :dot
38
+ j:
39
+ - :dot
40
+ - :dash
41
+ - :dash
42
+ - :dash
43
+ k:
44
+ - :dash
45
+ - :dot
46
+ - :dash
47
+ l:
48
+ - :dot
49
+ - :dash
50
+ - :dot
51
+ - :dot
52
+ m:
53
+ - :dash
54
+ - :dash
55
+ n:
56
+ - :dash
57
+ - :dot
58
+ o:
59
+ - :dash
60
+ - :dash
61
+ - :dash
62
+ p:
63
+ - :dot
64
+ - :dash
65
+ - :dash
66
+ - :dot
67
+ q:
68
+ - :dash
69
+ - :dash
70
+ - :dot
71
+ - :dash
72
+ r:
73
+ - :dot
74
+ - :dash
75
+ - :dot
76
+ s:
77
+ - :dot
78
+ - :dot
79
+ - :dot
80
+ t:
81
+ - :dash
82
+ u:
83
+ - :dot
84
+ - :dot
85
+ - :dash
86
+ v:
87
+ - :dot
88
+ - :dot
89
+ - :dot
90
+ - :dash
91
+ w:
92
+ - :dot
93
+ - :dash
94
+ - :dash
95
+ x:
96
+ - :dash
97
+ - :dot
98
+ - :dot
99
+ - :dash
100
+ y:
101
+ - :dash
102
+ - :dot
103
+ - :dash
104
+ - :dash
105
+ z:
106
+ - :dash
107
+ - :dash
108
+ - :dot
109
+ - :dot
110
+ '1':
111
+ - :dot
112
+ - :dash
113
+ - :dash
114
+ - :dash
115
+ - :dash
116
+ '2':
117
+ - :dot
118
+ - :dot
119
+ - :dash
120
+ - :dash
121
+ - :dash
122
+ '3':
123
+ - :dot
124
+ - :dot
125
+ - :dot
126
+ - :dash
127
+ - :dash
128
+ '4':
129
+ - :dot
130
+ - :dot
131
+ - :dot
132
+ - :dot
133
+ - :dash
134
+ '5':
135
+ - :dot
136
+ - :dot
137
+ - :dot
138
+ - :dot
139
+ - :dot
140
+ '6':
141
+ - :dash
142
+ - :dot
143
+ - :dot
144
+ - :dot
145
+ - :dot
146
+ '7':
147
+ - :dash
148
+ - :dash
149
+ - :dot
150
+ - :dot
151
+ - :dot
152
+ '8':
153
+ - :dash
154
+ - :dash
155
+ - :dash
156
+ - :dot
157
+ - :dot
158
+ '9':
159
+ - :dash
160
+ - :dash
161
+ - :dash
162
+ - :dash
163
+ - :dot
164
+ '0':
165
+ - :dash
166
+ - :dash
167
+ - :dash
168
+ - :dash
169
+ - :dash
170
+ "+":
171
+ - :dot
172
+ - :dash
173
+ - :dot
174
+ - :dash
175
+ - :dot
176
+ ".":
177
+ - :dot
178
+ - :dash
179
+ - :dot
180
+ - :dash
181
+ - :dot
182
+ - :dash
183
+ ",":
184
+ - :dash
185
+ - :dash
186
+ - :dot
187
+ - :dot
188
+ - :dash
189
+ - :dash
190
+ "=":
191
+ - :dash
192
+ - :dot
193
+ - :dot
194
+ - :dot
195
+ - :dash
196
+ "!":
197
+ - :dot
198
+ - :dot
199
+ - :dash
200
+ - :dash
201
+ - :dot
202
+ "/":
203
+ - :dash
204
+ - :dot
205
+ - :dot
206
+ - :dash
207
+ - :dot
208
+ "?":
209
+ - :dot
210
+ - :dot
211
+ - :dash
212
+ - :dash
213
+ - :dot
214
+ - :dot
215
+ " ": []