beeps 0.3.16 → 0.5.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.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/.doc/ext/beeps/analyser.cpp +4 -4
  3. data/.doc/ext/beeps/envelope.cpp +1 -1
  4. data/.doc/ext/beeps/file_in.cpp +1 -1
  5. data/.doc/ext/beeps/gain.cpp +1 -1
  6. data/.doc/ext/beeps/high_pass.cpp +1 -1
  7. data/.doc/ext/beeps/low_pass.cpp +1 -1
  8. data/.doc/ext/beeps/mic_in.cpp +1 -1
  9. data/.doc/ext/beeps/mixer.cpp +2 -2
  10. data/.doc/ext/beeps/oscillator.cpp +3 -3
  11. data/.doc/ext/beeps/pitch_shift.cpp +1 -1
  12. data/.doc/ext/beeps/processor.cpp +1 -1
  13. data/.doc/ext/beeps/reverb.cpp +1 -1
  14. data/.doc/ext/beeps/sequencer.cpp +2 -2
  15. data/.doc/ext/beeps/signals.cpp +3 -3
  16. data/.doc/ext/beeps/sound.cpp +16 -8
  17. data/.doc/ext/beeps/sound_player.cpp +13 -5
  18. data/.doc/ext/beeps/text_in.cpp +1 -1
  19. data/.doc/ext/beeps/time_stretch.cpp +1 -1
  20. data/.doc/ext/beeps/value.cpp +2 -2
  21. data/.github/workflows/release-gem.yml +2 -40
  22. data/.github/workflows/tag.yml +5 -28
  23. data/.github/workflows/test.yml +1 -28
  24. data/ChangeLog.md +28 -0
  25. data/Gemfile.lock +13 -8
  26. data/Rakefile +1 -1
  27. data/VERSION +1 -1
  28. data/beeps.gemspec +3 -3
  29. data/ext/beeps/analyser.cpp +4 -4
  30. data/ext/beeps/envelope.cpp +1 -1
  31. data/ext/beeps/file_in.cpp +1 -1
  32. data/ext/beeps/gain.cpp +1 -1
  33. data/ext/beeps/high_pass.cpp +1 -1
  34. data/ext/beeps/low_pass.cpp +1 -1
  35. data/ext/beeps/mic_in.cpp +1 -1
  36. data/ext/beeps/mixer.cpp +2 -2
  37. data/ext/beeps/oscillator.cpp +3 -3
  38. data/ext/beeps/pitch_shift.cpp +1 -1
  39. data/ext/beeps/processor.cpp +1 -1
  40. data/ext/beeps/reverb.cpp +1 -1
  41. data/ext/beeps/sequencer.cpp +2 -2
  42. data/ext/beeps/signals.cpp +3 -3
  43. data/ext/beeps/sound.cpp +17 -8
  44. data/ext/beeps/sound_player.cpp +14 -5
  45. data/ext/beeps/text_in.cpp +1 -1
  46. data/ext/beeps/time_stretch.cpp +1 -1
  47. data/ext/beeps/value.cpp +2 -2
  48. data/include/beeps/defs.h +14 -4
  49. data/include/beeps/signals.h +2 -2
  50. data/include/beeps/sound.h +9 -3
  51. data/lib/beeps/beeps.rb +4 -4
  52. data/lib/beeps/extension.rb +1 -1
  53. data/lib/beeps/sound.rb +2 -2
  54. data/src/file_in.cpp +2 -0
  55. data/src/mic_in.cpp +10 -9
  56. data/src/openal.cpp +66 -8
  57. data/src/openal.h +5 -1
  58. data/src/oscillator.cpp +1 -1
  59. data/src/signals.cpp +6 -6
  60. data/src/sound.cpp +382 -160
  61. data/src/win32/beeps.cpp +25 -2
  62. data/src/win32/signals.cpp +103 -29
  63. data/test/test_file_in.rb +38 -0
  64. data/test/test_sound.rb +6 -6
  65. data/test/test_sound_player.rb +86 -20
  66. metadata +7 -8
  67. data/.github/workflows/utils.rb +0 -127
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0d0df35732c641aea99d48e8fc4b3962ea6492bbc8195f3a03e8e89f2963a5fe
4
- data.tar.gz: 31ccd91b4ba4af5e856d6ca2b30870fb5c65f5c65e896ba060afb96d207f7a29
3
+ metadata.gz: 537a0ed28852c50225e938ef9ce8213ea6ea409f428c20cece5bef23d804dd8e
4
+ data.tar.gz: 3a827e233a43a4493790ee4eeef1c6c3a05a57b2e1d31d885ae22502999cb16d
5
5
  SHA512:
