File: bbcut.h

package info (click to toggle)
csound 1%3A6.18.1%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 63,220 kB
  • sloc: ansic: 192,643; cpp: 14,149; javascript: 9,654; objc: 9,181; python: 3,376; java: 3,337; sh: 1,840; yacc: 1,255; xml: 985; perl: 635; lisp: 411; tcl: 341; lex: 217; makefile: 128
file content (137 lines) | stat: -rw-r--r-- 4,047 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/*
    bbcut.h:

    Copyright (C) 2001 Nick Collins

    This file is part of Csound.

    The Csound Library is free software; you can redistribute it
    and/or modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    Csound is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with Csound; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
    02110-1301 USA
*/

/* mono and stereo automatic audio cutters */

/* mono version Nick Collins Aug 2 2001 */
/* added stereo Aug 10 2001 */

/* based on SuperCollider classes, latest Breakbeat5 available from
   http://www.axp.mdx.ac.uk/~nicholas15/ at time of writing some corrections
   for realtime audio, removal of random offset chance, panning of cuts and
   rest chance */

/* cmono audio in, i bps, subdiv,barlength,phrasebars,numrepeats, */
/* (optionals) p stutterspeed (defaulting to 1), o stutterchance
   (defaulting to 0=off), enveloping choice (defaulting to 1=on) */

#if !defined(__bbcut_h__)
#   define  __bbcut_h__

/* Csound ugen struct- can't use same struct for Mono and Stereo version */
typedef struct {
      OPDS  h;                              /* defined in cs.h */
  /*inputs and outputs */
  /* output first */
      MYFLT     *aout;
  /* inputs in order */
  /* a rate */
      MYFLT     *ain;
  /* i rate */
      MYFLT     *bps;
      MYFLT     *subdiv;
      MYFLT     *barlength;     /* in beats */
      MYFLT     *phrasebars;
      MYFLT     *numrepeats;
      /* optionals */
      MYFLT     *stutterspeed;  /* default 1 */
      MYFLT     *stutterchance; /* default 0 */
      MYFLT     *envelopingon;  /* default 1 */

      /* integer values */
      int32_t Subdiv,Phrasebars,Numrepeats;
      int32_t Stutterspeed;

  /* internal data */
  /* uint64_t sampdone; */
      int32_t samplesperunit;
      int32_t repeatlengthsamp;
      int32_t repeatsampdone;
      int32_t numbarsnow;
      /* unitblock can be a float if stutterspeed greater than 1 */
      MYFLT unitblock,unitsleft,unitsdone;
      int32_t totalunits;

      int32_t repeats,repeatsdone;
      int32_t stutteron;

      /* enveloping */
      int32_t Envelopingon,envsize;

      /* to hold repeat data */
      AUXCH repeatbuffer;

} BBCUTMONO;

/*  STEREO VERSION */

typedef struct {
      OPDS  h;                              /*  defined in cs.h*/
      /* inputs and outputs */
      /* output first- stereo */
      MYFLT     *aout1;
      MYFLT     *aout2;
      /* inputs in order */
      /* arate, stereo ins */
      MYFLT     *ain1;
      MYFLT     *ain2;
      /* i rate */
      MYFLT     *bps;
      MYFLT     *subdiv;
      MYFLT     *barlength;     /* in beats */
      MYFLT     *phrasebars;
      MYFLT     *numrepeats;
      /* optionals */
      MYFLT     *stutterspeed;  /* default 1 */
      MYFLT     *stutterchance; /* default 0 */
      MYFLT     *envelopingon;  /* default 1 */

      /* integer values */
      int32_t Subdiv,Phrasebars,Numrepeats;
      int32_t Stutterspeed;

      /* internal data */
      /* unsigned long sampdone; */
      int32_t samplesperunit;
      int32_t repeatlengthsamp;
      int32_t repeatsampdone;

      int32_t numbarsnow;
      /* unitblock can be a float if stutterspeed greater than 1 */
      MYFLT unitblock,unitsleft,unitsdone;
      int32_t totalunits;

      int32_t repeats,repeatsdone;
      int32_t stutteron;

      /* enveloping */
      int32_t Envelopingon,envsize;

      /* to hold repeat data- interleaved stereo buffer, twice size
         for mono version */
      AUXCH repeatbuffer;

} BBCUTSTEREO;

#endif /* !defined(__bbcut_h__) */