Gulp plugin for rewriting metadata of NKS(Native Kontrol Standard) preset file.
npm install gulp-nks-rewrite-meta --save-dev
using the static data.
rewrite = require 'gulp-nks-rewrite-meta'
gulp.task 'dist', ->
gulp.src ['src/Piano/**/*.nksf']
.pipe rewrite
modes: ['Sample-based']
types: [
['Piano/Keys']
['Piano/Keys', 'Electric Piano']
]
.pipe gulp.dest 'dist'
using the function to provide data.
rewrite = require 'gulp-nks-rewrite-meta'
gulp.task 'dist', ->
gulp.src ['src/Velvet/**/*.nksf'], read: true
.pipe rewrite (file, metadata) ->
folder = path.relative 'src/Velvet', path.dirname file.path
# using folder as preset bank
bankchain: ['Velvet', folder, '']
.pipe gulp.dest 'dist'
using the non-blocking function to provide data.
rewrite = require 'gulp-nks-rewrite-meta'
gulp.task 'dist', ->
gulp.src ['src/**/*.nksf'], read: true
.pipe rewrite (file, metadata, done) ->
# create data in non-blocking
nonblockingfunction metadata, (err, data) ->
done err, data
.pipe gulp.dest 'dist'
Type: Object
or function(file, metadata [,callback])
The data or data provider to rewrite for.
Type: String
Type: Array
of String
The length of array should be 3.
Type: String
Type: Array
of String
Type: String
Type: 2 dimensional Array
of String
The length of inner array should be 1 or 2
examle: [ ['Piano/Keys'], ['Piano/Keys', 'Electric Piano'] ]
The functoin to provide data.
Type: instance of vinyl
file
Type: Object
The metadata of source file.
Type: function(err, data)
The callback function to support non-blocking data provider.
example metadata of .nksf
{
"UUID": "7E256217-47DA-4746-0001-A4656EF12290",
"author": "C.Pitman",
"bankchain": ["Mini V2", "", ""],
"comment": "",
"deviceType": "INST",
"modes": ["Long Release", "Synthetic"],
"name": "poly5",
"types": [
["Synth Pad", "Basic Pad"],
["Synth Pad", "Bright Pad"]
],
"uuid": "",
"vendor": "Arturia"
}
{
"author": "",
"bankchain": ["Velvet", "MKII", ""],
"comment": "",
"deviceType": "INST",
"modes": ["Sample-based"],
"name": "69 MKII Spooky Ring Mod",
"types": [
["Piano/Keys"],
["Piano/Keys", "Electric Piano"]
],
"uuid": "b9d0a3da-3603-45b9-b5e9-99207f131991",
"vendor": "AIR Music Technology"
}