6
- metadata.gz: 9278dce2e957ea259e8d72b090c9b6e255fe798e87324b5b82e10b672e1d41132e2028bc17f08515a1c47af6fde2a1156e52f997519ab5c5ca5e573843536460
7
- data.tar.gz: 89b0671180ea7e85db3dc38d0d560191fceece767e9016973253675bfe30945de9a82d8ecbe71205c6ab6fed3ab22e7fe682fdeea7d402f2b5ef91fe0a64d96b
6
+ metadata.gz: 32ce8ead10aaade2786de1b1befc179bfb65654d5caaf9aa269310358fb5de97fcbd4efe1f74ecd08941186fccfbb719d0b948e01ceb9e19ee02725351a4ff87
7
+ data.tar.gz: 20167f9e7269b2c9818beb7026d79364dfb063554b9f16f54d900670e83bfabd03837dfd5829e12acf38e802eb891a3f8dee31243afc9bc04773ad529a5b916e
@@ -10,7 +10,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Analyser)
10
10
 
11
11
  #define THIS to<Beeps::Analyser*>(self)
12
12
 
13
- #define CHECK RUCY_CHECK_OBJ(Beeps::Analyser, self)
13
+ #define CHECK RUCY_CHECK_PTR(Beeps::Analyser, self)
14
14
 
15
15
 
16
16
  static
@@ -64,7 +64,7 @@ VALUE each_signal(VALUE self, VALUE nsamples_)
64
64
  {
65
65
  case 1:
66
66
  for (uint i = start; i < nsamples; ++i)
67
- rb_yield(value(samples[i]));
67
+ yield(value(samples[i]));
68
68
  break;
69
69
 
70
70
  case 2:
@@ -74,7 +74,7 @@ VALUE each_signal(VALUE self, VALUE nsamples_)
74
74
  {
75
75
  args.set(0, value(samples[i + 0]));
76
76
  args.set(1, value(samples[i + 1]));
77
- rb_yield(args);
77
+ yield(args);
78
78
  }
79
79
  break;
80
80
  }
@@ -91,7 +91,7 @@ VALUE each_spectrum(VALUE self)
91
91
  invalid_object_error(__FILE__, __LINE__);
92
92
 
93
93
  for (auto val : THIS->spectrum())
94
- rb_yield(value(val));
94
+ yield(value(val));
95
95
 
96
96
  return nil();
97
97
  }
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Envelope)
9
9
 
10
10
  #define THIS to<Beeps::Envelope*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Envelope, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Envelope, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::FileIn)
9
9
 
10
10
  #define THIS to<Beeps::FileIn*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::FileIn, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::FileIn, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Gain)
9
9
 
10
10
  #define THIS to<Beeps::Gain*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Gain, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Gain, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::HighPass)
9
9
 
10
10
  #define THIS to<Beeps::HighPass*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::HighPass, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::HighPass, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::LowPass)
9
9
 
10
10
  #define THIS to<Beeps::LowPass*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::LowPass, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::LowPass, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::MicIn)
9
9
 
10
10
  #define THIS to<Beeps::MicIn*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::MicIn, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::MicIn, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Mixer)
9
9
 
10
10
  #define THIS to<Beeps::Mixer*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Mixer, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Mixer, self)
13
13
 
14
14
 
15
15
  static
@@ -51,7 +51,7 @@ VALUE each_input(VALUE self)
51
51
 
52
52
  Value ret;
53
53
  for (auto& input : *THIS)
54
- ret = rb_yield(value(input.get()));
54
+ ret = yield(value(input.get()));
55
55
  return ret;
