shlisp_tools 0.0.2 → 0.0.3
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.
- data/README.md +41 -20
- data/Rakefile +16 -0
- data/lib/shlisp_tools/version.rb +1 -1
- metadata +2 -2
data/README.md
CHANGED
@@ -1,20 +1,29 @@
|
|
1
|
-
# ShlispTools
|
1
|
+
# Shlerb and ShlispTools
|
2
2
|
|
3
3
|
[](http://badge.fury.io/rb/shlisp_tools)
|
4
4
|
|
5
|
-
Tools for
|
5
|
+
Tools for Shlisp/Shnth developers. If you don't recognize both words starting with "Sh", this is probably not for you.
|
6
|
+
|
7
|
+
Online documentation:
|
8
|
+
|
9
|
+
- http://daveseidel.github.io/ShlispTools
|
6
10
|
|
7
11
|
Executables:
|
8
|
-
|
9
|
-
|
12
|
+
|
13
|
+
- shlerb (a templating and uploading tool for txts; an ERB wrapper for shlisp)
|
14
|
+
- shtool (a collection of little calculations)
|
10
15
|
|
11
16
|
Classes/Modules:
|
12
|
-
* ShlispTools::Ratio # represents a pitch ratio
|
13
|
-
* ShlispTools::Scales # represents a scale (consisting of Ratios)
|
14
|
-
* ShlispTools::Scales # tiny collection of predefined scales
|
15
|
-
* ShlispTools::Shnth # useful constants and macros for Shnth things
|
16
17
|
|
17
|
-
|
18
|
+
- ShlispTools::Ratio : represents a pitch ratio
|
19
|
+
- ShlispTools::Scales : represents a scale (consisting of Ratios)
|
20
|
+
- ShlispTools::Scales : tiny collection of predefined scales
|
21
|
+
- ShlispTools::Shnth : useful constants and macros for Shnth things
|
22
|
+
|
23
|
+
Shlerb code examples:
|
24
|
+
|
25
|
+
- in the examples directory
|
26
|
+
- online: https://github.com/DaveSeidel/ShlispTools/tree/master/examples
|
18
27
|
|
19
28
|
Shlisp & Shnth come from Sbobo - http://shbobo.net
|
20
29
|
|
@@ -32,17 +41,19 @@ Or install it yourself as:
|
|
32
41
|
|
33
42
|
$ gem install shlisp_tools
|
34
43
|
|
35
|
-
##
|
44
|
+
## Shlerb
|
45
|
+
|
46
|
+
Shlerb is a command-line program that generates Shlisp code from a template file and uploads it to a Shnth, assuming that you have one attached to your computer, and that you have the "shlisp" program (from http://shbobo.net) on your path. If there are errors translating the file, the error is displayed and nothing is uploaded.
|
36
47
|
|
37
|
-
Shlerb
|
48
|
+
Shlerb template files are just shlisp source files ("txts") with optional sections of Ruby code that start with "<%" or "<%=" and end with "%>". Sections that start with "<%" are simply evaluated as Ruby code and are used to set variables or constants or do some other processing. Section that begin with "<%=" are also evaulated as Ruby code, but the output is printed and is thus useful for generating shlisp code.
|
38
49
|
|
39
|
-
|
50
|
+
### Usage
|
40
51
|
|
41
|
-
|
52
|
+
<tt>shlerb FILENAME</tt>
|
42
53
|
|
43
|
-
|
54
|
+
where FILENAME is something like +cool_shnth_patches.txt.erb+ or +cool_shnth_patches.shlerb+. The contents of the file should be shlisp code with optional ERB sections containing Ruby code. (For more information on ERB, see https://en.wikipedia.org/wiki/ERuby). The Ruby code has access to the modules and classes mentioned above.
|
44
55
|
|
45
|
-
|
56
|
+
### Examples
|
46
57
|
|
47
58
|
Here's an example of a shlerb file with a single situation. It plays a six-note meta-slendro scale on the keys in the order majora, majorb, majorc, majord, minord, minorc. The tones fade in slowly and will tend to (intentionally) distort as they reach full amplitude. The scale used is part of the collection of pre-defined scales that come with ShlispTools.
|
48
59
|
|
@@ -51,7 +62,7 @@ Here's an example of a shlerb file with a single situation. It plays a six-note
|
|
51
62
|
Slew_add = 5
|
52
63
|
Modo_mul = 2
|
53
64
|
%>
|
54
|
-
<% s1 = Scales::MetaSlendro_1.
|
65
|
+
<% s1 = Scales::MetaSlendro_1.mul(120) %>
|
55
66
|
{
|
56
67
|
<%= Shnth::Situation_1 %>
|
57
68
|
|
@@ -97,7 +108,7 @@ You can also define your own scales and add a scaling factor to bring them into
|
|
97
108
|
R::Ratio.new(49, 32),
|
98
109
|
R::Ratio.new( 7, 4),
|
99
110
|
R::Ratio.new( 2, 1)
|
100
|
-
]).
|
111
|
+
]).mul(100)
|
101
112
|
|
102
113
|
# get nume and deno for a given scale degree, using indexes 0 through 5 for a six-note scale
|
103
114
|
# 1/1:
|
@@ -112,15 +123,25 @@ You can also define your own scales and add a scaling factor to bring them into
|
|
112
123
|
|
113
124
|
%>
|
114
125
|
|
126
|
+
## Shtool
|
127
|
+
|
128
|
+
Shtool is a command-line program that collects together a few useful calculations.
|
129
|
+
|
130
|
+
### Usage
|
131
|
+
|
132
|
+
<tt>shtool [[OPERATION] args ...]</tt>
|
133
|
+
|
134
|
+
Use <tt>shtool help</tt> for a list of the current set of operations and what they do. For help with any operation, use <tt>shtool OPERATION_NAME</tt> to see what arguments ar expected.
|
135
|
+
|
115
136
|
## Caveats
|
116
137
|
|
117
138
|
* Ratio, Scale, and the Scales collection all assume "arab" mode.
|
118
139
|
|
119
140
|
## TODO
|
120
141
|
|
121
|
-
|
122
|
-
|
123
|
-
|
142
|
+
- write tests
|
143
|
+
- write more complete documentation
|
144
|
+
- allow Ratio and Scale classes to work in "dirac" mode as well as "arab" mode
|
124
145
|
|
125
146
|
## Contributing
|
126
147
|
|
data/Rakefile
CHANGED
@@ -1,5 +1,21 @@
|
|
1
1
|
require "bundler/gem_tasks"
|
2
2
|
require "rspec/core/rake_task"
|
3
|
+
require "rdoc/task"
|
4
|
+
|
5
|
+
BASE_RDOC_OPTIONS = [
|
6
|
+
'--line-numbers', '--show-hash',
|
7
|
+
'--main', 'README.md',
|
8
|
+
'--title', 'Shlerb and ShlispTools'
|
9
|
+
]
|
10
|
+
|
11
|
+
RDoc::Task.new do |rdoc|
|
12
|
+
rdoc.rdoc_dir = 'html'
|
13
|
+
rdoc.title = "Shlerb and ShlispTools"
|
14
|
+
rdoc.options = BASE_RDOC_OPTIONS.dup
|
15
|
+
rdoc.rdoc_files.include("README.md", "LICENSE.txt")
|
16
|
+
rdoc.rdoc_files.include("lib/**/*.rb")
|
17
|
+
rdoc.rdoc_files.include("examples/**/*.txt.erb")
|
18
|
+
end
|
3
19
|
|
4
20
|
RSpec::Core::RakeTask.new
|
5
21
|
|
data/lib/shlisp_tools/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shlisp_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-12-
|
12
|
+
date: 2013-12-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|