smml 0.1.8.2 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 21c1875b3d3c6af5a1ab009c3061b3b414fc38a7
4
- data.tar.gz: 81e2af2f63f365d8e8023cce052b5568055a6eb2
3
+ metadata.gz: 85649d364edc63918512902fb5a190e1a9ae3bcc
4
+ data.tar.gz: 0abe67520e10480fe4dee9fd115b7f33ec1805e9
5
5
  SHA512:
6
- metadata.gz: 05da008c658c956c680682349dc51ea61e82947d20d9f5ba9dff6e6c332adef2829ce81e27392bdd00be622e8bda06c7f16ceb38454200c409eb1ac81949223f
7
- data.tar.gz: ba55e9d66319fb206069149b90b2b436714ddaaaf0b12318049531e3b4ff5fa4dd1f1fd548ef60aa87bd85b6bd55cf6c8461387d87fee8f63bd7931191234ae3
6
+ metadata.gz: 8db3bd75b42f437b91c8811f8be7c8beaf7ea057f1a7b04c3bd62c7cebdfcb228561f9deb80b848db00fe625b8336c7dfc4506fde10dd83a6195ec09ed8b794f
7
+ data.tar.gz: fe2ade57a8a79b77fb085e3a4f7f6cdcc84a5dbb4f6ada084c736af5e66bf5a109acbd2e0e2afc7e6a2197b29c4b5b93ccc09f976a1221eea3b1a09256ca2734
data/lib/smml/msm.rb CHANGED
@@ -192,7 +192,7 @@ module MmlReg
192
192
  self.r([:hexraw,:sharp,:chord,:word,:sound,:modifier,:velocity,:tempo,:num,:octave,:note,:mod,:note?,:sound?])
193
193
  end
194
194
  def self.multipletr
195
- self.r([:word,:note,:sound,:chord,:num,:sharp,:octave,:mod])
195
+ self.r([:note2,:word,:note,:sound,:chord,:num,:sharp,:octave,:mod])
196
196
  end
197
197
  def self.macroDefr
198
198
  self::MacroDef
@@ -217,6 +217,7 @@ module MmlReg
217
217
  :macro,
218
218
  :repStart,
219
219
  :repEnd,
220
+ :note2,
220
221
  :word,
221
222
  :modifier,
222
223
  :sharp,
@@ -249,6 +250,7 @@ module MmlReg
249
250
  ]
250
251
  @@h[:repmark]="\\.FINE|\\.DS|\\.DC|\\.\\$|\\.toCODA|\\.CODA|\\.SKIP"
251
252
  @@h[:comment]="\\( *comment[^\(\)]*\\)"
253
+ @@h[:note2]="\\( *tne *:[^\(\)]*\\)"
252
254
  @@h[:word]="\\([^\(\):]*:[^\(\)]*\\)"
253
255
  @@h[:wordStart]="\\([^\(\):]*:"
254
256
  @@h[:sharp]="\\([+-]*[[:digit:]\\.]*\\)"
@@ -431,6 +433,8 @@ class Notes < Hash
431
433
  "u"=>[6,@@rythmChannel]
432
434
  }
433
435
  @@invert=@@notes.invert
436
+ 12.times{|i|@@notes[":#{i}"]=i}
437
+ 12.times{|i|@@notes[":-#{i+1}"]=-i-1}
434
438
  @@octave=12
435
439
  def initialize
436
440
  @@notes.each{|k,v|self[k]=v}
@@ -1027,7 +1031,7 @@ end
1027
1031
  module MidiHex
1028
1032
  BendMax=16383
1029
1033
  BendHalf=8192
1030
- # 設定のため最初に呼ばなければならない
1034
+ # initialize
1031
1035
  def self.prepare bpm=120,tbase=480,vel=0x40,oct=:near,vfuzzy=2,strict=false
1032
1036
  @ready=true
1033
1037
  @bendHalfMax=BendHalf
@@ -1156,6 +1160,7 @@ module MidiHex
1156
1160
  self.bendCentReset
1157
1161
  @lastbend=0
1158
1162
  end
1163
+ # track initialize
1159
1164
  def self.trackPrepare tc=0