56
56
  }
57
57
 
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Oscillator)
9
9
 
10
10
  #define THIS to<Beeps::Oscillator*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Oscillator, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Oscillator, self)
13
13
 
14
14
 
15
15
  static
@@ -48,7 +48,7 @@ VALUE set_samples(VALUE self, VALUE samples)
48
48
  for (size_t i = 0; i < size; ++i)
49
49
  data.push_back(to<Beeps::Sample>(array[i]));
50
50
 
51
- THIS->set_samples(&data[0], data.size());
51
+ THIS->set_samples(data.data(), data.size());
52
52
  }
53
53
 
54
54
  static
@@ -62,7 +62,7 @@ VALUE each_sample(VALUE self)
62
62
 
63
63
  Value ret;
64
64
  for (size_t i = 0; i < size; ++i)
65
- ret = rb_yield(value((float) samples[i]));
65
+ ret = yield(value((float) samples[i]));
66
66
  return ret;
67
67
  }
68
68
 
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::PitchShift)
9
9
 
10
10
  #define THIS to<Beeps::PitchShift*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::PitchShift, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::PitchShift, self)
13
13
 
14
14
 
15
15
  static
@@ -10,7 +10,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Processor)
10
10
 
11
11
  #define THIS to<Beeps::Processor*>(self)
12
12
 
13
- #define CHECK RUCY_CHECK_OBJ(Beeps::Processor, self)
13
+ #define CHECK RUCY_CHECK_PTR(Beeps::Processor, self)
14
14
 
15
15
  #define CALL(fun) RUCY_CALL_SUPER(THIS, fun)
16
16
 
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Reverb)
9
9
 
10
10
  #define THIS to<Beeps::Reverb*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Reverb, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Reverb, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Sequencer)
9
9
 
10
10
  #define THIS to<Beeps::Sequencer*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Sequencer, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Sequencer, self)
13
13
 
14
14
 
15
15
  static
@@ -64,7 +64,7 @@ VALUE each_note(VALUE self)
64
64
  Value ret;
65
65
  for (auto it = THIS->begin(), end = THIS->end(); it != end; ++it)
66
66
  {
67
- ret = rb_yield_values(3,
67
+ ret = yield(
68
68
  value(it->processor.get()),
69
69
  value(it->offset),
70
70
  value(it->duration));
@@ -8,7 +8,7 @@ RUCY_DEFINE_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Signals)
8
8
 
9
9
  #define THIS to<Beeps::Signals*>(self)
10
10
 
11
- #define CHECK RUCY_CHECK_OBJ(Beeps::Signals, self)
11
+ #define CHECK RUCY_CHECK_PTR(Beeps::Signals, self)
12
12
 
13
13
 
14
14
  static
@@ -84,13 +84,13 @@ VALUE each(VALUE self, VALUE channel_)
84
84
 
85
85
  const auto* p = samples + channel;
86
86
  for (uint i = 0; i < nsamples; ++i, p += nchannels)
87
- rb_yield(value(*p));
87
+ yield(value(*p));
88
88
  }
89
89
  else
90
90
  {
91
91
  uint size = nsamples * nchannels;
92
92
  for (uint i = 0; i < size; ++i)
93
- rb_yield(value(samples[i]));
93
+ yield(value(samples[i]));
94
94
  }
95
95
  }
96
96
 
@@ -8,7 +8,7 @@ RUCY_DEFINE_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Sound)
8
8
 
9
9
  #define THIS to<Beeps::Sound*>(self)
10
10
 
11
- #define CHECK RUCY_CHECK_OBJ(Beeps::Sound, self)
11
+ #define CHECK RUCY_CHECK_PTR(Beeps::Sound, self)
12
12
 
13
13
 
14
14
  static
@@ -18,7 +18,7 @@ VALUE alloc(VALUE klass)
18
18
  }
19
19
 
20
20
  static
