Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
purr-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Prateek Mishra
purr-data
Commits
65f1a0ef
Commit
65f1a0ef
authored
6 years ago
by
Jonathan Wilkes
Browse files
Options
Downloads
Plain Diff
Merge branch 'update-mmio'
parents
3a75d018
03bc20b9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pd/src/s_audio_mmio.c
+9
-9
9 additions, 9 deletions
pd/src/s_audio_mmio.c
with
9 additions
and
9 deletions
pd/src/s_audio_mmio.c
+
9
−
9
View file @
65f1a0ef
...
@@ -32,12 +32,12 @@ int nt_realdacblksize;
...
@@ -32,12 +32,12 @@ int nt_realdacblksize;
#define MAXBUFFER 100
/* number of buffers in use at maximum advance */
#define MAXBUFFER 100
/* number of buffers in use at maximum advance */
#define DEFBUFFER 30
/* default is about 30x6 = 180 msec! */
#define DEFBUFFER 30
/* default is about 30x6 = 180 msec! */
static
int
nt_naudiobuffer
=
DEFBUFFER
;
static
int
nt_naudiobuffer
=
DEFBUFFER
;
float
sys_dacsr
=
DEFAULTSRATE
;
t_
float
sys_dacsr
=
DEFAULTSRATE
;
static
int
nt_whichapi
=
API_MMIO
;
static
int
nt_whichapi
=
API_MMIO
;
static
int
nt_meters
;
/* true if we're metering */
static
int
nt_meters
;
/* true if we're metering */
static
float
nt_inmax
;
/* max input amplitude */
static
t_
float
nt_inmax
;
/* max input amplitude */
static
float
nt_outmax
;
/* max output amplitude */
static
t_
float
nt_outmax
;
/* max output amplitude */
static
int
nt_nwavein
,
nt_nwaveout
;
/* number of WAVE devices in and out */
static
int
nt_nwavein
,
nt_nwaveout
;
/* number of WAVE devices in and out */
typedef
struct
_sbuf
typedef
struct
_sbuf
...
@@ -489,7 +489,7 @@ void nt_logerror(int which)
...
@@ -489,7 +489,7 @@ void nt_logerror(int which)
/* system buffer with t_sample types for one tick */
/* system buffer with t_sample types for one tick */
t_sample
*
sys_soundout
;
t_sample
*
sys_soundout
;
t_sample
*
sys_soundin
;
t_sample
*
sys_soundin
;
float
sys_dacsr
;
t_
float
sys_dacsr
;
int
mmio_send_dacs
(
void
)
int
mmio_send_dacs
(
void
)
{
{
...
@@ -498,7 +498,7 @@ int mmio_send_dacs(void)
...
@@ -498,7 +498,7 @@ int mmio_send_dacs(void)
HANDLE
hFormat
;
HANDLE
hFormat
;
int
i
,
j
;
int
i
,
j
;
short
*
sp1
,
*
sp2
;
short
*
sp1
,
*
sp2
;
float
*
fp1
,
*
fp2
;
t_
float
*
fp1
,
*
fp2
;
int
nextfill
,
doxfer
=
0
;
int
nextfill
,
doxfer
=
0
;
int
nda
,
nad
;
int
nda
,
nad
;
if
(
!
nt_nwavein
&&
!
nt_nwaveout
)
return
(
0
);
if
(
!
nt_nwavein
&&
!
nt_nwaveout
)
return
(
0
);
...
@@ -507,11 +507,11 @@ int mmio_send_dacs(void)
...
@@ -507,11 +507,11 @@ int mmio_send_dacs(void)
if
(
nt_meters
)
if
(
nt_meters
)
{
{
int
i
,
n
;
int
i
,
n
;
float
maxsamp
;
t_
float
maxsamp
;
for
(
i
=
0
,
n
=
2
*
nt_nwavein
*
DEFDACBLKSIZE
,
maxsamp
=
nt_inmax
;
for
(
i
=
0
,
n
=
2
*
nt_nwavein
*
DEFDACBLKSIZE
,
maxsamp
=
nt_inmax
;
i
<
n
;
i
++
)
i
<
n
;
i
++
)
{
{
float
f
=
sys_soundin
[
i
];
t_
float
f
=
sys_soundin
[
i
];
if
(
f
>
maxsamp
)
maxsamp
=
f
;
if
(
f
>
maxsamp
)
maxsamp
=
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
}
}
...
@@ -519,7 +519,7 @@ int mmio_send_dacs(void)
...
@@ -519,7 +519,7 @@ int mmio_send_dacs(void)
for
(
i
=
0
,
n
=
2
*
nt_nwaveout
*
DEFDACBLKSIZE
,
maxsamp
=
nt_outmax
;
for
(
i
=
0
,
n
=
2
*
nt_nwaveout
*
DEFDACBLKSIZE
,
maxsamp
=
nt_outmax
;
i
<
n
;
i
++
)
i
<
n
;
i
++
)
{
{
float
f
=
sys_soundout
[
i
];
t_
float
f
=
sys_soundout
[
i
];
if
(
f
>
maxsamp
)
maxsamp
=
f
;
if
(
f
>
maxsamp
)
maxsamp
=
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
}
}
...
@@ -600,7 +600,7 @@ int mmio_send_dacs(void)
...
@@ -600,7 +600,7 @@ int mmio_send_dacs(void)
for
(
j
=
0
,
fp2
=
fp1
,
sp2
=
sp1
;
j
<
DEFDACBLKSIZE
;
for
(
j
=
0
,
fp2
=
fp1
,
sp2
=
sp1
;
j
<
DEFDACBLKSIZE
;
j
++
,
fp2
++
,
sp2
+=
CHANNELS_PER_DEVICE
)
j
++
,
fp2
++
,
sp2
+=
CHANNELS_PER_DEVICE
)
{
{
*
fp2
=
((
float
)(
1
.
/
32767
.))
*
(
float
)(
*
sp2
);
*
fp2
=
((
t_
float
)(
1
.
/
32767
.))
*
(
t_
float
)(
*
sp2
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment