annotate src/Instruments.h @ 188:462b165c8c0f noteagent

Emit "MIDI-compatible" frequencies only, unless in fine tuning mode
author Chris Cannam
date Thu, 29 May 2014 09:21:15 +0100
parents 59e3cca75b8d
children 5bde003a43a9
rev   line source
Chris@161 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@161 2
Chris@161 3 /*
Chris@161 4 Silvet
Chris@161 5
Chris@161 6 A Vamp plugin for note transcription.
Chris@161 7 Centre for Digital Music, Queen Mary University of London.
Chris@161 8
Chris@161 9 This program is free software; you can redistribute it and/or
Chris@161 10 modify it under the terms of the GNU General Public License as
Chris@161 11 published by the Free Software Foundation; either version 2 of the
Chris@161 12 License, or (at your option) any later version. See the file
Chris@161 13 COPYING included with this distribution for more information.
Chris@161 14 */
Chris@161 15
Chris@161 16 #include <vector>
Chris@161 17 #include <string>
Chris@161 18
Chris@161 19 #ifndef SILVET_INSTRUMENTS_H
Chris@161 20 #define SILVET_INSTRUMENTS_H
Chris@161 21
Chris@161 22 /**
Chris@161 23 * Define an instrument pack, i.e. a group of templates that are made
Chris@161 24 * available as a single preset at the user interface level. A pack
Chris@161 25 * might contain only a single instrument template (e.g. bassoon), or
Chris@161 26 * it may be a compound of several templates (e.g. different piano
Chris@161 27 * recordings forming a single piano pack), or it may be a group of
Chris@161 28 * distinct instrument templates (e.g. a pack containing all supported
Chris@161 29 * instruments, or potentially groupings such as string quartet or
Chris@161 30 * rock band).
Chris@161 31 */
Chris@161 32 class InstrumentPack
Chris@161 33 {
Chris@161 34 public:
Chris@161 35 static const int templateNoteCount;
Chris@161 36 static const int templateHeight;
Chris@161 37 static const int templateMaxShift;
Chris@161 38 static const int templateSize;
Chris@161 39
Chris@161 40 int lowestNote;
Chris@161 41 int highestNote;
Chris@183 42
Chris@183 43 int maxPolyphony; // realistic practical limit, not a theoretical one
Chris@183 44 float pitchSparsity;
Chris@183 45 float levelThreshold;
Chris@183 46
Chris@161 47 std::string name;
Chris@161 48
Chris@161 49 struct Templates {
Chris@161 50 int lowestNote;
Chris@161 51 int highestNote;
Chris@161 52 // templateNoteCount * templateSize
Chris@161 53 std::vector<std::vector<float> > data;
Chris@161 54 };
Chris@161 55
Chris@161 56 std::vector<Templates> templates;
Chris@161 57
Chris@161 58 static std::vector<InstrumentPack> listInstrumentPacks();
Chris@161 59
Chris@161 60 private:
Chris@161 61 InstrumentPack(int lowest, int highest, std::string n,
Chris@161 62 std::vector<Templates> tt) :
Chris@161 63 lowestNote(lowest),
Chris@161 64 highestNote(highest),
Chris@183 65 maxPolyphony(5),
Chris@183 66 pitchSparsity(1.1),
Chris@183 67 levelThreshold(5),
Chris@161 68 name(n),
Chris@161 69 templates(tt) { }
Chris@161 70 };
Chris@161 71
Chris@161 72 #endif