21
- VALUE setup(VALUE self, VALUE processor, VALUE seconds, VALUE nchannels, VALUE sample_rate)
21
+ VALUE initialize(VALUE self, VALUE processor, VALUE seconds, VALUE nchannels, VALUE sample_rate)
22
22
  {
23
23
  CHECK;
24
24
 
@@ -28,6 +28,13 @@ VALUE setup(VALUE self, VALUE processor, VALUE seconds, VALUE nchannels, VALUE s
28
28
  return self;
29
29
  }
30
30
 
31
+ static
32
+ VALUE initialize_copy(VALUE self, VALUE obj)
33
+ {
34
+ CHECK;
35
+ *THIS = to<Beeps::Sound&>(obj).dup();
36
+ }
37
+
31
38
  static
32
39
  VALUE play(VALUE self)
33
40
  {
@@ -37,19 +44,19 @@ VALUE play(VALUE self)
37
44
  }
38
45
 
39
46
  static
40
- VALUE get_sample_rate(VALUE self)
47
+ VALUE get_nchannels(VALUE self)
41
48
  {
42
49
  CHECK;
43
50
 
44
- return value(THIS->sample_rate());
51
+ return value(THIS->nchannels());
45
52
  }
46
53
 
47
54
  static
48
- VALUE get_nchannels(VALUE self)
55
+ VALUE get_sample_rate(VALUE self)
49
56
  {
50
57
  CHECK;
51
58
 
52
- return value(THIS->nchannels());
59
+ return value(THIS->sample_rate());
53
60
  }
54
61
 
55
62
  static
@@ -119,10 +126,11 @@ Init_beeps_sound ()
119
126
 
120
127
  cSound = rb_define_class_under(mBeeps, "Sound", rb_cObject);
121
128
  rb_define_alloc_func(cSound, alloc);
122
- rb_define_private_method(cSound, "setup", RUBY_METHOD_FUNC(setup), 4);
129
+ cSound.define_private_method("initialize!", initialize);
130
+ rb_define_private_method(cSound, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
123
131
  cSound.define_private_method("play!", play);
124
- rb_define_method(cSound, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0);
125
132
  rb_define_method(cSound, "nchannels", RUBY_METHOD_FUNC(get_nchannels), 0);
133
+ rb_define_method(cSound, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0);
126
134
  rb_define_method(cSound, "seconds", RUBY_METHOD_FUNC(get_seconds), 0);
127
135
  rb_define_method(cSound, "gain=", RUBY_METHOD_FUNC(set_gain), 1);
128
136
  rb_define_method(cSound, "gain", RUBY_METHOD_FUNC(get_gain), 0);
@@ -1,6 +1,7 @@
1
1
  #include "beeps/ruby/sound.h"
2
2
 
3
3
 
4
+ #include "beeps/exception.h"
4
5
  #include "defs.h"
5
6
 
6
7
 
@@ -8,7 +9,7 @@ RUCY_DEFINE_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::SoundPlayer)
8
9
 
9
10
  #define THIS to<Beeps::SoundPlayer*>(self)
10
11
 
11
- #define CHECK RUCY_CHECK_OBJ(Beeps::SoundPlayer, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::SoundPlayer, self)
12
13
 
13
14
 
14
15
  static
@@ -17,6 +18,12 @@ VALUE alloc(VALUE klass)
17
18
  return new_type<Beeps::SoundPlayer>(klass);
18
19
  }
19
20
 
21
+ static
22
+ VALUE initialize_copy(VALUE self, VALUE obj)
23
+ {
24
+ Beeps::beeps_error(__FILE__, __LINE__, "can not duplicate SoundPlayer");
25
+ }
26
+
20
27
  static
21
28
  VALUE play(VALUE self)
