mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add compost dft, spectrum, etc
This commit is contained in:
parent
6b08a81d3e
commit
24d2a229f3
45 changed files with 1490 additions and 61 deletions
28
sprout/compost/utility/equal_temperament.hpp
Normal file
28
sprout/compost/utility/equal_temperament.hpp
Normal file
|
@ -0,0 +1,28 @@
|
|||
#ifndef SPROUT_COMPOST_UTILITY_EQUAL_TEMPERAMENT_HPP
|
||||
#define SPROUT_COMPOST_UTILITY_EQUAL_TEMPERAMENT_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/math/pow.hpp>
|
||||
#include <sprout/type_traits/float_promote.hpp>
|
||||
|
||||
namespace sprout {
|
||||
namespace compost {
|
||||
//
|
||||
// equal_temperament_value
|
||||
//
|
||||
template<typename ArithmeticType1, typename ArithmeticType2>
|
||||
SPROUT_CONSTEXPR typename sprout::float_promote<ArithmeticType1, ArithmeticType2>::type
|
||||
equal_temperament_value(ArithmeticType1 i, ArithmeticType2 div) {
|
||||
typedef typename sprout::float_promote<ArithmeticType1, ArithmeticType2>::type type;
|
||||
using sprout::pow;
|
||||
return pow(type(2), type(i) / type(div));
|
||||
}
|
||||
template<typename ArithmeticType>
|
||||
SPROUT_CONSTEXPR typename sprout::float_promote<ArithmeticType, int>::type
|
||||
equal_temperament_value(ArithmeticType i) {
|
||||
return sprout::compost::equal_temperament_value(i, 12);
|
||||
}
|
||||
} // namespace compost
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_COMPOST_UTILITY_EQUAL_TEMPERAMENT_HPP
|
Loading…
Add table
Add a link
Reference in a new issue