ramekin 0.0.11 → 0.1.2
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 +4 -4
- data/README.md +90 -17
- data/gembin/ramekin +5 -0
- data/lib/ramekin/cli.rb +9 -7
- data/lib/ramekin/legato.rb +1 -1
- data/lib/ramekin/loop_allocator.rb +1 -1
- data/lib/ramekin/meta.rb +0 -2
- data/lib/ramekin/renderer.rb +2 -0
- data/lib/ramekin/sample_pack.rb +1 -0
- data/lib/ramekin/tokenizer.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f693295d87c86072d5d220f3a9cfed4b8a19aa5ae1bcfc468c4554eb89063945
|
4
|
+
data.tar.gz: 5d4890321e9f3d49ce4487e0539babe104bb03a1719ecf641040d22eadc7ba2a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 530beedb41422b51818f44445802ff95ba1b23c73f43e24b1d44c563bbe4479c46ac55c3a6c26ee722e1dd4e555ef61bd66f501380853085cd766734117b919b
|
7
|
+
data.tar.gz: 45a1589c63119cef6fc062feff81afe66445356974260953bbb8adb79a25e570329afecaf695b6b4781bbce9b067b25d4d85c5c7d9fc257262a44e4d9c77c86b
|
data/README.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
<style>
|
2
|
+
img { float: right; }
|
3
|
+
</style>
|
4
|
+
|
5
|
+

|
6
|
+
|
1
7
|
# Ramekin
|
2
8
|
|
3
9
|
Ramekin is a pre-processor for AddMusicK syntax that is in very early development.
|
@@ -47,25 +53,26 @@ ramekin compile -i filename.rmk [flags]
|
|
47
53
|
output amk txt to this file.
|
48
54
|
use a single dash (-) to print txt to stdout.
|
49
55
|
--spc filename.spc
|
50
|
-
attempt to invoke AddmusicK to output an SPC
|
51
|
-
requires ADDMUSICK_DIR and ASAR_COMMAND
|
52
|
-
to be set.
|
56
|
+
attempt to invoke AddmusicK to output an SPC.
|
53
57
|
--play
|
54
58
|
play the generated SPC file. will automatically
|
55
59
|
set up an SPC player if none is detected.
|
60
|
+
--package my-cool-folder/
|
61
|
+
create a package directory suitable for submission
|
62
|
+
to SMWC, complete with README and packaged samples.
|
56
63
|
--wav filename.wav
|
57
64
|
--wav filename.wav:N
|
58
65
|
(non-windows only)
|
59
66
|
render N seconds of the file to WAV.
|
60
67
|
|
61
|
-
ramekin
|
68
|
+
ramekin pack [flags]
|
62
69
|
flags:
|
63
70
|
--update
|
64
|
-
download BRR
|
71
|
+
download BRR packs from SMW Central.
|
65
72
|
--search [text]
|
66
73
|
search for BRR filenames.
|
67
74
|
--list [text]
|
68
|
-
list all samples in
|
75
|
+
list all samples in packs matching [text].
|
69
76
|
|
70
77
|
ramekin setup [flags]
|
71
78
|
flags:
|
@@ -93,6 +100,7 @@ A list of some ramekin preprocessor features (see `spec/rmk` for some examples!)
|
|
93
100
|
|
94
101
|
* The metadata section (before any channels) is fairly different, I recommend reading the metadata part of the guide below.
|
95
102
|
* Macros ("replacements") are implemented in a much more robust way (*with* tokenization), and can no longer interrupt other tokens. The generated txt will not contain any replacements.
|
103
|
+
* Loops can be given arbitrary names using any combination of letters, numbers, underscores, or dashes. `(my-cool-loop)[ ... ]` is valid syntax. These are case sensitive, and are assigned numbers when compiled to AddmusicK syntax.
|
96
104
|
* Adopted the transposition syntax `_+N`, `_-N`, and `_0` from General MML. Compiles to `$fa$02$XX`.
|
97
105
|
* `#adsr:A,D,S,RR` syntax for ADSR. Also usable on an `#instrument` declaration, with the same syntax. A, D, and R are flipped so that higher numbers are longer times.
|
98
106
|
* `v+X` and `v-X` are volumes relative to the last `vXXX` command. Useful for separating expression from mixing.
|
@@ -119,7 +127,7 @@ b8 #bend >>c16^16 ^^4
|
|
119
127
|
|
120
128
|
* In ramekin, there is no difference between instrument `#adsr` syntax and the one in the pattern data. They are both compiled to their respective syntaxes in the txt.
|
121
129
|
|
122
|
-
* Tempo can alternately be declared with `#bpm:128`. This will be converted to the nearest `tXX` command.
|
130
|
+
* Tempo can alternately be declared with `#bpm:128`. This will be converted to the nearest `tXX` command. If the tempo is over `t60` (`#bpm:146`), the tempo and all note and event lengths will be halved automatically. This is similar to `#halvetempo` except that it is done automatically.
|
123
131
|
* `p0,0` compiles to `$df`.
|
124
132
|
* "Legato tie" represented by `~`, which will use `$f4$01` at appropriate times to cause the note transition to be played legato.
|
125
133
|
* If you ever want to see what exactly Ramekin is generating, just use `--txt` and you can inspect the generated AddmusicK syntax manually!
|
@@ -163,9 +171,6 @@ w150
|
|
163
171
|
|
164
172
|
; sets the bpm. (todo: mention the reasonable range for this)
|
165
173
|
#bpm:130
|
166
|
-
|
167
|
-
; echo settings. this syntax is likely to change in the future, because it sucks
|
168
|
-
#echo $ef$ff$df$df $f1$02$cf$01
|
169
174
|
```
|
170
175
|
|
171
176
|
### Instrument definitions
|
@@ -217,16 +222,20 @@ It is generally advised to stick with the default tuning. The `o5` declaration s
|
|
217
222
|
Echo settings can be set up with the `#echo/...` family of directives:
|
218
223
|
|
219
224
|
```elisp
|
225
|
+
; select which channels have echo enabled
|
220
226
|
#echo/channels:0,1,2,3
|
221
227
|
; or
|
222
228
|
#echo/channels:all
|
223
229
|
; or
|
224
230
|
#echo/channels:none
|
225
231
|
|
226
|
-
#echo/volume:20 ; range from -
|
232
|
+
#echo/volume:20 ; range from -80 to 7f, use negatives for surround
|
227
233
|
#echo/volume:20,30 ; set different values for left vs right echo
|
228
|
-
#echo/feedback:48 ; range from -
|
234
|
+
#echo/feedback:48 ; range from -80 to 7f, use negatives for surround
|
229
235
|
#echo/fir:1 ; 1 or 0 to enable/disable the FIR filter
|
236
|
+
|
237
|
+
; later, you can use this to toggle the echo on a channel.
|
238
|
+
#echo/toggle
|
230
239
|
```
|
231
240
|
|
232
241
|
|
@@ -296,7 +305,7 @@ Personally, I tend to use `l16` across the whole track for consistency.
|
|
296
305
|
|
297
306
|
Just as in Addmusick, there are two kinds of loops:
|
298
307
|
|
299
|
-
* Regular loops, marked with `[ ]`, which can optionally be tagged with a
|
308
|
+
* Regular loops, marked with `[ ]`, which can optionally be tagged with a name, as in `(my-cool-loop)[ ]`. These can not only loop immediately but also be called at arbitrary points.
|
300
309
|
* Super loops, marked with `[[ ]]`, which can only loop immediately, but can nest either inside or outside of regular loops.
|
301
310
|
|
302
311
|
This is best shown with an example:
|
@@ -306,11 +315,75 @@ This is best shown with an example:
|
|
306
315
|
[ defg ]4 ; plays defg four times (regular loop)
|
307
316
|
[[ abcd ]]4 ; plays abcd four times (superloop)
|
308
317
|
* ; calls the last defined regular loop, in this case plays defg
|
309
|
-
|
310
|
-
(
|
311
|
-
(
|
318
|
+
*3 ; same thing but 3 times
|
319
|
+
(blungus)[ fedc ] ; defines a loop named (blungus), also plays fedc immediately
|
320
|
+
(blungus) ; calls the loop (blungus)
|
321
|
+
(blungus)2 ; calls the loop (blungus) twice
|
312
322
|
```
|
313
323
|
|
314
324
|
### Expression and effects
|
315
325
|
|
316
|
-
Volume
|
326
|
+
#### Volume Expression
|
327
|
+
|
328
|
+
Volume can be set with `vXXX`, where `XXX` is a number between 0 and 255. This command also sets the current "reference volume", which can be referenced with commands `v+XX` and `v-XX`, where XX is a number to be added or subtracted to the reference volume. This way, you can add dynamics to your drums or melody lines, while also easily being able to change the overall volume of the section.
|
329
|
+
|
330
|
+
#### Pitch Expression
|
331
|
+
|
332
|
+
Pitch expression can be accomplished in two ways:
|
333
|
+
|
334
|
+
* `pA,B,C`, where A,B, and C are numbers, can be used to set vibrato - a slight pitch wiggle that starts sometime after a note is started. `A` specifies the delay - how long to wait before wiggling the pitch, `B` specifies the speed - how fast to wiggle the pitch, and `C` specifies the amplitude - how much to wiggle the pitch. Turn off vibrato with `p0,0`.
|
335
|
+
* Manual pitch bends are fairly straightforward in ramekin, using `#bend` and `^^`:
|
336
|
+
|
337
|
+
```elisp
|
338
|
+
; b plays for an 8th note, then bends up to c for an eighth note,
|
339
|
+
; then continues on c for a quarter note.
|
340
|
+
b8 #bend >c8 ^^ c4
|
341
|
+
```
|
342
|
+
|
343
|
+
#### Panning Expression
|
344
|
+
|
345
|
+
Panning can be specified with the command `yLX` or `yRX`, where X is a number from 1-10. To reset panning to the center, use `yC`:
|
346
|
+
|
347
|
+
```elisp
|
348
|
+
yR10 ; maximum pan right
|
349
|
+
yR2 ; tasteful pan right
|
350
|
+
yC ; pan center
|
351
|
+
yL2 ; tasteful pan left
|
352
|
+
yl10 ; maximum pan left
|
353
|
+
```
|
354
|
+
|
355
|
+
## Hex
|
356
|
+
|
357
|
+
For those who want to use AddmusicK features that are not currently supported by Ramekin, Ramekin still supports manual entry of hex values with `$XX`. While these can be made slightly easier to use with macros, I would very much appreciate it if you could open an issue here or contact me via SMWC or Discord if you find you are using these heavily.
|
358
|
+
|
359
|
+
## Macros
|
360
|
+
|
361
|
+
To make your life easier, Ramekin implements a very similar macro ("replacement") system as AddmusicK - allowing you to define all manner of custom shortcuts for maximum efficiency and tweakability. (Note that Ramekin's implementation of macros is far more robust than AddmusicK's, and will not interrupt other tokens - e.g. a macro called `F` will not be applied to something like `$EF`).
|
362
|
+
|
363
|
+
A macro looks like this:
|
364
|
+
|
365
|
+
```elisp
|
366
|
+
"MY_COOL_MACRO=@smwacousticbass o3 v150"
|
367
|
+
```
|
368
|
+
|
369
|
+
Now whenever you type `MY_COOL_MACRO` in a channel, it will be as if you typed `@smwacousticbass o3 v150`. This can be used to define all sorts of helpers, including some dynamics helpers:
|
370
|
+
|
371
|
+
```elisp
|
372
|
+
"F=v+0" ; forte
|
373
|
+
"M=v-20" ; mezzo
|
374
|
+
"P=v-40" ; piano
|
375
|
+
```
|
376
|
+
|
377
|
+
Or drum instrument helpers:
|
378
|
+
|
379
|
+
```elisp
|
380
|
+
"K=@smwkick o4"
|
381
|
+
"S=@smwsnare o4"
|
382
|
+
"H=@smwshaker o4"
|
383
|
+
```
|
384
|
+
|
385
|
+
Or anything else you might find helpful.
|
386
|
+
|
387
|
+
# Thank you for trying out Ramekin!
|
388
|
+
|
389
|
+
If you find any bugs, please report them in the issue tracker here on Codeberg. If you have questions, design ideas, or complaints, or just want to chat, please feel free to ask anything in [my discord](https://jneen.ca/discord). Cheers!
|
data/gembin/ramekin
CHANGED
@@ -10,6 +10,11 @@ RAMEKIN_ASAR_DIR = './asar'
|
|
10
10
|
RAMEKIN_SPC_PLAYER = '__auto__'
|
11
11
|
RAMEKIN_VERSION = Gem.loaded_specs['ramekin'].version.to_s
|
12
12
|
|
13
|
+
if ENV['RAMEKIN_DEBUG'] == '1'
|
14
|
+
require 'pry'
|
15
|
+
require 'pry-stack_explorer'
|
16
|
+
end
|
17
|
+
|
13
18
|
require_relative '../lib/ramekin'
|
14
19
|
require_relative '../lib/ramekin/cli'
|
15
20
|
|
data/lib/ramekin/cli.rb
CHANGED
@@ -32,9 +32,7 @@ module Ramekin
|
|
32
32
|
$stderr.puts " output amk txt to this file."
|
33
33
|
$stderr.puts " use a single dash (-) to print txt to stdout."
|
34
34
|
$stderr.puts " --spc filename.spc"
|
35
|
-
$stderr.puts " attempt to invoke AddmusicK to output an SPC"
|
36
|
-
$stderr.puts " requires ADDMUSICK_DIR and ASAR_COMMAND"
|
37
|
-
$stderr.puts " to be set."
|
35
|
+
$stderr.puts " attempt to invoke AddmusicK to output an SPC."
|
38
36
|
$stderr.puts " --play"
|
39
37
|
$stderr.puts " play the generated SPC file. will automatically"
|
40
38
|
$stderr.puts " set up an SPC player if none is detected."
|
@@ -44,6 +42,9 @@ module Ramekin
|
|
44
42
|
'(compiles and installs spct - requires git,cmake,make)'
|
45
43
|
end
|
46
44
|
$stderr.puts " #{default_text}"
|
45
|
+
$stderr.puts " --package my-cool-folder/"
|
46
|
+
$stderr.puts " create a package directory suitable for submission"
|
47
|
+
$stderr.puts " to SMWC, complete with README and packaged samples."
|
47
48
|
unless Ramekin.config.windows?
|
48
49
|
$stderr.puts " --wav filename.wav"
|
49
50
|
$stderr.puts " --wav filename.wav:N"
|
@@ -51,13 +52,14 @@ module Ramekin
|
|
51
52
|
end
|
52
53
|
$stderr.puts ""
|
53
54
|
$stderr.puts "ramekin package [flags]"
|
55
|
+
$stderr.puts "ramekin pack [flags]"
|
54
56
|
$stderr.puts " flags:"
|
55
57
|
$stderr.puts " --update"
|
56
|
-
$stderr.puts " download BRR
|
58
|
+
$stderr.puts " download BRR packs from SMW Central."
|
57
59
|
$stderr.puts " --search [text]"
|
58
60
|
$stderr.puts " search for BRR filenames."
|
59
61
|
$stderr.puts " --list [text]"
|
60
|
-
$stderr.puts " list all samples in
|
62
|
+
$stderr.puts " list all samples in packs matching [text]."
|
61
63
|
$stderr.puts ""
|
62
64
|
$stderr.puts "ramekin setup [flags]"
|
63
65
|
$stderr.puts " flags:"
|
@@ -162,6 +164,7 @@ module Ramekin
|
|
162
164
|
outer_chain = Processor.compose(
|
163
165
|
MacroExpander,
|
164
166
|
ScanForL,
|
167
|
+
LoopAllocator,
|
165
168
|
)
|
166
169
|
|
167
170
|
expanded = outer_chain.call(tokens)
|
@@ -172,7 +175,6 @@ module Ramekin
|
|
172
175
|
NoteAggregator,
|
173
176
|
RestAggregator,
|
174
177
|
Legato,
|
175
|
-
LoopAllocator,
|
176
178
|
Inspector,
|
177
179
|
)
|
178
180
|
|
@@ -364,7 +366,7 @@ module Ramekin
|
|
364
366
|
case argv[0]
|
365
367
|
when 'compile'
|
366
368
|
compile(*argv[1..])
|
367
|
-
when 'package'
|
369
|
+
when 'package', 'pack'
|
368
370
|
package(*argv[1..])
|
369
371
|
when 'setup'
|
370
372
|
setup(*argv[1..])
|
data/lib/ramekin/legato.rb
CHANGED
data/lib/ramekin/meta.rb
CHANGED
@@ -118,8 +118,6 @@ module Ramekin
|
|
118
118
|
@instruments << Instrument.new(@current_pack, @current_directive, name, path, extensions)
|
119
119
|
when 'default', 'optimized' then @sample_groups << @current
|
120
120
|
|
121
|
-
# TODO: real echo syntax
|
122
|
-
when 'echo' then @echo = expect_args(*([:hex] * 8))
|
123
121
|
when 'echo/channels'
|
124
122
|
channels = @current_directive.values[1]
|
125
123
|
case channels
|
data/lib/ramekin/renderer.rb
CHANGED
data/lib/ramekin/sample_pack.rb
CHANGED
data/lib/ramekin/tokenizer.rb
CHANGED
@@ -258,7 +258,7 @@ module Ramekin
|
|
258
258
|
return [:l, m(1)] if match /l(\d+)/
|
259
259
|
return [:amp] if match /[&]/
|
260
260
|
return [:q, m(1)] if match /q(\d(?:,\h)?)/
|
261
|
-
return [:n, m(1)] if match /n(\h\h
|
261
|
+
return [:n, m(1)] if match /n(\h\h)/
|
262
262
|
|
263
263
|
error! "unknown token near: #{@scanner.peek(10)}", el: @last_token
|
264
264
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ramekin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jneen
|
8
8
|
autorequire:
|
9
9
|
bindir: gembin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-02
|
11
|
+
date: 2025-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: strscan
|