Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Jonathan Wilkes
purr-data
Commits
65f1a0ef
Commit
65f1a0ef
authored
Sep 23, 2018
by
Jonathan Wilkes
Browse files
Merge branch 'update-mmio'
parents
3a75d018
03bc20b9
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/s_audio_mmio.c
View file @
65f1a0ef
...
...
@@ -32,12 +32,12 @@ int nt_realdacblksize;
#define MAXBUFFER 100
/* number of buffers in use at maximum advance */
#define DEFBUFFER 30
/* default is about 30x6 = 180 msec! */
static
int
nt_naudiobuffer
=
DEFBUFFER
;
float
sys_dacsr
=
DEFAULTSRATE
;
t_
float
sys_dacsr
=
DEFAULTSRATE
;
static
int
nt_whichapi
=
API_MMIO
;
static
int
nt_meters
;
/* true if we're metering */
static
float
nt_inmax
;
/* max input amplitude */
static
float
nt_outmax
;
/* max output amplitude */
static
t_
float
nt_inmax
;
/* max input amplitude */
static
t_
float
nt_outmax
;
/* max output amplitude */
static
int
nt_nwavein
,
nt_nwaveout
;
/* number of WAVE devices in and out */
typedef
struct
_sbuf
...
...
@@ -489,7 +489,7 @@ void nt_logerror(int which)
/* system buffer with t_sample types for one tick */
t_sample
*
sys_soundout
;
t_sample
*
sys_soundin
;
float
sys_dacsr
;
t_
float
sys_dacsr
;
int
mmio_send_dacs
(
void
)
{
...
...
@@ -498,7 +498,7 @@ int mmio_send_dacs(void)
HANDLE
hFormat
;
int
i
,
j
;
short
*
sp1
,
*
sp2
;
float
*
fp1
,
*
fp2
;
t_
float
*
fp1
,
*
fp2
;
int
nextfill
,
doxfer
=
0
;
int
nda
,
nad
;
if
(
!
nt_nwavein
&&
!
nt_nwaveout
)
return
(
0
);
...
...
@@ -507,11 +507,11 @@ int mmio_send_dacs(void)
if
(
nt_meters
)
{
int
i
,
n
;
float
maxsamp
;
t_
float
maxsamp
;
for
(
i
=
0
,
n
=
2
*
nt_nwavein
*
DEFDACBLKSIZE
,
maxsamp
=
nt_inmax
;
i
<
n
;
i
++
)
{
float
f
=
sys_soundin
[
i
];
t_
float
f
=
sys_soundin
[
i
];
if
(
f
>
maxsamp
)
maxsamp
=
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
}
...
...
@@ -519,7 +519,7 @@ int mmio_send_dacs(void)
for
(
i
=
0
,
n
=
2
*
nt_nwaveout
*
DEFDACBLKSIZE
,
maxsamp
=
nt_outmax
;
i
<
n
;
i
++
)
{
float
f
=
sys_soundout
[
i
];
t_
float
f
=
sys_soundout
[
i
];
if
(
f
>
maxsamp
)
maxsamp
=
f
;
else
if
(
-
f
>
maxsamp
)
maxsamp
=
-
f
;
}
...
...
@@ -600,7 +600,7 @@ int mmio_send_dacs(void)
for
(
j
=
0
,
fp2
=
fp1
,
sp2
=
sp1
;
j
<
DEFDACBLKSIZE
;
j
++
,
fp2
++
,
sp2
+=
CHANNELS_PER_DEVICE
)
{
*
fp2
=
((
float
)(
1
.
/
32767
.))
*
(
float
)(
*
sp2
);
*
fp2
=
((
t_
float
)(
1
.
/
32767
.))
*
(
t_
float
)(
*
sp2
);
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment