Revision 206:0a482ae2525f
| README.md | ||
|---|---|---|
| 27 | 27 |
This repository contains the basic Piper schema. Implementations and |
| 28 | 28 |
utilities can be found in neighbouring repositories. |
| 29 | 29 |
|
| 30 |
_This is pre-1.0 code and the protocol or API may change at any time_ |
|
| 30 |
The basic Piper schema is now in "shipping" state: it may be extended |
|
| 31 |
in future, but always in ways that retain compatibility with existing |
|
| 32 |
systems. |
|
| 31 | 33 |
|
| 32 | 34 |
[](https://travis-ci.org/piper-audio/piper) |
| 33 | 35 |
|
| capnp/piper.capnp | ||
|---|---|---|
| 45 | 45 |
variableSampleRate @2; # Features have their own individual timestamps. |
| 46 | 46 |
} |
| 47 | 47 |
|
| 48 |
struct StaticOutputDescriptor {
|
|
| 49 |
|
|
| 50 |
# Properties of an output, that is, a single stream of features |
|
| 51 |
# produced in response to process and finish requests. A feature |
|
| 52 |
# extractor may have any number of outputs, and it always |
|
| 53 |
# calculates and returns features from all of them when |
|
| 54 |
# processing; this is useful in cases where more than one feature |
|
| 55 |
# can be easily calculated using a single method. |
|
| 56 |
# |
|
| 57 |
# This structure contains the properties of an output that are |
|
| 58 |
# static, i.e. that do not depend on the parameter values provided |
|
| 59 |
# at configuration, excluding the Basic struct parameters like id |
|
| 60 |
# and description. The Basic struct properties are not included |
|
| 61 |
# for historical reasons: they were already referenced separately |
|
| 62 |
# in the OutputDescriptor and ExtractorStaticData before this |
|
| 63 |
# struct was introduced. |
|
| 64 |
|
|
| 65 |
typeURI @0 :Text; # URI indicating the sort of feature that this output returns (see docs). |
|
| 66 |
} |
|
| 67 |
|
|
| 48 | 68 |
struct ConfiguredOutputDescriptor {
|
| 49 | 69 |
# Properties of an output, that is, a single stream of features produced |
| 50 | 70 |
# in response to process and finish requests. A feature extractor may |
| ... | ... | |
| 69 | 89 |
} |
| 70 | 90 |
|
| 71 | 91 |
struct OutputDescriptor {
|
| 72 |
# All the properties of an output, both static (the basic metadata) and |
|
| 73 |
# potentially dependent on configuration parameters (the configured descriptor). |
|
| 92 |
# All the properties of an output, both static (the basic metadata and static |
|
| 93 |
# descriptor) and potentially dependent on configuration parameters (the |
|
| 94 |
# configured descriptor). |
|
| 74 | 95 |
|
| 75 | 96 |
basic @0 :Basic; # Basic metadata about the output. |
| 76 | 97 |
configured @1 :ConfiguredOutputDescriptor; # Properties of the output that may depend on configuration parameters. |
| 98 |
static @2 :StaticOutputDescriptor; # Properties (other than Basic) that do not depend on parameters. |
|
| 77 | 99 |
} |
| 78 | 100 |
|
| 79 | 101 |
enum InputDomain {
|
| ... | ... | |
| 102 | 124 |
programs @9 :List(Text); # List of predefined programs. For backward-compatibility, not recommended. |
| 103 | 125 |
inputDomain @10 :InputDomain; # Whether the extractor requires time-domain or frequency-domain input audio. |
| 104 | 126 |
basicOutputInfo @11 :List(Basic); # Basic metadata about all of the outputs of the extractor. |
| 127 |
|
|
| 128 |
struct SOPair {
|
|
| 129 |
# A mapping between output identifier and static descriptor for |
|
| 130 |
# that output. |
|
| 131 |
|
|
| 132 |
output @0 :Text; # Output id, matching the output's descriptor's basic identifier. |
|
| 133 |
static @1 :StaticOutputDescriptor; |
|
| 134 |
} |
|
| 135 |
|
|
| 136 |
staticOutputInfo @12 :List(SOPair); # Static descriptors for all outputs that have any static metadata. |
|
| 105 | 137 |
} |
| 106 | 138 |
|
| 107 | 139 |
struct RealTime {
|
| json/examples/extractorstaticdata.json | ||
|---|---|---|
| 1 |
{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "rights": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005. Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "key": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "version": 2}
|
|
| 1 |
{"basic": {"description": "Detect percussive note onsets by identifying broadband energy rises", "identifier": "percussiononsets", "name": "Simple Percussion Onset Detector"}, "basicOutputInfo": [{"description": "Percussive note onset locations", "identifier": "onsets", "name": "Onsets"}, {"description": "Broadband energy rise detection function", "identifier": "detectionfunction", "name": "Detection Function"}], "category": ["Time", "Onsets"], "rights": "Code copyright 2006 Queen Mary, University of London, after Dan Barry et al 2005. Freely redistributable (BSD license)", "inputDomain": "FrequencyDomain", "key": "vamp-example-plugins:percussiononsets", "maker": "Vamp SDK Example Plugins", "maxChannelCount": 1, "minChannelCount": 1, "parameters": [{"basic": {"description": "Energy rise within a frequency bin necessary to count toward broadband total", "identifier": "threshold", "name": "Energy rise threshold"}, "defaultValue": 3, "extents": {"max": 20, "min": 0}, "unit": "dB", "valueNames": []}, {"basic": {"description": "Sensitivity of peak detector applied to broadband detection function", "identifier": "sensitivity", "name": "Sensitivity"}, "defaultValue": 40, "extents": {"max": 100, "min": 0}, "unit": "%", "valueNames": []}], "programs": [], "staticOutputInfo": {"onsets": {"typeURI": "http://purl.org/ontology/af/Onset"}, "detectionfunction": {"typeURI": "http://purl.org/ontology/af/OnsetDetectionFunction"}}, "version": 2}
|
|
| json/examples/staticoutputdescriptor.json | ||
|---|---|---|
| 1 |
{"typeURI": "http://purl.org/ontology/af/OnsetDetectionFunction"}
|
|
| 2 |
|
|
| json/schema/extractorstaticdata.json | ||
|---|---|---|
| 43 | 43 |
"basicOutputInfo": {
|
| 44 | 44 |
"type": "array", |
| 45 | 45 |
"items": { "$ref": "http://vamp-plugins.org/piper/json/schema/basic#" }
|
| 46 |
} |
|
| 46 |
}, |
|
| 47 |
"staticOutputInfo": {
|
|
| 48 |
"type": "object", |
|
| 49 |
"patternProperties": {
|
|
| 50 |
"^[a-zA-Z0-9_-]+$": {
|
|
| 51 |
"$ref": "http://vamp-plugins.org/piper/json/schema/staticoutputdescriptor#" |
|
| 52 |
} |
|
| 53 |
} |
|
| 54 |
} |
|
| 47 | 55 |
}, |
| 48 | 56 |
"required": [ "key", "basic", "version", |
| 49 | 57 |
"minChannelCount", "maxChannelCount", |
| json/schema/staticoutputdescriptor.json | ||
|---|---|---|
| 1 |
{
|
|
| 2 |
"id": "http://vamp-plugins.org/piper/json/schema/staticoutputdescriptor#", |
|
| 3 |
"$schema": "http://json-schema.org/draft-04/schema#", |
|
| 4 |
"description": "schema for any additional static metadata fields (besides the basic metadata) of an output descriptor belonging to a feature extractor", |
|
| 5 |
"type": "object", |
|
| 6 |
"properties": {
|
|
| 7 |
"typeURI": {
|
|
| 8 |
"type": "string" |
|
| 9 |
} |
|
| 10 |
}, |
|
| 11 |
"additionalProperties": false |
|
| 12 |
} |
|
| 13 |
|
|
Also available in: Unified diff