Subversion Repositories DIN Is Noise

Rev

Rev 2327 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1528 jag 1
/*
2
* beat2value.h
2302 jag 3
* DIN Is Noise is copyright (c) 2006-2025 Jagannathan Sampath
1713 jag 4
* DIN Is Noise is released under GNU Public License 2.0
1528 jag 5
* For more information, please visit https://dinisnoise.org/
6
*/
7
 
8
#ifndef __BEAT2VALUE
9
#define __BEAT2VALUE
10
 
11
#include "solver.h"
12
#include "curve_mixer.h"
13
#include <string>
14
 
15
struct beat2value : set_mixer {
2264 jag 16
 
17
  multi_curve* swing;
18
  solver swingsol;
19
  void setswing (multi_curve& sw);
2265 jag 20
 
21
  multi_curve* accent;
22
  solver accentsol;
23
  void setaccent (multi_curve& ac);
1528 jag 24
 
25
  std::string name;
26
 
27
  std::string crvname;
28
  multi_curve *crv;
2264 jag 29
  int crv_made_here;
1528 jag 30
 
31
  solver sol;
32
  std::string style; // style of continuation at end of curve (loop or pong)
33
  xhandler *xmin, *xmax;
34
 
2058 jag 35
  float bps;
36
  float min_bpm;
37
  float bpm;
2264 jag 38
 
2058 jag 39
  float set_bpm (float n, int delta_mult = 1);
40
  float get_bpm ();
2264 jag 41
 
2058 jag 42
  float now;
43
  float delta;
1528 jag 44
 
45
  curve_mixer mixer;
1799 jag 46
  void set_mix (multi_curve& crv, const std::string& nam);
1528 jag 47
 
48
  beat2value ();
49
  beat2value (const std::string& crvname, const std::string& fcrvname);
2264 jag 50
  ~beat2value ();
51
 
2096 jag 52
  void setup (int nsamples = 1);
2055 jag 53
  void reverse ();
1528 jag 54
 
55
  int gen_and_mix (float* soln, float* mixb, float* mixa, int n);
56
  int modulate_and_mix (float* in, float* mixb, float* mixa, int n, float depth);
57
  int modulate_and_mix (float* in, float* mixb, float* mixa, int n, float* depth);
58
 
59
};
2174 jag 60
 
2335 jag 61
void powbeat (const std::string& name, beat2value& bv, float p);
2264 jag 62
 
1528 jag 63
#endif