1160
1165
  self.getDefault
1161
1166
  @theremin=false
@@ -1187,17 +1192,20 @@ module MidiHex
1187
1192
  "
1188
1193
  # Standard MIDI File data start
1189
1194
  # header
1190
- 4D 54 68 64 # ヘッダ
1191
- 00 00 00 06 # データ長:6[byte]
1192
- 00 #{format} # フォーマット
1193
- 00 #{track} # トラック数
1194
- #{tbase} # 1 拍の分解能 #{@tbase}
1195
+ 4D 54 68 64 # header
1196
+ 00 00 00 06 # length of data :6[byte]
1197
+ 00 #{format} # format
1198
+ 00 #{track} # track number
1199
+ #{tbase} # tiks; division of a beat #{@tbase}
1195
1200
  "
1196
1201
  end
1197
- def self.byGate len,g=@gateRate
1202
+ def self.byGate len,g=@gateRate,lenforgate=false
1203
+ lenforgate||=len
1198
1204
  g=@preGate.shift if @preGate.size>0
1199
- l=(len*1.0*g/100).to_i
1205
+ gl=(lenforgate*1.0*g/100).to_i
1206
+ l=gl+(len-lenforgate)
1200
1207
  r=len-l
1208
+ l,r=len,0 if len<lenforgate
1201
1209
  [l,r]
1202
1210
  end
1203
1211
  def self.soundOn key=@basekey,velocity=@velocity,ch=@ch,sharp=0
@@ -1235,7 +1243,7 @@ module MidiHex
1235
1243
  r<<Event.new(:end,start," 8#{ch} #{key} 00 # #{start} sound off only [#{(@nowtime/@tbase).to_i}, #{@nowtime%@tbase}]\n")
1236
1244
  r
1237
1245
  end
1238
- def self.thereminNote pos,key,velocity,ch,exp=@expressionDef
1246
+ def self.thereminNote pos,key,velocity,ch,exp=@expression
1239
1247
  r=[]
1240
1248
  @expression=exp
1241
1249
  if @expression
@@ -1252,20 +1260,21 @@ module MidiHex
1252
1260
  end
1253
1261
  def self.oneNote len=@tbase,key=@basekey,velocity=@velocity,ch=@ch,sharp=0
1254
1262
  bendStart=@bendNow
1255
- velocity=@preVelocity.shift if @preVelocity.size>0
1256
- gate=@gateRate
1257
1263
  ch=[ch,0x0f].min
1258
- velocity-=rand(@velocityFuzzy) if @velocityFuzzy>0
1259
- velocity=[velocity,0x7f].min
1260
1264
  key+=sharp
1261
1265
  @key=[[key,0x7f].min,0].max
1262
1266
  return self.thereminNote(len,key,velocity,ch) if @theremin
1267
+ velocity=@preVelocity.shift if @preVelocity.size>0
1268
+ gate=@gateRate
1269
+ velocity-=rand(@velocityFuzzy) if @velocityFuzzy>0
1270
+ velocity=[velocity,0x7f].min
1263
1271
  key=format("%02x",@key)
1264
1272
  ch=format("%01x",ch)
1265
1273
  vel=format("%02x",velocity)
1266
1274
  start=@waitingtime
1267
1275
  @waitingtime=0
1268
- slen,rest=self.byGate(len,gate)
1276
+ slen,rest=self.byGate(len,gate,@lenForGate)
1277
+ @lenForGate=false
1269
1278
  @nowtime+=start
1270
1279
  r=[]
1271
1280
  r<<Event.new(:e,start," 9#{ch} #{key} #{vel} # #{start} later, sound on note #{@key} velocity #{velocity}\n")
@@ -1297,7 +1306,7 @@ module MidiHex
1297
1306
  r
1298
1307
  end
1299
1308
  def self.dummyNote key,len,accent=false,sharp=0
1300
- vel=@velocity
1309
+ vel=@veloecity
1301
1310
  vel+=@accentPlus
1302
1311
  if key=="?"
1303
1312
  key=rand(0x7f)
@@ -1328,32 +1337,43 @@ module MidiHex
1328
1337
  vel+=@accentPlus if accent
