FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing-sound/src/processing/sound/JSynProcessor.java at main · processing/processing-sound · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
processing
/
processing-sound
Public
Uh oh!
There was an error while loading.
Please reload this page
.
Notifications
You must be signed in to change notification settings
Fork
49
Star
163
Code
Issues
25
Pull requests
1
Actions
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Security and quality
Insights
Expand file tree
Breadcrumbs
processing-sound
/
src
/
processing
/
sound
/
JSynProcessor.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
43 lines (36 loc) · 997 Bytes
Breadcrumbs
processing-sound
/
src
/
processing
/
sound
/
JSynProcessor.java
Copy path
File metadata and controls
43 lines (36 loc) · 997 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
package
processing
.
sound
;
import
com
.
jsyn
.
ports
.
UnitInputPort
;
import
com
.
jsyn
.
ports
.
UnitOutputPort
;
import
com
.
jsyn
.
unitgen
.
UnitFilter
;
/**
* A custom JSyn unit generator that takes care of adding and panning.
* @deprecated
*/
class
JSynProcessor
extends
UnitFilter
{
private
float
add
;
private
float
pan
;
public
JSynProcessor
() {
this
.
input
=
new
UnitInputPort
(
"Input"
);
this
.
output
=
new
UnitOutputPort
(
2
,
"Output"
);
this
.
addPort
(
this
.
input
);
this
.
addPort
(
this
.
output
);
}
@
Override
public
void
generate
(
int
start
,
int
limit
) {
double
[]
input
=
this
.
input
.
getValues
();
double
right
=
0.5
+
this
.
pan
*
0.5
;
double
left
=
1
-
right
;
double
[]
outleft
=
output
.
getValues
(
0
);
double
[]
outright
=
output
.
getValues
(
1
);
for
(
int
i
=
start
;
i
<
limit
;
i
++) {
outleft
[
i
] = (
input
[
i
] +
this
.
add
) *
left
;
outright
[
i
] = (
input
[
i
] +
this
.
add
) *
right
;
}
}
public
void
add
(
float
add
) {
this
.
add
=
add
;
}
public
void
pan
(
float
pos
) {
this
.
pan
=
pos
;
}
}
Back
|
FazBrowse Home
|
New Git URL