step_sequencer 1.1.3 → 1.1.5

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
  SHA1:
3
- metadata.gz: 7bcdfb6761dadd8db2aac714ae3205070cfd1953
4
- data.tar.gz: 6b91169ee39afdc44980f7bea1daebc8f2af308c
3
+ metadata.gz: 1c6b1fdcd1333c9891995fde31b9ee07950ebc65
4
+ data.tar.gz: 6603f69c38143036a82ade09bdd79f14337266cf
5
5
  SHA512:
6
- metadata.gz: a8fd037e47ef7df933593dc693c29bbad66d851395d313cc41fe0ff8b918d8f7835cdad05448eac5ad3570a5f7906053d5507d1a7dc981bbbc0b02b7a6ad6d06
7
- data.tar.gz: ff1e429f0813d83794a3ab2c5f251f5da316817fa0cd9522f326e865cf16205309adbb4436f00f774c4565330038bb894e41bf93aba44b74a4a26f7d178c6b38
6
+ metadata.gz: d3ed97d25ba5fda56df0649d857b16c499308310d9599fdfe0a418277ecbd5dd3079336c6eb1bd020b2f1e891f743e27b22b61fd6bd9a108d1257ef1a64e82e8
7
+ data.tar.gz: 18dae35ee85cf3e984e16ecd12a980ece9e71648af7e44d9d323f0b294dd069335dbfb35b72b118ec2c74d030fc971370a3cd9cfed11a95b36f56d8db5869412
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  This is a Ruby tool to play mp3 files in a step sequencer.
4
4
 
5
5
  It also handles polyrhythmic playback and building sounds using effects like
6
- loop, combine, slice, overlay, combine, gain, speed, and pitch
6
+ loop, combine, slice, overlay, combine, gain, speed, pitch, and download.
7
7
 
8
8
  ## Setup
9
9
 
@@ -13,6 +13,8 @@ Some external programs need to be installed:
13
13
 
14
14
  `mpg123 ffmpeg sox libsox-fmt-mp3`
15
15
 
16
+ If using the 'download' command, then `youtube-dl` is needed.
17
+
16
18
  To run the tests, the program `espeak` is also required.
17
19
 
18
20
  ### Installing
@@ -261,3 +263,16 @@ step_sequencer test
261
263
 
262
264
  They can also be run from code: `require 'step_sequencer'` then
263
265
  `StepSequencer::Tests.run`.
266
+
267
+ ## Downloading music from youtube
268
+
269
+ Bundled into this gem is [youtube_audio_downloader](http://github.com/maxpleaner/youtube-audio-downloader),
270
+ which provides a simple command to download audio from youtube:
271
+
272
+ ```rb
273
+ YoutubeAudioDownloader.download(
274
+ "https://www.youtube.com/watch?v=Niuy_GqpU1s",
275
+ "~/Music",
276
+ "necrophagist_seven.mp3"
277
+ )
278
+ ```
@@ -3,6 +3,7 @@ require 'pry'
3
3
  require 'espeak'
4
4
  require 'method_source'
5
5
  require 'colored'
6
+ require 'youtube_audio_downloader'
6
7
 
7
8
  Thread.abort_on_exception = true
8
9
 
@@ -17,10 +18,6 @@ require refinements_file
17
18
  version_file = Gem.find_files("version.rb").shift
18
19
  require version_file
19
20
 
20
- # Also require the youtube downloader
21
- version_file = Gem.find_files("youtube_downloader.rb").shift
22
- require version_file
23
-
24
21
  # Add a little util method to access the refinements from other files.
25
22
  class StepSequencer
26
23
  def self.refinement(name)
@@ -102,7 +102,7 @@ class StepSequencer::REPL
102
102
  end
103
103
 
104
104
  def download(url, outpath, filename)
105
- YoutubeDownloader.download_audio url, outpath, filename
105
+ YoutubeAudioDownloader.download_audio url, outpath, filename
106
106
  end
107
107
 
108
108
  def combine(paths)
@@ -132,7 +132,7 @@ class StepSequencer::REPL
132
132
  def pitch(path, val, speed_correct=true)
133
133
  builder.build(
134
134
  sources: [path], effect: :Pitch,
135
- args: [{times: val, speed_correction: speed_correct}]
135
+ args: [{value: val, speed_correction: speed_correct}]
136
136
  )[0]
137
137
  end
138
138
 
@@ -163,4 +163,4 @@ class StepSequencer::REPL
163
163
 
164
164
  end
165
165
 
166
- end
166
+ end
@@ -1,4 +1,4 @@
1
1
  class StepSequencer
2
- VERSION = '1.1.3'
2
+ VERSION = '1.1.5'
3
3
 
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: step_sequencer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.3
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - max pleaner
@@ -80,6 +80,20 @@ dependencies:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
82
  version: '1.2'
83
+ - !ruby/object:Gem::Dependency
84
+ name: youtube_audio_downloader
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 1.0.1
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 1.0.1
83
97
  description: ''
84
98
  email: maxpleaner@gmail.com
85
99
  executables:
@@ -110,7 +124,6 @@ files:
110
124
  - lib/step_sequencer/tests.rb
111
125
  - lib/step_sequencer/tests/test_cases.rb
112
126
  - lib/version.rb
113
- - lib/youtube_downloader.rb
114
127
  homepage: http://github.com/maxpleaner/step_sequencer
115
128
  licenses:
116
129
  - MIT
@@ -131,7 +144,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
131
144
  version: 2.6.11
132
145
  requirements: []
133
146
  rubyforge_project:
134
- rubygems_version: 2.5.1
147
+ rubygems_version: 2.6.11
135
148
  signing_key:
136
149
  specification_version: 4
137
150
  summary: step sequencer (music tool)
@@ -1,31 +0,0 @@
1
- class YoutubeDownloader
2
-
3
- def self.download_audio(url, outdir, filename)
4
- system <<-SH
5
- cd #{outdir} && \
6
- youtube-dl \
7
- --extract-audio \
8
- --prefer-ffmpeg \
9
- --audio-format mp3 \
10
- --yes-playlist \
11
- --output #{filename} \
12
- --audio-quality 3 \
13
- #{url} \
14
- &>/dev/null
15
- SH
16
- end
17
-
18
- def self.download_playlist(url, outdir, filename)
19
- system <<-SH
20
- cd #{outdir} && \
21
- youtube-dl \
22
- --extract-audio \
23
- --prefer-ffmpeg \
24
- --audio-format mp3 \
25
- --audio-quality 3 \
26
- --output #{filename} \
27
- #{url} \
28
- &>/dev/null
29
- SH
30
- end
31
- end