tetsujin 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 8387e5d1a33b5216b6c4e6582a177021364deca9993d38348fddc920746f72e6
4
- data.tar.gz: 7da91bdede287a154db7540e21f7d9d94725cad16e8bb4d4263b830aa432312d
3
+ metadata.gz: 265c81d8c091b1fa69ebd13794384500a72398e9ad4001d76a3a2bc855e04c2a
4
+ data.tar.gz: f5f080815563e35bf4f2de4cce3aca3a4fea406c336d26bc5859e82ca5acdb68
5
5
  SHA512:
6
- metadata.gz: 0c80e2e2cc875565d6302f95ce9862cbea0578f5a9ce2e865e520bfd1fc13870188d566bf189f11bfbe63de6866a9750a7e96293e44c616026d29384e93d400a
7
- data.tar.gz: '08a835992f845f166e9fb6be0148fa9f72b7a7956ed31e3894f4eb54d5efe898825a5ab87e0c35718d2eab509525af6d32c5ac624225448e08b47d87f417ab32'
6
+ metadata.gz: 3422960fb0606a5d8f0ea7920bd25421ac2f90e987e29692b868651b2d78ebd7c81da9cdb015619f27f6b8f6d09043289d444da6ce86b487aa108b88c89dcb3e
7
+ data.tar.gz: db59e1f76f730c037ad55c763d4aca4055ee6b8d1c1024e466eb5084cc120b7a1d72bb2f5157e1364f021a9061c819f3cc3b33b9d9479b70c18d5beab7b8dda1
data/README.md CHANGED
@@ -6,19 +6,105 @@ Welcome to your new gem! In this directory, you'll find the files you need to be
6
6
 
7
7
  ## Installation
8
8
 
9
- TODO: Replace `UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG` with your gem name right after releasing it to RubyGems.org. Please do not do it earlier due to security reasons. Alternatively, replace this section with instructions to install your gem from git if you don't plan to release to RubyGems.org.
10
-
11
- Install the gem and add to the application's Gemfile by executing:
12
-
13
- $ bundle add UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
14
-
15
- If bundler is not being used to manage dependencies, install the gem by executing:
16
-
17
- $ gem install UPDATE_WITH_YOUR_GEM_NAME_PRIOR_TO_RELEASE_TO_RUBYGEMS_ORG
9
+ ```
10
+ $ gem install tetsujin
11
+ ```
18
12
 
19
13
  ## Usage
20
14
 