1329
1338
  self.oneNote(len,key,vel,@rythmChannel,sharp)
1330
1339
  end
1331
- def self.notes c,l=false,accent=false,sharp=0,sharpFloat=false
1332
- bendStart=@bendNow
1333
- @lastnoteName=c
1340
+ def self.noteCalc c,last,base
1334
1341
  n=@notes[c]
1335
1342
  if @octmode==:near && n.class != Array
1336
- if @lastnote
1337
- n+=12 if @lastnote-n>6
1338
- n-=12 if @lastnote-n<-6
1343
+ if last
1344
+ n+=12 if last-n>6
1345
+ n-=12 if last-n<-6
1339
1346
  end
1340
- @lastnote=n
1341
- (@basekey+=12;@lastnote-=12) if n>=12
1342
- (@basekey-=12;@lastnote+=12) if n<0
1343
- n=@lastnote
1347
+ last=n
1348
+ (base+=12;last-=12) if n>=12
1349
+ (base-=12;last+=12) if n<0
1350
+ n=last
1351
+ end
1352
+ [n,last,base]
1353
+ end
1354
+ def self.notes c,l=false,accent=false,sharp=0,sharpFloat=false
1355
+ if sharpFloat && (sharpFloat!=0)
1356
+ s=sharp+sharpFloat
1357
+ sharp=s.to_i
1358
+ sharpFloat=s-sharp
1344
1359
  end
1360
+ bendStart=@bendNow
1361
+ @lastnoteName=c
1362
+ n,@lastnote,@basekey=self.noteCalc(c,@lastnote,@basekey)
1345
1363
  r=[]
1346
1364
  if sharpFloat && sharpFloat!=0
1347
1365
  v=sharpFloat*@bendHalfMax/@bendrange
1348
1366
  v=sharpFloat*100 if @bendCentOn
1349
- v+=bendStart
1350
- r<<self.bend(0,v)
1351
1367
  @bendNow=v
1368
+ v+=bendStart
1369
+ r<<self.bend(0,v) if not @theremin
1352
1370
  r<<self.notekey(n,l,accent,sharp)
1353
- r<<self.bend(0,bendStart)
1371
+ r<<self.bend(0,bendStart) if not @theremin
1354
1372
  @bendNow=bendStart
1355
1373
  else
1356
1374
  r<<self.notekey(n,l,accent,sharp)
1375
+ # r<<self.bend(0,bendStart)# if bends
1376
+ # @bendNow=bendStart
1357
1377
  end
1358
1378
  r
1359
1379
  end
@@ -1576,7 +1596,7 @@ module MidiHex
1576
1596
  case d
1577
1597
  when "+" ; c+=explus
1578
1598
  when "-" ; c-=explus
1579
- else ; c=d
1599
+ else ; c=d.to_i
1580
1600
  end
1581
1601
  c=midiVround(c)
1582
1602
  @expression=c
@@ -1808,6 +1828,12 @@ module MidiHex
1808
1828
  end
1809
1829
  @trackName[@tracknum]=n
1810
1830
  end
1831
+ def self.setlenforgate g
1832
+ # set temporary len for gaterate; for internal purpose
1833
+ # (g:70)...f~~ => 70% of 3, gate rest is 30% of 3
1834
+ # (g:70)...(gl:1.0)f~~ => 70% of 1.0, gate rest is 30% of 1.0
1835
+ @lenForGate=g.to_f*@tbase
1836
+ end
1811
1837
  def self.preLength v