22
29
  {
@@ -162,6 +169,7 @@ Init_beeps_sound_player ()
162
169
 
163
170
  cSoundPlayer = rb_define_class_under(mBeeps, "SoundPlayer", rb_cObject);
164
171
  rb_define_alloc_func(cSoundPlayer, alloc);
172
+ rb_define_private_method(cSoundPlayer, "initialize_copy", RUBY_METHOD_FUNC(initialize_copy), 1);
165
173
  rb_define_method(cSoundPlayer, "play", RUBY_METHOD_FUNC(play), 0);
166
174
  rb_define_method(cSoundPlayer, "pause", RUBY_METHOD_FUNC(pause), 0);
167
175
  rb_define_method(cSoundPlayer, "rewind", RUBY_METHOD_FUNC(rewind), 0);
@@ -179,10 +187,10 @@ Init_beeps_sound_player ()
179
187
  rb_define_method(cSoundPlayer, "loop", RUBY_METHOD_FUNC(get_loop), 0);
180
188
  rb_define_singleton_method(cSoundPlayer, "stop_all", RUBY_METHOD_FUNC(stop_all), 0);
181
189
 
182
- cSoundPlayer.define_const("STATE_UNKNOWN", Beeps::SoundPlayer::STATE_UNKNOWN);
183
- cSoundPlayer.define_const("PLAYING", Beeps::SoundPlayer::PLAYING);
184
- cSoundPlayer.define_const("PAUSED", Beeps::SoundPlayer::PAUSED);
185
- cSoundPlayer.define_const("STOPPED", Beeps::SoundPlayer::STOPPED);
190
+ cSoundPlayer.define_const("STATE_NONE", Beeps::SoundPlayer::STATE_NONE);
191
+ cSoundPlayer.define_const("PLAYING", Beeps::SoundPlayer::PLAYING);
192
+ cSoundPlayer.define_const("PAUSED", Beeps::SoundPlayer::PAUSED);
193
+ cSoundPlayer.define_const("STOPPED", Beeps::SoundPlayer::STOPPED);
186
194
  }
187
195
 
188
196
 
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::TextIn)
9
9
 
10
10
  #define THIS to<Beeps::TextIn*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::TextIn, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::TextIn, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::TimeStretch)
9
9
 
10
10
  #define THIS to<Beeps::TimeStretch*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::TimeStretch, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::TimeStretch, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Value)
9
9
 
10
10
  #define THIS to<Beeps::Value*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Value, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Value, self)
13
13
 
14
14
 
15
15
  static
@@ -67,7 +67,7 @@ VALUE each_value(VALUE self)
67
67
 
68
68
  Value ret;
69
69
  for (auto it = THIS->begin(), end = THIS->end(); it != end; ++it)
70
- ret = rb_yield_values(2, value(it->value), value(it->time));
70
+ ret = yield(value(it->value), value(it->time));
71
71
  return ret;
72
72
  }
73
73
 
@@ -9,43 +9,5 @@ permissions:
9
9
 
10
10
  jobs:
11
11
  release:
12
- runs-on: macos-latest
13
-
14
- steps:
15
- - name: ruby 3.2
16
- uses: ruby/setup-ruby@v1
17
- with:
18
- ruby-version: 3.2
19
-
20
- - name: checkout
21
- uses: actions/checkout@v4
22
-
23
- - name: setup gems
24
- run: bundle install
25
-
26
- - name: setup dependencies
27
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
28
-
29
- - name: test
30
- run: bundle exec rake packages test
31
-
32
- - name: create gem
33
- id: gem
34
- run: |
35
- bundle exec rake gem
36
- echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
37
-
38
- - name: create github release
39
- env:
40
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41
- run: ruby -I.github/workflows -rutils -e 'release(*ARGV)' ./${{ steps.gem.outputs.path }}
42
-
43
- - name: upload to rubygems
44
- env:
45
- GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
46
- run: |
47
- mkdir -p $HOME/.gem
48
- touch $HOME/.gem/credentials
49
- chmod 0600 $HOME/.gem/credentials
50
- printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
51
- bundle exec rake upload
12
+ uses: xord/xot/.github/workflows/release-gem.yml@master
13
+ secrets: inherit
@@ -1,35 +1,12 @@
1
1
  name: Tag
2
2
 
3
3
  on:
4
- push:
4
+ workflow_run:
5
+ workflows: [Test]
6
+ types: [completed]
5
7
  branches: [master]
6
8
 
7
9
  jobs:
8
10
  tag:
