beeps 0.1.31 → 0.1.33
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 +4 -4
- data/.doc/ext/beeps/adsr.cpp +139 -0
- data/.doc/ext/beeps/analyser.cpp +128 -0
- data/.doc/ext/beeps/beeps.cpp +9 -1
- data/.doc/ext/beeps/file_in.cpp +55 -9
- data/.doc/ext/beeps/gain.cpp +64 -0
- data/.doc/ext/beeps/mic_in.cpp +83 -0
- data/.doc/ext/beeps/native.cpp +20 -8
- data/.doc/ext/beeps/oscillator.cpp +88 -0
- data/.doc/ext/beeps/pitch_shift.cpp +64 -0
- data/.doc/ext/beeps/processor.cpp +31 -2
- data/.doc/ext/beeps/sound.cpp +90 -7
- data/.doc/ext/beeps/sound_player.cpp +156 -0
- data/.doc/ext/beeps/time_stretch.cpp +64 -0
- data/.github/workflows/release-gem.yml +62 -0
- data/.github/workflows/test.yml +0 -6
- data/.github/workflows/utils.rb +13 -5
- data/ChangeLog.md +13 -0
- data/Rakefile +27 -6
- data/VERSION +1 -1
- data/beeps.gemspec +2 -2
- data/ext/beeps/adsr.cpp +150 -0
- data/ext/beeps/analyser.cpp +134 -0
- data/ext/beeps/beeps.cpp +10 -1
- data/ext/beeps/extconf.rb +1 -2
- data/ext/beeps/file_in.cpp +60 -9
- data/ext/beeps/gain.cpp +67 -0
- data/ext/beeps/mic_in.cpp +88 -0
- data/ext/beeps/native.cpp +20 -8
- data/ext/beeps/oscillator.cpp +93 -0
- data/ext/beeps/pitch_shift.cpp +67 -0
- data/ext/beeps/processor.cpp +34 -2
- data/ext/beeps/sound.cpp +99 -7
- data/ext/beeps/sound_player.cpp +169 -0
- data/ext/beeps/time_stretch.cpp +67 -0
- data/include/beeps/beeps.h +2 -1
- data/include/beeps/filter.h +179 -0
- data/include/beeps/generator.h +120 -0
- data/include/beeps/processor.h +37 -68
- data/include/beeps/ruby/filter.h +78 -0
- data/include/beeps/ruby/generator.h +60 -0
- data/include/beeps/ruby/processor.h +5 -45
- data/include/beeps/ruby/sound.h +14 -3
- data/include/beeps/signals.h +10 -4
- data/include/beeps/sound.h +67 -2
- data/lib/beeps/beeps.rb +6 -1
- data/lib/beeps/processor.rb +95 -15
- data/lib/beeps/sound.rb +29 -2
- data/src/adsr.cpp +245 -0
- data/src/analyser.cpp +254 -0
- data/src/beeps.cpp +11 -2
- data/src/file_in.cpp +94 -0
- data/src/gain.cpp +55 -0
- data/src/mic_in.cpp +262 -0
- data/src/mic_in.h +20 -0
- data/src/openal.cpp +2 -1
- data/src/oscillator.cpp +145 -0
- data/src/osx/signals.mm +83 -0
- data/src/pitch_shift.cpp +82 -0
- data/src/processor.cpp +202 -88
- data/src/processor.h +98 -0
- data/src/signals.cpp +326 -20
- data/src/signals.h +192 -2
- data/src/sound.cpp +735 -113
- data/src/sound.h +6 -1
- data/src/time_stretch.cpp +91 -0
- data/test/helper.rb +2 -1
- data/test/test_beeps.rb +10 -7
- data/test/test_beeps_init.rb +18 -0
- data/test/test_file_in.rb +15 -0
- data/test/test_processor.rb +50 -0
- data/test/test_sound.rb +87 -11
- data/test/test_sound_player.rb +134 -0
- metadata +55 -17
- data/.doc/ext/beeps/sawtooth_wave.cpp +0 -61
- data/.doc/ext/beeps/sine_wave.cpp +0 -61
- data/.doc/ext/beeps/square_wave.cpp +0 -61
- data/.github/workflows/release.yml +0 -34
- data/ext/beeps/sawtooth_wave.cpp +0 -64
- data/ext/beeps/sine_wave.cpp +0 -64
- data/ext/beeps/square_wave.cpp +0 -64
@@ -0,0 +1,64 @@
|
|
1
|
+
#include "beeps/ruby/filter.h"
|
2
|
+
|
3
|
+
|
4
|
+
#include "beeps/ruby/processor.h"
|
5
|
+
#include "defs.h"
|
6
|
+
|
7
|
+
|
8
|
+
RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::PitchShift)
|
9
|
+
|
10
|
+
#define THIS to<Beeps::PitchShift*>(self)
|
11
|
+
|
12
|
+
#define CHECK RUCY_CHECK_OBJ(Beeps::PitchShift, self)
|
13
|
+
|
14
|
+
|
15
|
+
static
|
16
|
+
VALUE alloc(VALUE klass)
|
17
|
+
{
|
18
|
+
return value(new Beeps::RubyProcessor<Beeps::PitchShift>, klass);
|
19
|
+
}
|
20
|
+
|
21
|
+
static
|
22
|
+
VALUE set_shift(VALUE self, VALUE shift)
|
23
|
+
{
|
24
|
+
CHECK;
|
25
|
+
|
26
|
+
THIS->set_shift(to<float>(shift));
|
27
|
+
return shift;
|
28
|
+
}
|
29
|
+
|
30
|
+
static
|
31
|
+
VALUE get_shift(VALUE self)
|
32
|
+
{
|
33
|
+
CHECK;
|
34
|
+
|
35
|
+
return value(THIS->shift());
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
static Class cPitchShift;
|
40
|
+
|
41
|
+
void
|
42
|
+
Init_beeps_pitch_shift ()
|
43
|
+
{
|
44
|
+
Module mBeeps = rb_define_module("Beeps");
|
45
|
+
|
46
|
+
cPitchShift = mBeeps.define_class("PitchShift", Beeps::processor_class());
|
47
|
+
rb_define_alloc_func(cPitchShift, alloc);
|
48
|
+
rb_define_method(cPitchShift, "shift=", RUBY_METHOD_FUNC(set_shift), 1);
|
49
|
+
rb_define_method(cPitchShift, "shift", RUBY_METHOD_FUNC(get_shift), 0);
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
namespace Beeps
|
54
|
+
{
|
55
|
+
|
56
|
+
|
57
|
+
Class
|
58
|
+
pitch_shift_class ()
|
59
|
+
{
|
60
|
+
return cPitchShift;
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
}// Beeps
|
@@ -5,11 +5,11 @@
|
|
5
5
|
#include "defs.h"
|
6
6
|
|
7
7
|
|
8
|
-
|
8
|
+
RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::Processor)
|
9
9
|
|
10
10
|
#define THIS to<Beeps::Processor*>(self)
|
11
11
|
|
12
|
-
#define CHECK
|
12
|
+
#define CHECK RUCY_CHECK_OBJ(Beeps::Processor, self)
|
13
13
|
|
14
14
|
|
15
15
|
static
|
@@ -18,6 +18,32 @@ VALUE alloc(VALUE klass)
|
|
18
18
|
Beeps::beeps_error(__FILE__, __LINE__);
|
19
19
|
}
|
20
20
|
|
21
|
+
static
|
22
|
+
VALUE reset(VALUE self)
|
23
|
+
{
|
24
|
+
CHECK;
|
25
|
+
|
26
|
+
THIS->reset();
|
27
|
+
return self;
|
28
|
+
}
|
29
|
+
|
30
|
+
static
|
31
|
+
VALUE set_input(VALUE self, VALUE input)
|
32
|
+
{
|
33
|
+
CHECK;
|
34
|
+
|
35
|
+
THIS->set_input(input ? to<Beeps::Processor*>(input) : NULL);
|
36
|
+
return input;
|
37
|
+
}
|
38
|
+
|
39
|
+
static
|
40
|
+
VALUE get_input(VALUE self)
|
41
|
+
{
|
42
|
+
CHECK;
|
43
|
+
|
44
|
+
return value(THIS->input());
|
45
|
+
}
|
46
|
+
|
21
47
|
|
22
48
|
static Class cProcessor;
|
23
49
|
|
@@ -28,6 +54,9 @@ Init_beeps_processor ()
|
|
28
54
|
|
29
55
|
cProcessor = rb_define_class_under(mBeeps, "Processor", rb_cObject);
|
30
56
|
rb_define_alloc_func(cProcessor, alloc);
|
57
|
+
rb_define_method(cProcessor, "reset", RUBY_METHOD_FUNC(reset), 0);
|
58
|
+
rb_define_method(cProcessor, "input=", RUBY_METHOD_FUNC(set_input), 1);
|
59
|
+
rb_define_method(cProcessor, "input", RUBY_METHOD_FUNC(get_input), 0);
|
31
60
|
}
|
32
61
|
|
33
62
|
|
data/.doc/ext/beeps/sound.cpp
CHANGED
@@ -8,7 +8,7 @@ RUCY_DEFINE_VALUE_FROM_TO(Beeps::Sound)
|
|
8
8
|
|
9
9
|
#define THIS to<Beeps::Sound*>(self)
|
10
10
|
|
11
|
-
#define CHECK
|
11
|
+
#define CHECK RUCY_CHECK_OBJ(Beeps::Sound, self)
|
12
12
|
|
13
13
|
|
14
14
|
static
|
@@ -18,11 +18,13 @@ VALUE alloc(VALUE klass)
|
|
18
18
|
}
|
19
19
|
|
20
20
|
static
|
21
|
-
VALUE
|
21
|
+
VALUE setup(VALUE self, VALUE processor, VALUE seconds, VALUE nchannels, VALUE sample_rate)
|
22
22
|
{
|
23
|
-
|
23
|
+
CHECK;
|
24
24
|
|
25
|
-
*THIS = Beeps::Sound(
|
25
|
+
*THIS = Beeps::Sound(
|
26
|
+
to<Beeps::Processor*>(processor),
|
27
|
+
to<float>(seconds), to<uint>(nchannels), to<double>(sample_rate));
|
26
28
|
return self;
|
27
29
|
}
|
28
30
|
|
@@ -31,10 +33,82 @@ VALUE play(VALUE self)
|
|
31
33
|
{
|
32
34
|
CHECK;
|
33
35
|
|
34
|
-
THIS->play();
|
36
|
+
return value(THIS->play());
|
37
|
+
}
|
38
|
+
|
39
|
+
static
|
40
|
+
VALUE save(VALUE self, VALUE path)
|
41
|
+
{
|
42
|
+
CHECK;
|
43
|
+
|
44
|
+
THIS->save(path.c_str());
|
35
45
|
return self;
|
36
46
|
}
|
37
47
|
|
48
|
+
static
|
49
|
+
VALUE get_sample_rate(VALUE self)
|
50
|
+
{
|
51
|
+
CHECK;
|
52
|
+
|
53
|
+
return value(THIS->sample_rate());
|
54
|
+
}
|
55
|
+
|
56
|
+
static
|
57
|
+
VALUE get_nchannels(VALUE self)
|
58
|
+
{
|
59
|
+
CHECK;
|
60
|
+
|
61
|
+
return value(THIS->nchannels());
|
62
|
+
}
|
63
|
+
|
64
|
+
static
|
65
|
+
VALUE get_seconds(VALUE self)
|
66
|
+
{
|
67
|
+
CHECK;
|
68
|
+
|
69
|
+
return value(THIS->seconds());
|
70
|
+
}
|
71
|
+
|
72
|
+
static
|
73
|
+
VALUE set_gain(VALUE self, VALUE gain)
|
74
|
+
{
|
75
|
+
CHECK;
|
76
|
+
|
77
|
+
THIS->set_gain(to<float>(gain));
|
78
|
+
return gain;
|
79
|
+
}
|
80
|
+
|
81
|
+
static
|
82
|
+
VALUE get_gain(VALUE self)
|
83
|
+
{
|
84
|
+
CHECK;
|
85
|
+
|
86
|
+
return value(THIS->gain());
|
87
|
+
}
|
88
|
+
|
89
|
+
static
|
90
|
+
VALUE set_loop(VALUE self, VALUE loop)
|
91
|
+
{
|
92
|
+
CHECK;
|
93
|
+
|
94
|
+
THIS->set_loop(to<bool>(loop));
|
95
|
+
return loop;
|
96
|
+
}
|
97
|
+
|
98
|
+
static
|
99
|
+
VALUE get_loop(VALUE self)
|
100
|
+
{
|
101
|
+
CHECK;
|
102
|
+
|
103
|
+
return value(THIS->loop());
|
104
|
+
}
|
105
|
+
|
106
|
+
static
|
107
|
+
VALUE load(VALUE self, VALUE path)
|
108
|
+
{
|
109
|
+
return value(Beeps::load_sound(to<const char*>(path)));
|
110
|
+
}
|
111
|
+
|
38
112
|
|
39
113
|
static Class cSound;
|
40
114
|
|
@@ -45,8 +119,17 @@ Init_beeps_sound ()
|
|
45
119
|
|
46
120
|
cSound = rb_define_class_under(mBeeps, "Sound", rb_cObject);
|
47
121
|
rb_define_alloc_func(cSound, alloc);
|
48
|
-
rb_define_private_method(cSound, "
|
49
|
-
|
122
|
+
rb_define_private_method(cSound, "setup", RUBY_METHOD_FUNC(setup), 4);
|
123
|
+
cSound.define_private_method("play!", play);
|
124
|
+
rb_define_method(cSound, "save", RUBY_METHOD_FUNC(save), 1);
|
125
|
+
rb_define_method(cSound, "sample_rate", RUBY_METHOD_FUNC(get_sample_rate), 0);
|
126
|
+
rb_define_method(cSound, "nchannels", RUBY_METHOD_FUNC(get_nchannels), 0);
|
127
|
+
rb_define_method(cSound, "seconds", RUBY_METHOD_FUNC(get_seconds), 0);
|
128
|
+
rb_define_method(cSound, "gain=", RUBY_METHOD_FUNC(set_gain), 1);
|
129
|
+
rb_define_method(cSound, "gain", RUBY_METHOD_FUNC(get_gain), 0);
|
130
|
+
rb_define_method(cSound, "loop=", RUBY_METHOD_FUNC(set_loop), 1);
|
131
|
+
rb_define_method(cSound, "loop", RUBY_METHOD_FUNC(get_loop), 0);
|
132
|
+
rb_define_singleton_method(cSound, "load", RUBY_METHOD_FUNC(load), 1);
|
50
133
|
}
|
51
134
|
|
52
135
|
|
@@ -0,0 +1,156 @@
|
|
1
|
+
#include "beeps/ruby/sound.h"
|
2
|
+
|
3
|
+
|
4
|
+
#include "defs.h"
|
5
|
+
|
6
|
+
|
7
|
+
RUCY_DEFINE_VALUE_FROM_TO(Beeps::SoundPlayer)
|
8
|
+
|
9
|
+
#define THIS to<Beeps::SoundPlayer*>(self)
|
10
|
+
|
11
|
+
#define CHECK RUCY_CHECK_OBJ(Beeps::SoundPlayer, self)
|
12
|
+
|
13
|
+
|
14
|
+
static
|
15
|
+
VALUE alloc(VALUE klass)
|
16
|
+
{
|
17
|
+
return new_type<Beeps::SoundPlayer>(klass);
|
18
|
+
}
|
19
|
+
|
20
|
+
static
|
21
|
+
VALUE play(VALUE self)
|
22
|
+
{
|
23
|
+
CHECK;
|
24
|
+
|
25
|
+
THIS->play();
|
26
|
+
return self;
|
27
|
+
}
|
28
|
+
|
29
|
+
static
|
30
|
+
VALUE pause(VALUE self)
|
31
|
+
{
|
32
|
+
CHECK;
|
33
|
+
|
34
|
+
THIS->pause();
|
35
|
+
return self;
|
36
|
+
}
|
37
|
+
|
38
|
+
static
|
39
|
+
VALUE rewind(VALUE self)
|
40
|
+
{
|
41
|
+
CHECK;
|
42
|
+
|
43
|
+
THIS->rewind();
|
44
|
+
return self;
|
45
|
+
}
|
46
|
+
|
47
|
+
static
|
48
|
+
VALUE stop(VALUE self)
|
49
|
+
{
|
50
|
+
CHECK;
|
51
|
+
|
52
|
+
THIS->stop();
|
53
|
+
return self;
|
54
|
+
}
|
55
|
+
|
56
|
+
static
|
57
|
+
VALUE is_playing(VALUE self)
|
58
|
+
{
|
59
|
+
CHECK;
|
60
|
+
|
61
|
+
return value(THIS->is_playing());
|
62
|
+
}
|
63
|
+
|
64
|
+
static
|
65
|
+
VALUE is_paused(VALUE self)
|
66
|
+
{
|
67
|
+
CHECK;
|
68
|
+
|
69
|
+
return value(THIS->is_paused());
|
70
|
+
}
|
71
|
+
|
72
|
+
static
|
73
|
+
VALUE is_stopped(VALUE self)
|
74
|
+
{
|
75
|
+
CHECK;
|
76
|
+
|
77
|
+
return value(THIS->is_stopped());
|
78
|
+
}
|
79
|
+
|
80
|
+
static
|
81
|
+
VALUE set_gain(VALUE self, VALUE gain)
|
82
|
+
{
|
83
|
+
CHECK;
|
84
|
+
|
85
|
+
THIS->set_gain(to<float>(gain));
|
86
|
+
return gain;
|
87
|
+
}
|
88
|
+
|
89
|
+
static
|
90
|
+
VALUE get_gain(VALUE self)
|
91
|
+
{
|
92
|
+
CHECK;
|
93
|
+
|
94
|
+
return value(THIS->gain());
|
95
|
+
}
|
96
|
+
|
97
|
+
static
|
98
|
+
VALUE set_loop(VALUE self, VALUE loop)
|
99
|
+
{
|
100
|
+
CHECK;
|
101
|
+
|
102
|
+
THIS->set_loop(to<bool>(loop));
|
103
|
+
return loop;
|
104
|
+
}
|
105
|
+
|
106
|
+
static
|
107
|
+
VALUE get_loop(VALUE self)
|
108
|
+
{
|
109
|
+
CHECK;
|
110
|
+
|
111
|
+
return value(THIS->loop());
|
112
|
+
}
|
113
|
+
|
114
|
+
static
|
115
|
+
VALUE stop_all(VALUE self)
|
116
|
+
{
|
117
|
+
Beeps::stop_all_sound_players();
|
118
|
+
}
|
119
|
+
|
120
|
+
|
121
|
+
static Class cSoundPlayer;
|
122
|
+
|
123
|
+
void
|
124
|
+
Init_beeps_sound_player ()
|
125
|
+
{
|
126
|
+
Module mBeeps = rb_define_module("Beeps");
|
127
|
+
|
128
|
+
cSoundPlayer = rb_define_class_under(mBeeps, "SoundPlayer", rb_cObject);
|
129
|
+
rb_define_alloc_func(cSoundPlayer, alloc);
|
130
|
+
rb_define_method(cSoundPlayer, "play", RUBY_METHOD_FUNC(play), 0);
|
131
|
+
rb_define_method(cSoundPlayer, "pause", RUBY_METHOD_FUNC(pause), 0);
|
132
|
+
rb_define_method(cSoundPlayer, "rewind", RUBY_METHOD_FUNC(rewind), 0);
|
133
|
+
rb_define_method(cSoundPlayer, "stop", RUBY_METHOD_FUNC(stop), 0);
|
134
|
+
cSoundPlayer.define_method("playing?", is_playing);
|
135
|
+
cSoundPlayer.define_method("paused?", is_paused);
|
136
|
+
cSoundPlayer.define_method("stopped?", is_stopped);
|
137
|
+
rb_define_method(cSoundPlayer, "gain=", RUBY_METHOD_FUNC(set_gain), 1);
|
138
|
+
rb_define_method(cSoundPlayer, "gain", RUBY_METHOD_FUNC(get_gain), 0);
|
139
|
+
rb_define_method(cSoundPlayer, "loop=", RUBY_METHOD_FUNC(set_loop), 1);
|
140
|
+
rb_define_method(cSoundPlayer, "loop", RUBY_METHOD_FUNC(get_loop), 0);
|
141
|
+
rb_define_singleton_method(cSoundPlayer, "stop_all", RUBY_METHOD_FUNC(stop_all), 0);
|
142
|
+
}
|
143
|
+
|
144
|
+
|
145
|
+
namespace Beeps
|
146
|
+
{
|
147
|
+
|
148
|
+
|
149
|
+
Class
|
150
|
+
sound_player_class ()
|
151
|
+
{
|
152
|
+
return cSoundPlayer;
|
153
|
+
}
|
154
|
+
|
155
|
+
|
156
|
+
}// Beeps
|
@@ -0,0 +1,64 @@
|
|
1
|
+
#include "beeps/ruby/filter.h"
|
2
|
+
|
3
|
+
|
4
|
+
#include "beeps/ruby/processor.h"
|
5
|
+
#include "defs.h"
|
6
|
+
|
7
|
+
|
8
|
+
RUCY_DEFINE_WRAPPER_VALUE_FROM_TO(Beeps::TimeStretch)
|
9
|
+
|
10
|
+
#define THIS to<Beeps::TimeStretch*>(self)
|
11
|
+
|
12
|
+
#define CHECK RUCY_CHECK_OBJ(Beeps::TimeStretch, self)
|
13
|
+
|
14
|
+
|
15
|
+
static
|
16
|
+
VALUE alloc(VALUE klass)
|
17
|
+
{
|
18
|
+
return value(new Beeps::RubyProcessor<Beeps::TimeStretch>, klass);
|
19
|
+
}
|
20
|
+
|
21
|
+
static
|
22
|
+
VALUE set_scale(VALUE self, VALUE scale)
|
23
|
+
{
|
24
|
+
CHECK;
|
25
|
+
|
26
|
+
THIS->set_scale(to<float>(scale));
|
27
|
+
return scale;
|
28
|
+
}
|
29
|
+
|
30
|
+
static
|
31
|
+
VALUE get_scale(VALUE self)
|
32
|
+
{
|
33
|
+
CHECK;
|
34
|
+
|
35
|
+
return value(THIS->scale());
|
36
|
+
}
|
37
|
+
|
38
|
+
|
39
|
+
static Class cTimeStretch;
|
40
|
+
|
41
|
+
void
|
42
|
+
Init_beeps_time_stretch ()
|
43
|
+
{
|
44
|
+
Module mBeeps = rb_define_module("Beeps");
|
45
|
+
|
46
|
+
cTimeStretch = mBeeps.define_class("TimeStretch", Beeps::processor_class());
|
47
|
+
rb_define_alloc_func(cTimeStretch, alloc);
|
48
|
+
rb_define_method(cTimeStretch, "scale=", RUBY_METHOD_FUNC(set_scale), 1);
|
49
|
+
rb_define_method(cTimeStretch, "scale", RUBY_METHOD_FUNC(get_scale), 0);
|
50
|
+
}
|
51
|
+
|
52
|
+
|
53
|
+
namespace Beeps
|
54
|
+
{
|
55
|
+
|
56
|
+
|
57
|
+
Class
|
58
|
+
time_stretch_class ()
|
59
|
+
{
|
60
|
+
return cTimeStretch;
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
}// Beeps
|
@@ -0,0 +1,62 @@
|
|
1
|
+
name: Release Gem
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
tags: ['v[0-9]*']
|
6
|
+
|
7
|
+
jobs:
|
8
|
+
release:
|
9
|
+
runs-on: macos-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@v2
|
19
|
+
|
20
|
+
- name: setup dependencies
|
21
|
+
run: "ruby -I.github/workflows -rutils -e 'setup_dependencies'"
|
22
|
+
|
23
|
+
- name: install gems
|
24
|
+
run: gem install yard
|
25
|
+
|
26
|
+
- name: test
|
27
|
+
run: rake quiet test
|
28
|
+
|
29
|
+
- name: create gem
|
30
|
+
id: gem
|
31
|
+
run: |
|
32
|
+
rake gem
|
33
|
+
echo path=$(ruby -e 'print Dir.glob("*.gem").first') >> $GITHUB_OUTPUT
|
34
|
+
|
35
|
+
- name: create github release
|
36
|
+
id: release
|
37
|
+
uses: actions/create-release@v1
|
38
|
+
env:
|
39
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
40
|
+
with:
|
41
|
+
tag_name: ${{ github.ref }}
|
42
|
+
release_name: ${{ github.ref }}
|
43
|
+
|
44
|
+
- name: upload to github release
|
45
|
+
uses: actions/upload-release-asset@v1
|
46
|
+
env:
|
47
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
48
|
+
with:
|
49
|
+
upload_url: ${{ steps.release.outputs.upload_url }}
|
50
|
+
asset_path: ./${{ steps.gem.outputs.path }}
|
51
|
+
asset_name: ${{ steps.gem.outputs.path }}
|
52
|
+
asset_content_type: application/zip
|
53
|
+
|
54
|
+
- name: upload to rubygems
|
55
|
+
env:
|
56
|
+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_AUTH_TOKEN }}
|
57
|
+
run: |
|
58
|
+
mkdir -p $HOME/.gem
|
59
|
+
touch $HOME/.gem/credentials
|
60
|
+
chmod 0600 $HOME/.gem/credentials
|
61
|
+
printf -- "---\n:rubygems_api_key: ${GEM_HOST_API_KEY}\n" > $HOME/.gem/credentials
|
62
|
+
rake upload
|
data/.github/workflows/test.yml
CHANGED
data/.github/workflows/utils.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
RENAMES = {reflex: 'reflexion'}
|
2
|
+
|
1
3
|
def sh(cmd)
|
2
4
|
puts cmd
|
3
5
|
system cmd
|
@@ -5,8 +7,10 @@ end
|
|
5
7
|
|
6
8
|
def setup_dependencies(build: true, only: nil)
|
7
9
|
gemspec_path = `git ls-files`.lines(chomp: true).find {|l| l =~ /\.gemspec$/}
|
8
|
-
|
9
|
-
|
10
|
+
return unless gemspec_path
|
11
|
+
|
12
|
+
gemspec = File.read gemspec_path
|
13
|
+
name = File.basename gemspec_path, '.gemspec'
|
10
14
|
|
11
15
|
exts = File.readlines('Rakefile')
|
12
16
|
.map {|l| l[%r|^\s*require\W+(\w+)/extension\W+$|, 1]}
|
@@ -15,9 +19,13 @@ def setup_dependencies(build: true, only: nil)
|
|
15
19
|
exts = exts & [only].flatten.map(&:to_s) if only
|
16
20
|
|
17
21
|
exts.each do |ext|
|
18
|
-
|
19
|
-
|
20
|
-
|
22
|
+
gem = RENAMES[ext.to_sym].then {|s| s || ext}
|
23
|
+
clone = "git clone --depth 1 https://github.com/xord/#{ext}.git ../#{ext}"
|
24
|
+
ver = gemspec[/add_runtime_dependency.*['"]#{gem}['"].*['"]\s*~>\s*([\d\.]+)\s*['"]/, 1]
|
25
|
+
|
26
|
+
# 'rake subtree:push' pushes all subrepos, so cloning by new tag
|
27
|
+
# often fails before tagging each new tag
|
28
|
+
sh %( #{clone} --branch v#{ver} || #{clone} )
|
21
29
|
sh %( cd ../#{ext} && rake ext )
|
22
30
|
end
|
23
31
|
end
|
data/ChangeLog.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# beeps ChangeLog
|
2
2
|
|
3
3
|
|
4
|
+
## [v0.1.33] - 2023-04-22
|
5
|
+
|
6
|
+
- Stream playback is now supported.
|
7
|
+
- Pause, resume, and stop after playback, as well as methods to check the status of the playback.
|
8
|
+
- Support for saving and loading sound files
|
9
|
+
- Added Oscillator, MicIn, Gain, ADSR, TimeStretch, PitchShift, and Analyser classes.
|
10
|
+
|
11
|
+
|
12
|
+
## [v0.1.32] - 2023-03-01
|
13
|
+
|
14
|
+
- fix bugs
|
15
|
+
|
16
|
+
|
4
17
|
## [v0.1.31] - 2023-02-27
|
5
18
|
|
6
19
|
- add ChangeLog.md file
|
data/Rakefile
CHANGED
@@ -13,18 +13,39 @@ require 'beeps/extension'
|
|
13
13
|
|
14
14
|
|
15
15
|
EXTENSIONS = [Xot, Rucy, Beeps]
|
16
|
-
TESTS_ALONE = ['test/
|
16
|
+
TESTS_ALONE = ['test/test_beeps_init.rb']
|
17
17
|
|
18
18
|
use_external_library 'https://github.com/thestk/stk',
|
19
|
-
tag: '
|
20
|
-
|
21
|
-
|
19
|
+
tag: '4.6.2',
|
20
|
+
incdirs: 'include',
|
21
|
+
srcdirs: 'src',
|
22
22
|
excludes: %w[stk/src/include Tcp Udp Socket Thread Mutex InetWv /Rt]
|
23
23
|
|
24
|
+
use_external_library 'https://github.com/adamstark/AudioFile',
|
25
|
+
tag: '1.1.1',
|
26
|
+
srcdirs: 'NOSRC',
|
27
|
+
excludes: %w[examples/ tests/]
|
28
|
+
|
29
|
+
use_external_library 'https://github.com/avaneev/r8brain-free-src',
|
30
|
+
tag: 'version-6.2',
|
31
|
+
excludes: %w[DLL/ bench/ other/ pffft_double example.cpp],
|
32
|
+
&proc {
|
33
|
+
filter_file('r8bconf.h') do |conf|
|
34
|
+
<<~EOS + conf
|
35
|
+
#ifndef R8B_PFFFT
|
36
|
+
#define R8B_PFFFT 1
|
37
|
+
#endif
|
38
|
+
EOS
|
39
|
+
end
|
40
|
+
}
|
41
|
+
|
42
|
+
use_external_library 'https://github.com/Signalsmith-Audio/signalsmith-stretch',
|
43
|
+
commit: 'fddcdb628f326ef187b7e5694f285f35a528aba3',
|
44
|
+
srcdirs: 'NOSRC'
|
45
|
+
|
46
|
+
default_tasks :ext
|
24
47
|
build_native_library
|
25
48
|
build_ruby_extension
|
26
49
|
test_ruby_extension
|
27
50
|
generate_documents
|
28
51
|
build_ruby_gem
|
29
|
-
|
30
|
-
task :default => :ext
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.33
|
data/beeps.gemspec
CHANGED
@@ -28,8 +28,8 @@ Gem::Specification.new do |s|
|
|
28
28
|
s.platform = Gem::Platform::RUBY
|
29
29
|
s.required_ruby_version = '>= 2.7.0'
|
30
30
|
|
31
|
-
s.add_runtime_dependency 'xot', '~> 0.1.
|
32
|
-
s.add_runtime_dependency 'rucy', '~> 0.1.
|
31
|
+
s.add_runtime_dependency 'xot', '~> 0.1.33'
|
32
|
+
s.add_runtime_dependency 'rucy', '~> 0.1.33'
|
33
33
|
|
34
34
|
s.add_development_dependency 'rake'
|
35
35
|
s.add_development_dependency 'test-unit'
|