1812
1838
  @preLength=v.map{|i|
1813
1839
  case i
@@ -1939,6 +1965,62 @@ module MidiHex
1939
1965
  @marktrack.set(m,@tracknum,@nowtime)
1940
1966
  Event.new(:mark,m,@tracknum,@nowtime)
1941
1967
  end
1968
+ def self.calcNoteFloat n,sharp,sharpFloat,base
1969
+ n=@notes[n] if n.class==String
1970
+ n+sharp+sharpFloat+base
1971
+ end
1972
+ def self.tneMid now,last,len,transitionrate
1973
+ n0,e0,sharp0,sharpFloat0,base0=last
1974
+ n,e,sharp,sharpFloat,base=now
1975
+ e=e.to_i
1976
+ e0=e0.to_i
1977
+ stepDefault=10
1978
+ step=stepDefault
1979
+ lastv=self.calcNoteFloat(n0,sharp0,sharpFloat0,base0)
1980
+ n,last,base=self.noteCalc(n,@notes[n0],base)
1981
+ stepN=self.calcNoteFloat(n,sharp,sharpFloat,base)-lastv
1982
+ stepE=e-e0
1983
+ step=1 if stepE==0 && stepN==0
1984
+ step=stepN.to_i*3 if stepN>stepDefault/3
1985
+ transitionl=len*transitionrate
1986
+ restl=len-transitionl
1987
+ stepL=transitionl*1.0/step
1988
+ stepE=stepE*1.0/step
1989
+ stepN=stepN*1.0/step
1990
+ r=[]
1991
+ step.times{|i|
1992
+ r<<self.expre(0,e0+stepE*i.succ) if e!=e0
1993
+ r<<self.notes(n0,stepL,false,sharp0,sharpFloat0+stepN*i.succ)
1994
+ }
1995
+ r<<self.expre(restl,e)
1996
+ r
1997
+ end
1998
+ # transition rate, note, expression
1999
+ def self.tne arg,t,accent,sharp,sharpFloat
2000
+ exp=@expression
2001
+ trans,n,e=arg.split(',')
2002
+ trans=trans.to_f
2003
+ trans=0.3 if trans==0
2004
+ bchange=0
2005
+ @nowTne=[n,e,sharp,sharpFloat,@basekey]
2006
+ if @lastTne
2007
+ n,e,sharp,sharpFloat,base=@lastTne
2008
+ bchange=@basekey-base
2009
+ @basekey=base
2010
+ else
2011
+ @lastTne=@nowTne
2012
+ end
2013
+ r=[]
2014
+ r<<Event.new(:comment,"# tne #{arg}")
2015
+ r<<self.expre(0,e)
2016
+ r<<self.notes(n,0,accent,sharp,sharpFloat)
2017
+ r<<self.tneMid(@nowTne,@lastTne,t,trans)
2018
+ r<<self.expre(0,exp)
2019
+ @lastTne=@nowTne
2020
+ @basekey+=bchange
2021
+ @lastTne[-1]=@basekey
2022
+ r
2023
+ end
1942
2024
  def self.eventlist2str elist
1943
2025
  @eventlist=[]
1944
2026
  r=@eventlist
@@ -1949,6 +2031,7 @@ module MidiHex
1949
2031
  r<<Event.new(:raw,self.metaText("#{cmd} #{arg}")) if $DEBUG && $debuglevel>5
1950
2032
  r<<e
1951
2033
  case cmd
2034
+ when :comment
1952
2035
  when :basekeyPlus
1953
2036
  @basekey+=arg[0]
1954
2037
  when :raw
@@ -2060,6 +2143,8 @@ module MidiHex
2060
2143
  @h<<[:percussionNote,*arg]
2061
2144
  when :rawsound
2062
2145
  @h<<[:byKey,*arg]
2146
+ when :tne
2147
+ @h<<[:tne,*arg2]
2063
2148
  when :sound
2064
2149
  @h<<[:notes,*arg2]
2065
2150
  when :dummyNote
@@ -2099,6 +2184,10 @@ module MidiHex
2099
2184
  tr=$2.to_i
2100
2185
  tr*=-1 if $1=="-"
2101
2186
  @h<<[:basekeyPlus,tr]
2187
+ when /^\(tne:(.*)\)/
2188
+ wait<<[:tne,$1]
2189
+ when /^\(lg:(.*)\)/
2190
+ @h<<[:call,:setlenforgate,$1]
2102
2191
  when /^\(theremin:(.*)\)/
2103
2192
  if $1=~/off/
2104
2193
  @h<<[:setTheremin,false]
@@ -2294,10 +2383,12 @@ module MidiHex
2294
2383
  p "accent" if $DEBUG
2295
2384
  accent=true
2296
2385
  when "="
2386
+ last=@h[-1]
2387
+ @h<<[:comment,"= same sound"]
2297
2388
  if lastwait.size>0
2298
2389
  wait+=lastwait
2299
2390
  else
2300
- @h<<@h[-1]
2391
+ @h<<last
2301
2392
  end
2302
2393
  when "r"
2303
2394
  wait<<[:rest,i]
@@ -2484,7 +2575,7 @@ def multiplet d,tbase
2484
2575
  when /^[-+]+[[:digit:]]*/,/^[\^`',<>]/,/^\([-+]*[[:digit:]]?\)/
2485
2576
  mod<<i
2486
2577
  # note
2487
- when /^\((\?|x|C|chord):[^\)]+\)|^\^?:[^,]+,|^=/
2578
+ when /^\((\?|x|C|chord|tne):[^\)]+\)|^\^?:[^,]+,|^=/
2488
2579
  lengths<<1
2489
2580
  notes<<"#{mod*""}#{i}"
2490
2581
  mod=[]
data/lib/smml/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Smml
2
- VERSION = "0.1.8.2"
2
+ VERSION = "0.1.9"
3
3
  end
data/tutorial_smml.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
 
4
4
  ## note
5
+ ;; after setting up your environment of playing midi music,
6
+
7
+
5
8
  ;; listen to the sound of a note 'c', at first.
6
9
 
7
10
  ```
@@ -76,6 +79,9 @@ a0.5 c0.25 c0.25
76
79
  /: a4 c2 c2 /
77
80
  ```
78
81
 
82
+ in fact, ```/a4c2c2/``` is valid too, but it will be confusing later.
83
+
84
+
79
85
  ## gate time
80
86
  ;; real tone length is important sometimes. gate time command is a percentage of tone length. (staccato etc.)
81
87
 
@@ -148,6 +154,39 @@ c = = = d = = =
148
154
  :cmaj7, = = = :G7, = = =
149
155
  ```
150
156
 
157
+ currently valid names are
158
+
159
+ ```
160
+ c7
161
+ cm7
162
+ cmaj7
163
+ cmmaj7
164
+ cmaj or c
165
+ cm
166
+ c6
167
+ cm6
168
+ csus4
169
+ caug
170
+ c+
171
+ cdim
172
+ cdim7
173
+ cpower
174
+ ```
175
+
176
+ followed by
177
+
178
+ ```
179
+ (+5)
180
+ (-5)
181
+ (9) or (add9)
182
+ (+9)
183
+ (-9)
184
+ (+11)
185
+ (13)
186
+ (-13)
187
+ ```
188
+
189
+
151
190
  ## tempo
152
191
  ;; most commands except note type ones, are inside parenthesis. set the tempo 120 bpm.
153
192
 
@@ -199,14 +238,26 @@ strange ways of sharp/flat can be affective currently. ```(+4)a``` , ```(-1.2)a`
199
238
  {50,54,58}
200
239
  ```
201
240
 
241
+ ;; use 12 series notation ; :0,:1,:2,:3 ... and :11 as notes c,C,d,D, ... and b.
242
+
243
+ ```
244
+ [ {47,56,:0,:1} === + ] 4
245
+ ```
246
+
247
+ this multi-tone passage is repeated four times. ```:0``` is 'c' and ```:1``` is '(+)c', so these go to up-octave every passage effected by octave command '+' in the end of it,
248
+ but other absolute number notes are not affected.
249
+
250
+
202
251
  ## instrument; program change
203
- ;; drum sound can be used anywhere, but this is not MIDI way. use instrument name.
252
+ ;; drum sound can be used anywhere, but this is not MIDI way, use instrument name.
204
253
 
205
254
  ```
206
255
  _snare! = = =
207
256
  ```
208
257
 
209
258
  ;; set instrument. automaticaly searched by even not exact name. (MIDI program change command)
259
+ it depend on map files.
260
+
210
261
 
211
262
  ```
212
263
  (p:piano) c d e f (p:guitar) f e d c
@@ -218,6 +269,38 @@ _snare! = = =
218
269
  (ch:drum) {34} = = = {35} = = =
219
270
  ```
220
271
 
272
+
273
+ ## instrument map
274
+ ;; a MIDI Program Change event sets the instrument on a channel.
275
+ if channel is 10, a note number means each drum instrument.
276
+ these are decreared in map files;
277
+ > midi-programChange-list.txt
278
+
279
+
280
+ > midi-percussion-map.txt
281
+
282
+
283
+ when there are same name files on the current directory, these are used. if not, default files in the gem will be set.
284
+ data in these map text must start with instrument number.
285
+ without it, the line text is used for section name. if the word 'Guitar' appears, it is included for searching keyword until the next section name line appears.
286
+
287
+ ```
288
+
289
+ Piano Section
290
+ 1 hoge piano
291
+ 2 foo
292
+ 3 bar
293
+
294
+ Guitar Section
295
+ 4 one
296
+ 5 two
297
+
298
+ ```
299
+
300
+ so in this list, instrument number 1,2 and 3 match the keyword 'piano'.
301
+ So '(p:guitar,2)' selects an instrument line '5 two' as the 2nd result of searching 'guitar' and will be used instead of no word 'guitar' on it.
302
+
303
+
221
304
  ## track
222
305
  ;; in SMF, MIDI channel is 1 - 16, and drum is in 10 channel. but currently, these are automaticaly set.
223
306
  ;; you don't need to think about it. simply seperate tracks with a command '|||'.
@@ -234,18 +317,8 @@ _snare! = = =
234
317
  ||| (p:guitar) g a b c
235
318
  ```
236
319
 
237
- ;; the same track name, the same MIDI channel and setting.
238
-
239
- ```
240
- (track:foo) (p:organ) aa
241
- ||| (track:foo) bb
242
- ||| (track:hoge) cc
243
- ```
244
-
245
- first two tracks are 'organ' sound by the track names declared.
246
-
247
320
 
248
- currenly track names are not used, and tracks continue with apprearing order. so if there are no data in some tracks in mid parts of pages,
321
+ currenly track names are not used as default, and tracks continue with apprearing order. so if there are no data in some tracks in mid parts of pages,
249
322
  use blank tracks by track seperaters.
250
323
 
251
324
  ```
@@ -258,7 +331,18 @@ use blank tracks by track seperaters.
258
331
  ||| def ;; track 3
259
332
  ```
260
333
 
261
-
334
+
335
+ ;; the same track name, the same MIDI channel and setting.
336
+
337
+ ```
338
+ (track:foo) (p:organ) aa
339
+ ||| (track:foo) bb
340
+ ||| (track:hoge) cc
341
+ ```
342
+
343
+ first two tracks are 'organ' sound by the same track names declared.
344
+
345
+
262
346
  ## page
263
347
  ;; then seperate pages by three or longer one line '/'.
264
348
  ;; but this command do not adjust time potisions. it simply resets track number increment.
@@ -266,18 +350,18 @@ use blank tracks by track seperaters.
266
350
  ```
267
351
  cdef|||efga|||gabc
268
352
  ////////////////////
269
- cdef|||efga|||gabc
353
+ c2d2e2f2|||e2f2g2a2|||g2a2b2c2
270
354
  ///////////////////
271
- cdef|||efga|||gabc
355
+ c3def|||e3fga|||g3abc
272
356
  ```
273
357
 
274
358
  ;; the same to below.
275
359
 
276
360
  ```
277
- cdef cdef cdef ||| efga efga efga ||| gabc gabc gabc
361
+ cdef c2d2e2f2 c3def ||| efga e2f2g2a2 e3fga ||| gabc g2a2b2c2 g3abc
278
362
  ```
279
363
 
280
- ;; if you want to adjust tracks, use a blank page by two lines of page seperaters. the last three 'c' will be played adjusted.
364
+ ;; if you want to adjust tracks, use a blank page by two lines of page seperaters. the last three 'c' will be played adjusted instead each preceding note lengths are different.
281
365
 
282
366
  ```
283
367
  cd ||| e ||| abcde
@@ -292,9 +376,9 @@ c|||c|||c
292
376
  ```
293
377
  cd ||| e ||| abcde
294
378
  ////////////////////
295
- (mark:positionName) c
296
- ||| (mark:positionName) c
297
- ||| (mark:positionName) c
379
+ (mark:positionName) c ;; track 1
380
+ ||| (mark:positionName) c ;; track 2
381
+ ||| (mark:positionName) c ;; track 3
298
382
  ```
299
383
 
300
384
  these are played like this.
@@ -314,42 +398,12 @@ these are played like this.
314
398
  ```
315
399
 
316
400
  ;; same mark names 'm' in repeated section or one track will be automaticaly substituded by 'm m@2 m@3'. to adjust, use it in other tracks.
317
- or use a comma , '(mark:hoge@3)' = '(mark:hoge,3)'
401
+ or use a comma as a seperater of a name and a counter; '(mark:hoge@3)' = '(mark:hoge,3)'.
318
402
 
319
403
  ```
320
404
  a b c (mark:m) a b c (mark:m@2) a b c (mark:m@3)
321
405
  ```
322
406
 
323
- ## instrument map
324
- ;; a MIDI Program Change event sets the instrument on a channel.
325
- if channel is 10, a note number means each drum instrument.
326
- these are decreared in map files;
327
- > midi-programChange-list.txt
328
-
329
-
330
- > midi-percussion-map.txt
331
-
332
-
333
- when there are same name files on the current directory, these are used. if not, default files in the gem will be set.
334
- data in these map text must start with instrument number.
335
- without it, the line text is used for section name. if the word 'Guitar' appears, it is included for searching keyword until the next section name line appears.
336
-
337
- ```
338
-
339
- Piano Section
340
- 1 hoge piano
341
- 2 foo
342
- 3 bar
343
-
344
- Guitar Section
345
- 4 one
346
- 5 two
347
-
348
- ```
349
-
350
- so in this list, instrument number 1,2 and 3 match the keyword 'piano'.
351
- So '(p:guitar,2)' selects an instrument line '5 two' as the 2nd result of searching 'guitar' and will be used instead of no word 'guitar' on it.
352
-
353
407
  ## hex data
354
408
  ;; until smml syntax is completed, or other reasons, raw hex parts can be used for deep level data and things you don't know how to inprement by smml data.
355
409
  search MIDI format and set valid hex data.
@@ -656,6 +710,7 @@ pitch bend 100 of note 'c'.
656
710
  ```
657
711
 
658
712
  '+' relative value. if these are after above, three notes are bend 100 of 'c', bend 200 of 'c' and bend 0 of 'c'.
713
+ bend data is effective permanently until reseted by ```(bend:0)```.
659
714
 
660
715
 
661
716
  ```
@@ -715,10 +770,12 @@ now, note type commands are :
715
770
 
716
771
  ```
717
772
  c ;; single note
773
+ C ;; c sharp
718
774
  (-)d ;; single note with flat/sharp/natural modifiers
719
775
  {64} ;; single note by absolute note number
720
776
  _snare! ;; drum note by instrument name search keyword 'snare'
721
777
  {d,g,-b} ;; multi note
778
+ {47,:0} ;; multi note. second note is by 12 series half tone notation
722
779
  :cmaj7, ;; chord name
723
780
  = ;; copy of the latest note type command
724
781
  ```
@@ -737,6 +794,25 @@ ab /:cde/ f
737
794
 
738
795
  after on command, data is manipulated as bend data inside smml. not completed about modifiers for this.
739
796
 
797
+ ;; easy way to write smooth expression and note transition
798
+ (experimental; experimental notations may be deleted or hidden to internal purpose only later.)
799
+
800
+
801
+ ```
802
+ (tne:0.3,c,127) 3
803
+ ```
804
+
805
+ 3 beat lengths of note 'c' with expression level 127 transition time rate 0.3 connected from the last note.
806
+
807
+ ;; length for gate
808
+ (experimental)
809
+
810
+ ```
811
+ (g:70)
812
+ f~~(lg:1.0)f~~f~~
813
+ ```
814
+
815
+ rest of second 'f' is 30% of one beat instead others are 30% of three beats.
740
816
 
741
817
  ## preprocess
742
818
  ;; some pre-process commands.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smml
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8.2
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - tabasano
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-05 00:00:00.000000000 Z
11
+ date: 2014-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler