ramekin 0.2.3 → 0.2.4

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: 4d868f9a713e079e67a612eb195411f981e08762404d04d864e3c49ebb436264
4
- data.tar.gz: 1147c0e541694973b8c5e50c953822cce616abdcffba5a00e9a379e21bc65920
3
+ metadata.gz: a249d3680d6f96fe57c566445a3add42d0287de30bd86a556131963b58b239b8
4
+ data.tar.gz: df8ab404da547bd42b68fee9ef45d3eeed5c1c46201c997dea2a04cb65a8e0aa
5
5
  SHA512:
6
- metadata.gz: b5f887113d039e9f9e496062b96c2905a1b877dd9199daf2db87a8e5b2072b3db74736ab496fbc92680f40bb8567ba875a6b0fb4e8934d9e674bc3734dc35f10
7
- data.tar.gz: 76a5c121c7e2755fa09ef578fe8d9a002b3357c0fcdb3af5cf7241fbad7d59b153b6a111201caa4467c4a18e83d87c3c273d1a41467d219eec7a030ce0dc370b
6
+ metadata.gz: 3001f9832d107a892137de8e811c842d972ad226de761e2cd033b79845d455988de28e328c55d14c78215c61a6adb5d11b3819ca35682e66a3c3b9bb0593961c
7
+ data.tar.gz: b52c6b301948c3400d7c0c7db3cdc4f3da93e1827a352cd927d5fa8c7bf06d06aee67e70b21392002262fee92ede83cef2cbdd69dbf4c11d84ecb55af5e890f1
@@ -48,6 +48,10 @@ module Ramekin
48
48
  ln("#@amk_path/samples/default", "#@workdir/samples/default")
49
49
  ln("#@amk_path/samples/optimized", "#@workdir/samples/optimized")
50
50
  ln("#@amk_path/samples/EMPTY.brr", "#@workdir/samples/EMPTY.brr")
51
+ if File.exist?("#@amk_path/samples/SPECIALWAVE.brr")
52
+ ln("#@amk_path/samples/SPECIALWAVE.brr", "#@workdir/samples/SPECIALWAVE.brr")
53
+ end
54
+
51
55
  if @meta.instruments.any?
52
56
  sample_dir = "#@workdir/samples/#{@meta.sample_path || basename}"
53
57
  FileUtils.mkdir_p(sample_dir)
data/lib/ramekin/bends.rb CHANGED
@@ -32,11 +32,11 @@ module Ramekin
32
32
  end
33
33
 
34
34
  def tie?
35
- false
35
+ @notes.first.tie?
36
36
  end
37
37
 
38
38
  def ending_octave
39
- @notes.first.octave
39
+ @notes.last.octave
40
40
  end
41
41
 
42
42
  # in the event of a tie-free bend exactly at a note out where we *also*
@@ -74,7 +74,7 @@ module Ramekin
74
74
  out << from.octave_amk(oct)
75
75
  out << from.note_name
76
76
  out << "=#{bend_duration}"
77
- out << dd(bend_duration, to)
77
+ out << dd(bend_duration, to, from.octave_num)
78
78
  out << "$f4$01^=#{leftover}"
79
79
 
80
80
  out.string
@@ -119,6 +119,7 @@ module Ramekin
119
119
 
120
120
  if i == 0
121
121
  out << note.octave_amk(octave)
122
+ octave = note.octave_num
122
123
  out << note.note_name
123
124
  else
124
125
  out << '^'
@@ -129,7 +130,7 @@ module Ramekin
129
130
  # always use tick count notation here because
130
131
  # amk can insert ties in some cases which will break $dd
131
132
  out << "=#{ticks}"
132
- out << dd(ticks, to_note)
133
+ out << dd(ticks, to_note, octave)
133
134
  out << '$f4$01' if @end_legato && i == 0
134
135
  end
135
136
 
@@ -137,15 +138,9 @@ module Ramekin
137
138
  out.string
138
139
  end
139
140
 
140
- def dd(dur, note)
141
- hex = note.note_hex
142
-
143
- unless 0x80 <= hex && hex <= 0xC5
144
- error! 'note out of range (o1c - o6a)', el: note
145
- return ''
146
- end
147
-
148
- sprintf '$dd$00$%02x$%02x', dur, note.note_hex
141
+ def dd(dur, note, current_octave)
142
+ oct = note.octave_switching_amk(current_octave)
143
+ sprintf '$dd$00$%02x%s%s', dur, oct, note.note_name
149
144
  end
150
145
  end
151
146
 
data/lib/ramekin/meta.rb CHANGED
@@ -288,7 +288,7 @@ module Ramekin
288
288
  end
289
289
 
290
290
  def tuning
291
- @tuning ||= ext_tuning || pack_tuning || [0, 0]
291
+ @tuning ||= ext_tuning || pack_tuning || [4, 0]
292
292
  end
293
293
 
294
294
  def pack_tuning
@@ -107,6 +107,14 @@ module Ramekin
107
107
  end
108
108
  end
109
109
 
110
+ def octave_switching_amk(current_octave)
111
+ diff = octave_num - current_octave
112
+
113
+ return '' if diff == 0
114
+ return '<' * (-diff) if diff < 0
115
+ return '>' * diff if diff > 0
116
+ end
117
+
110
118
  def to_amk(current_octave=nil, divisor=1)
111
119
  return "#{octave_amk(current_octave)}#{note_name}#{length_amk(divisor)}"
112
120
  end
@@ -58,7 +58,7 @@ module Ramekin
58
58
  yield "; https://codeberg.org/jneen/ramekin\n\n"
59
59
 
60
60
  # TODO
61
- yield "#amk #{@track.meta.amk&.value || 2}\n\n"
61
+ yield "#amk #{@track.meta.amk&.value || 4}\n\n"
62
62
 
63
63
  if m.instruments.any?
64
64
  yield "#path #{(m.sample_path || @filename.chomp('.rmk')).inspect}\n"
@@ -130,7 +130,7 @@ module Ramekin
130
130
 
131
131
  yield el.to_amk(@octave, @track.meta.divisor)
132
132
 
133
- @octave = el.ending_octave
133
+ @octave = el.ending_octave unless el.tie?
134
134
  when NoteEvent
135
135
  old_tick = @tick
136
136
  @tick += el.ticks
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.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - jneen