21
- TODO: Write usage instructions here
15
+ ### Generate Note
16
+
17
+ ```ruby
18
+ # Can generate C4 sound
19
+ c_note = Tetsujin.note("C", 4)
20
+ c_note = Tetsujin.note("ド", 4)
21
+ ```
22
+
23
+ ### Generate Scale
24
+
25
+ ```ruby
26
+ # Can generate major scales starting from C4
27
+ c_note = Tetsujin.note("C", 4)
28
+ c_major_scale = Tetsujin.scale(c_note, :major)
29
+ c_major_scale = Tetsujin.scale(c_note, "major")
30
+ ```
31
+
32
+ ### Generate Guitar
33
+
34
+ ```ruby
35
+ # Can generate a guitar in regular tuning
36
+ guitar = Tetsujin.regular_tuning_guitar(fretboard_length: 22)
37
+
38
+ # Can generate custom tuned guitars
39
+ tunings = [
40
+ Tetsujin.note("B", 2),
41
+ Tetsujin.note("E", 2),
42
+ Tetsujin.note("A", 2),
43
+ Tetsujin.note("D", 3),
44
+ Tetsujin.note("G", 3),
45
+ Tetsujin.note("B", 3),
46
+ Tetsujin.note("E", 4)
47
+ ]
48
+ guitar = Tetsujin.guitar(tunings: tunings, fretboard_length: 22)
49
+ ```
50
+
51
+ ### Playing notes on the guitar
52
+
53
+ ```ruby
54
+ guitar = Tetsujin.regular_tuning_guitar(fretboard_length: 12)
55
+
56
+ c_note = Tetsujin.note("C", 4)
57
+ d_note = Tetsujin.note("D", 4)
58
+
59
+ guitar.play!([c_note, d_note])
60
+ Tetsujin.display_guitar(guitar)
61
+
62
+ # 1 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
63
+ # 2 : ------- C4 ------- D4 ------- ------- ------- ------- ------- ------- ------- ------- -------
64
+ # 3 : ------- ------- ------- ------- ------- C4 ------- D4 ------- ------- ------- ------- -------
65
+ # 4 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- C4 ------- D4
66
+ # 5 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
67
+ # 6 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
68
+ # : 0 1 2 3 4 5 6 7 8 9 10 11 12
69
+ ```
70
+
71
+ ### Playing scales on the guitar
72
+
73
+ ```ruby
74
+ guitar = Tetsujin.regular_tuning_guitar(fretboard_length: 12)
75
+
76
+ c_note = Tetsujin.note("C", 4)
77
+ c_major_scale = Tetsujin.scale(c_note, :major)
78
+
79
+ guitar.play!(c_major_scale)
80
+ Tetsujin.display_guitar(guitar)
81
+
82
+ # 1 : E4 F4 ------- G4 ------- A4 ------- B4 C5 ------- ------- ------- -------
83
+ # 2 : ------- C4 ------- D4 ------- E4 F4 ------- G4 ------- A4 ------- B4
84
+ # 3 : ------- ------- ------- ------- ------- C4 ------- D4 ------- E4 F4 ------- G4
85
+ # 4 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- C4 ------- D4
86
+ # 5 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
87
+ # 6 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
88
+ # : 0 1 2 3 4 5 6 7 8 9 10 11 12
89
+ ```
90
+
91
+ ### Pressing frets
92
+
93
+ ```ruby
94
+ guitar = Tetsujin.regular_tuning_guitar(fretboard_length: 12)
95
+
96
+ guitar.press!(2, 1)
97
+ guitar.press!(2, 3)
98
+ Tetsujin.display_guitar(guitar)
99
+
100
+ # 1 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
101
+ # 2 : ------- C4 ------- D4 ------- ------- ------- ------- ------- ------- ------- ------- -------
102
+ # 3 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
103
+ # 4 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
104
+ # 5 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
105
+ # 6 : ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- -------
106
+ # : 0 1 2 3 4 5 6 7 8 9 10 11 12
107
+ ```
22
108
 
23
109
  ## Development
24
110
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tetsujin
4
- VERSION = "0.1.0"
4
+ VERSION = "0.2.0"
5
5
  end
data/tetsujin.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/tetsujin/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "tetsujin"
7
+ spec.version = Tetsujin::VERSION
8
+ spec.authors = ["mew3880"]
9
+ spec.email = ["mew3880@gmail.com"]
10
+
11
+ spec.summary = "ギターのスケールを生成するライブラリ"
12
+ # spec.description = "TODO: Write a longer description or delete this line."
13
+ spec.homepage = "https://github.com/Takahashi-Riki/tetsujin"
14
+ spec.license = "MIT"
15
+ spec.required_ruby_version = ">= 2.6.0"
16
+
17
+ # spec.metadata["allowed_push_host"] = "TODO: Set to your gem server 'https://example.com'"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = spec.homepage
21
+ # spec.metadata["changelog_uri"] = "TODO: Put your gem's CHANGELOG.md URL here."
22
+
23
+ # Specify which files should be added to the gem when it is released.
24
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
+ spec.files = Dir.chdir(__dir__) do
26
+ `git ls-files -z`.split("\x0").reject do |f|
27
+ (File.expand_path(f) == __FILE__) ||
28
+ f.start_with?(*%w[bin/ test/ spec/ features/ .git .circleci appveyor Gemfile])
29
+ end
30
+ end
31
+ spec.bindir = "exe"
32
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
33
+ spec.require_paths = ["lib"]
34
+
35
+ # Uncomment to register a new dependency of your gem
36
+ # spec.add_dependency "example-gem", "~> 1.0"
37
+
38
+ # For more information and examples about making a new gem, check out our
39
+ # guide at: https://bundler.io/guides/creating_gem.html
40
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tetsujin
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
  - mew3880
@@ -41,6 +41,7 @@ files:
41
41
  - lib/tetsujin/theory/scale.rb
42
42
  - lib/tetsujin/version.rb
43
43
  - sig/tetsujin.rbs
44
+ - tetsujin.gemspec
44
45
  homepage: https://github.com/Takahashi-Riki/tetsujin
45
46
  licenses:
46
47
  - MIT