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