OctaveFold.h
1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2 
3 /*
4  Tipic
5 
6  Centre for Digital Music, Queen Mary, University of London.
7 
8  This program is free software; you can redistribute it and/or
9  modify it under the terms of the GNU General Public License as
10  published by the Free Software Foundation; either version 2 of the
11  License, or (at your option) any later version. See the file
12  COPYING included with this distribution for more information.
13 */
14 
15 #ifndef OCTAVEFOLD_H
16 #define OCTAVEFOLD_H
17 
18 #include <vector>
19 
21 {
22 public:
23  static std::vector<double> process(std::vector<double> in) {
24  std::vector<double> out(12, 0.0);
25  for (int i = 0; i < int(in.size()); ++i) {
26  out[(i+1) % 12] += in[i];
27  }
28  return out;
29  }
30 };
31 
32 #endif
33 
Definition: OctaveFold.h:20