ramekin 0.0.8 → 0.0.9

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: 463b021dd0273151c13a7590db845acf584a2df021596dd715721964e777f6d9
4
- data.tar.gz: 432c1eccc9c5443cc63ec828f87a319141caeb3080c847948634b7935553ec86
3
+ metadata.gz: 1454704618e8123c1ade7251f1a30cc66b2f2febacd10e1e8f438e4b3fe3023c
4
+ data.tar.gz: 82453a74e36685f30e7637092fc47d242a63b609c7e4b1f586b17fafae05289f
5
5
  SHA512:
6
- metadata.gz: fbe078d3e43b620748e3bcd91360d06e1bf2b9b804821d21a6479479fe519abb7d48643a8a95f45abfcfe512b2654b1a1f6424773282d294503799e2ee31175b
7
- data.tar.gz: bd829fcd1272ac8279757c73963e407b90ef9257d104475aa07a5c52cf3ed16ce691d25ade84a3333fa2c243854948b92a7fcbfa90b47ee2fedad9c845b54c33
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/).
@@ -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
- system "./AddmusicK -norom ramekin/#{basename}.txt"
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
@@ -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 * 256 / 625.0).round
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
@@ -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/
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ramekin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - jneen