9
- runs-on: ubuntu-latest
10
-
11
- steps:
12
- - name: ruby 3.2
13
- uses: ruby/setup-ruby@v1
14
- with:
15
- ruby-version: 3.2
16
-
17
- - name: checkout
18
- uses: actions/checkout@v4
19
- with:
20
- fetch-depth: 0
21
- token: ${{ secrets.PAT }}
22
-
23
- - name: setup dependencies
24
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies only: :xot'"
25
-
26
- - name: setup user name and email
27
- run: |
28
- git config --global user.email "xordog@gmail.com"
29
- git config --global user.name "xord"
30
-
31
- - name: tag versions
32
- run: "ruby -I.github/workflows -rutils -e 'tag_versions'"
33
-
34
- - name: push tags
35
- run: git push origin --tags
11
+ uses: xord/xot/.github/workflows/tag.yml@master
12
+ secrets: inherit
@@ -7,31 +7,4 @@ on:
7
7
 
8
8
  jobs:
9
9
  test:
10
- runs-on: macos-latest
11
-
12
- steps:
13
- - name: ruby 3.2
14
- uses: ruby/setup-ruby@v1
15
- with:
16
- ruby-version: 3.2
17
-
18
- - name: checkout
19
- uses: actions/checkout@v4
20
-
21
- - name: setup gems
22
- run: bundle install
23
-
24
- - name: setup dependencies
25
- run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
26
-
27
- - name: packages
28
- run: bundle exec rake verbose packages
29
-
30
- - name: lib
31
- run: bundle exec rake verbose lib
32
-
33
- - name: ext
34
- run: bundle exec rake verbose ext
35
-
36
- - name: test
37
- run: bundle exec rake verbose test
10
+ uses: xord/xot/.github/workflows/test.yml@master
data/ChangeLog.md CHANGED
@@ -1,6 +1,34 @@
1
1
  # beeps ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.1] - 2026-11-04
5
+
6
+ - Release the changes of v0.5.0, whose gem was not released
7
+
8
+ - Fix a test of SoundPlayer failing on a slow machine
9
+
10
+
11
+ ## [v0.5.0] - 2026-11-04
12
+
13
+ - [BREAKING] SoundPlayer#state returns :none instead of :unknown for a player with nothing to play
14
+ - Let a stopped sound player play again, also from a position set while it is stopped
15
+ - Stop the oldest sound when too many sounds play at once
16
+ - Write a log instead of raising when no sound can stop to make room for a new one
17
+ - Raise ArgumentError for a position over the length of a sound
18
+ - Read files of 24 and 32 bits, and of floats, on Windows
19
+
20
+ - Fix FileIn on Windows reading 16-bit samples as unsigned
21
+ - Fix a leak of the buffers of finished sound players, which stopped every sound after 1024 of them on macOS
22
+ - Fix the errors of OpenAL never being caught
23
+
24
+
25
+ ## [v0.4.0] - 2026-08-04
26
+
27
+ - Support dup on value classes, reject it on stateful ones
28
+
29
+ - Fix loading audio files whose path is outside the ANSI code page on Windows
30
+
31
+
4
32
  ## [v0.3.16] - 2026-06-23
5
33
 
6
34
  - Update dependencies
data/Gemfile.lock CHANGED
@@ -1,21 +1,26 @@
1
1
  GEM
2
2
  remote: https://rubygems.org/
3
3
  specs:
4
- power_assert (3.0.1)
5
- rake (13.3.1)
6
- test-unit (3.7.7)
4
+ power_assert (3.1.0)
5
+ rake (13.4.2)
6
+ test-unit (3.7.8)
7
7
  power_assert
8
- yard (0.9.39)
8
+ yard (0.9.45)
9
9
 
10
10
  PLATFORMS
11
- arm64-darwin-21
12
- arm64-darwin-23
13
- arm64-darwin-24
11
+ ruby
14
12
 
15
13
  DEPENDENCIES
16
14
  rake
17
15
  test-unit
18
16
  yard
19
17
 
