ramekin 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/ramekin/amk_runner.rb +6 -1
- data/lib/ramekin/cli.rb +1 -1
- data/lib/ramekin/renderer.rb +3 -1
- data/lib/ramekin/tokenizer.rb +1 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1454704618e8123c1ade7251f1a30cc66b2f2febacd10e1e8f438e4b3fe3023c
|
4
|
+
data.tar.gz: 82453a74e36685f30e7637092fc47d242a63b609c7e4b1f586b17fafae05289f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f33e028002e58ad86ae808bcc4a0a77b9c8b324e3a47f652bf20dcf1bc4a83381f13e23e3ec980f5350cad8686f13097f1996e08c3de798614e4092ca55a8cbf
|
7
|
+
data.tar.gz: 4df89465d887a660c7353a6e4b16e3817603efd861c60315c39ca531026af27b5a72bf0a7b32aa73328f9b0160f3f7f5aa868a2de9fbe6bf493bb4f1cc345aff
|
data/README.md
CHANGED
@@ -2,6 +2,8 @@
|
|
2
2
|
|
3
3
|
Ramekin is a pre-processor for AddMusicK syntax that is in very early development.
|
4
4
|
|
5
|
+
Please keep in mind that as alpha software, **I may make breaking changes at any time.** After initial testing is done, I will release 1.0.0, at which point I will make a reasonable commitment to back-compatibility. That time is not yet.
|
6
|
+
|
5
7
|
# Installation
|
6
8
|
|
7
9
|
First, [Install Ruby](https://ruby-lang.org). Windows users can use [RubyInstaller](https://rubyinstaller.org/).
|
data/lib/ramekin/amk_runner.rb
CHANGED
@@ -3,6 +3,8 @@ require_relative 'amk_runner/sample_groups'
|
|
3
3
|
|
4
4
|
module Ramekin
|
5
5
|
class AMKRunner
|
6
|
+
include Util
|
7
|
+
|
6
8
|
def initialize(filename, meta, txt)
|
7
9
|
@filename = File.expand_path(filename)
|
8
10
|
@amk_path = Ramekin.config.amk_dir
|
@@ -40,6 +42,8 @@ module Ramekin
|
|
40
42
|
|
41
43
|
ln("#@amk_path/asm", "#@workdir/asm")
|
42
44
|
|
45
|
+
FileUtils.mkdir_p("#@workdir/Visualizations")
|
46
|
+
|
43
47
|
FileUtils.mkdir_p("#@workdir/samples")
|
44
48
|
ln("#@amk_path/samples/default", "#@workdir/samples/default")
|
45
49
|
ln("#@amk_path/samples/optimized", "#@workdir/samples/optimized")
|
@@ -62,7 +66,7 @@ module Ramekin
|
|
62
66
|
File.write("#@workdir/Addmusic_sound effects.txt", '')
|
63
67
|
|
64
68
|
Dir.chdir(@workdir) do
|
65
|
-
|
69
|
+
sys './AddmusicK', '-norom', '-visualize', "ramekin/#{basename}.txt"
|
66
70
|
res = $?
|
67
71
|
binding.pry unless res.success?
|
68
72
|
end
|
@@ -73,6 +77,7 @@ module Ramekin
|
|
73
77
|
FileUtils.cp(@filename, "./#{basename}.rmk")
|
74
78
|
FileUtils.cp(spc_file, "./#{basename}.spc")
|
75
79
|
FileUtils.cp(stats_file, "./#{basename}.stats.txt")
|
80
|
+
FileUtils.cp("#@workdir/Visualizations/#{basename}.png", "./#{basename}.png")
|
76
81
|
File.write("./#{basename}.txt", @txt)
|
77
82
|
|
78
83
|
FileUtils.mkdir_p("samples/#{basename}")
|
data/lib/ramekin/cli.rb
CHANGED
@@ -139,7 +139,7 @@ module Ramekin
|
|
139
139
|
# have a path to render the SPC file to.
|
140
140
|
if @play || @wav_file
|
141
141
|
if @output_package
|
142
|
-
@play_spc = "#@output_package/#{File.basename(@infile)}.spc"
|
142
|
+
@play_spc = "#@output_package/#{File.basename(@infile, '.rmk')}.spc"
|
143
143
|
elsif @output_spc
|
144
144
|
@play_spc = @output_spc
|
145
145
|
else
|
data/lib/ramekin/renderer.rb
CHANGED
@@ -113,7 +113,7 @@ module Ramekin
|
|
113
113
|
def tempo_of(el)
|
114
114
|
case el.type
|
115
115
|
when :t then el.value
|
116
|
-
when :bpm then (el.value.to_i *
|
116
|
+
when :bpm then (el.value.to_i * 8192 / 20025.0).round
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
@@ -193,6 +193,8 @@ module Ramekin
|
|
193
193
|
when :relv
|
194
194
|
relvol, duration = token.values
|
195
195
|
yield velocity_command(@volume + relvol.to_i, duration)
|
196
|
+
when :q
|
197
|
+
yield "q#{token.value}"
|
196
198
|
when :adsr
|
197
199
|
vals = token.value.split(',').map { |x| x.to_i(16) }
|
198
200
|
error! 'invalid #adsr, expected 4 arguments' unless vals.size == 4
|
data/lib/ramekin/tokenizer.rb
CHANGED
@@ -228,6 +228,7 @@ module Ramekin
|
|
228
228
|
return [:instrument, m(1)] if match /@(\w+)/
|
229
229
|
return [:hex, m(1)] if match /[$](\h\h)/
|
230
230
|
return [:t, m(1)] if match /t(\d+)/
|
231
|
+
return [:q, m(1)] if match /q(\d\h?)/
|
231
232
|
|
232
233
|
return note(:note, m) if match /[abcdefg][+-]?/
|
233
234
|
return note(:r) if match /r/
|