18
+ CHECKSUMS
19
+ bundler (4.0.20) sha256=7978a8ac648767f5e635bc522445b79e80a52b907a39a36c2d8085ed6bc762ae
20
+ power_assert (3.1.0) sha256=fefe98ed5d3140628138f3f9f9194d6ece01f1320e69700d3c928adca7518251
21
+ rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701
22
+ test-unit (3.7.8) sha256=689d1ca53f4d46f678b4e5d68d8e4294f87fc5e8b9238cc4de7c5727e8d65943
23
+ yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51
24
+
20
25
  BUNDLED WITH
21
- 2.4.19
26
+ 4.0.20
data/Rakefile CHANGED
@@ -33,7 +33,7 @@ use_external_library 'https://github.com/avaneev/r8brain-free-src',
33
33
  tag: 'version-6.2',
34
34
  excludes: %w[DLL/ bench/ other/ pffft_double example.cpp],
35
35
  &proc {
36
- filter_file('r8bconf.h') do |conf|
36
+ filter_file 'r8bconf.h' do |conf|
37
37
  <<~EOS + conf
38
38
  #ifndef R8B_PFFFT
39
39
  #define R8B_PFFFT 1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.16
1
+ 0.5.1
data/beeps.gemspec CHANGED
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
11
11
 
12
12
  ext = Beeps::Extension
13
13
  name = ext.name true
14
- rdocs = glob.call *%w[README .doc/ext/**/*.cpp]
14
+ rdocs = glob.call(*%w[README .doc/ext/**/*.cpp])
15
15
 
16
16
  s.name = name
17
17
  s.version = ext.version
@@ -25,8 +25,8 @@ Gem::Specification.new do |s|
25
25
  s.platform = Gem::Platform::RUBY
26
26
  s.required_ruby_version = '>= 3.0.0'
27
27
 
28
- s.add_dependency 'xot', '~> 0.3.15'
29
- s.add_dependency 'rucy', '~> 0.3.15'
28
+ s.add_dependency 'xot', '~> 0.5.0'
29
+ s.add_dependency 'rucy', '~> 0.5.0'
30
30
 
31
31
  s.files = `git ls-files`.split $/
32
32
  s.executables = s.files.grep(%r{^bin/}) {|f| File.basename f}
@@ -10,7 +10,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Analyser)
10
10
 
11
11
  #define THIS to<Beeps::Analyser*>(self)
12
12
 
13
- #define CHECK RUCY_CHECK_OBJ(Beeps::Analyser, self)
13
+ #define CHECK RUCY_CHECK_PTR(Beeps::Analyser, self)
14
14
 
15
15
 
16
16
  static
@@ -68,7 +68,7 @@ RUCY_DEF1(each_signal, nsamples_)
68
68
  {
69
69
  case 1:
70
70
  for (uint i = start; i < nsamples; ++i)
71
- rb_yield(value(samples[i]));
71
+ yield(value(samples[i]));
72
72
  break;
73
73
 
74
74
  case 2:
@@ -78,7 +78,7 @@ RUCY_DEF1(each_signal, nsamples_)
78
78
  {
79
79
  args.set(0, value(samples[i + 0]));
80
80
  args.set(1, value(samples[i + 1]));
81
- rb_yield(args);
81
+ yield(args);
82
82
  }
83
83
  break;
84
84
  }
@@ -96,7 +96,7 @@ RUCY_DEF0(each_spectrum)
96
96
  invalid_object_error(__FILE__, __LINE__);
97
97
 
98
98
  for (auto val : THIS->spectrum())
99
- rb_yield(value(val));
99
+ yield(value(val));
100
100
 
101
101
  return nil();
102
102
  }
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::Envelope)
9
9
 
10
10
  #define THIS to<Beeps::Envelope*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::Envelope, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::Envelope, self)
13
13
 
14
14
 
15
15
  static
@@ -9,7 +9,7 @@ RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(BEEPS_EXPORT, Beeps::FileIn)
9
9
 
10
10
  #define THIS to<Beeps::FileIn*>(self)
11
11
 
12
- #define CHECK RUCY_CHECK_OBJ(Beeps::FileIn, self)
12
+ #define CHECK RUCY_CHECK_PTR(Beeps::FileIn, self)
13
13
 
14
14
 
15
15
  static