Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: a1adbc3
Choose a base ref
...
head repository: m-labs/flickernoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 5163408
Choose a head ref
  • 2 commits
  • 8 files changed
  • 1 contributor

Commits on Jan 12, 2012

  1. compiler: off-by-one error in forall_syms

    test/wundef found this, but only sometimes.
    wpwrak committed Jan 12, 2012
    Copy the full SHA
    5a386a3 View commit details
  2. added FN variable "frame"

    wpwrak committed Jan 12, 2012
    Copy the full SHA
    5163408 View commit details
Showing with 15 additions and 4 deletions.
  1. +2 −0 src/compiler/compiler.h
  2. +1 −0 src/compiler/fnp.ids
  3. +1 −1 src/compiler/symtab.h
  4. +1 −1 src/compiler/test/nsyms
  5. +3 −1 src/gui/monitor.c
  6. +2 −0 src/renderer/eval.c
  7. +1 −0 src/renderer/framedescriptor.h
  8. +4 −1 src/renderer/sampler.c
2 changes: 2 additions & 0 deletions src/compiler/compiler.h
Original file line number Diff line number Diff line change
@@ -77,6 +77,7 @@ enum {
pfv_tex_wrap,

pfv_time,
pfv_frame,
pfv_bass,
pfv_mid,
pfv_treb,
@@ -164,6 +165,7 @@ enum {
pvv_zoom,

pvv_time,
pvv_frame,
pvv_bass,
pvv_mid,
pvv_treb,
1 change: 1 addition & 0 deletions src/compiler/fnp.ids
Original file line number Diff line number Diff line change
@@ -60,6 +60,7 @@ mv_a pfv_mv_a -1
bTexWrap pfv_tex_wrap -1

time pfv_time pvv_time
frame pfv_frame pvv_frame
bass pfv_bass pvv_bass
mid pfv_mid pvv_mid
treb pfv_treb pvv_treb
2 changes: 1 addition & 1 deletion src/compiler/symtab.h
Original file line number Diff line number Diff line change
@@ -34,7 +34,7 @@ extern int num_user_syms;

#define forall_syms(p) \
for ((p) = well_known; (p) != user_syms+num_user_syms; \
(p) = (p) == well_known+num_well_known ? user_syms : (p)+1)
(p) = (p) == well_known+num_well_known-1 ? user_syms : (p)+1)

void symtab_init(void);
struct sym *unique(const char *s);
2 changes: 1 addition & 1 deletion src/compiler/test/nsyms
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ forall_patches count_syms
echo $max,$ns/$np >_out

expect <<EOF
12,112/60
12,111/60
EOF

###############################################################################
4 changes: 3 additions & 1 deletion src/gui/monitor.c
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ static int appid;

static int w_open;

static float time2;
static float time2, frame;
static float bass, mid, treb;
static float bass_att, mid_att, treb_att;
static float idmx[IDMX_COUNT];
@@ -43,6 +43,7 @@ static void sampler_callback(struct frame_descriptor *frd)
int i;

time2 = frd->time;
frame = frd->frame;

bass = frd->bass;
mid = frd->mid;
@@ -64,6 +65,7 @@ static void sampler_callback(struct frame_descriptor *frd)
static float *get_variable(const char *name)
{
if(strcmp(name, "time") == 0) return &time2;
if(strcmp(name, "frame") == 0) return &frame;

else if(strcmp(name, "bass") == 0) return &bass;
else if(strcmp(name, "mid") == 0) return &mid;
2 changes: 2 additions & 0 deletions src/renderer/eval.c
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ static void transfer_pvv_regs(struct patch *p)
write_pvv(p, pvv_zoom, read_pfv(p, pfv_zoom));

write_pvv(p, pvv_time, read_pfv(p, pfv_time));
write_pvv(p, pvv_frame, read_pfv(p, pfv_frame));
write_pvv(p, pvv_bass, read_pfv(p, pfv_bass));
write_pvv(p, pvv_mid, read_pfv(p, pfv_mid));
write_pvv(p, pvv_treb, read_pfv(p, pfv_treb));
@@ -135,6 +136,7 @@ static void reinit_all_pfv(struct patch *p)
static void set_pfv_from_frd(struct patch *p, struct frame_descriptor *frd)
{
write_pfv(p, pfv_time, frd->time);
write_pfv(p, pfv_time, frd->frame);
write_pfv(p, pfv_bass, frd->bass);
write_pfv(p, pfv_mid, frd->mid);
write_pfv(p, pfv_treb, frd->treb);
1 change: 1 addition & 0 deletions src/renderer/framedescriptor.h
Original file line number Diff line number Diff line change
@@ -49,6 +49,7 @@ struct frame_descriptor {
int status;

float time;
float frame;
struct snd_buffer *snd_buf;
float bass, mid, treb;
float bass_att, mid_att, treb_att;
5 changes: 4 additions & 1 deletion src/renderer/sampler.c
Original file line number Diff line number Diff line change
@@ -104,6 +104,7 @@ static rtems_task sampler_task(rtems_task_argument argument)
frd_callback callback = (frd_callback)argument;
rtems_event_set dummy;
float time;
int frame;

snd_fd = open("/dev/snd", O_RDWR);
if(snd_fd == -1) {
@@ -128,7 +129,8 @@ static rtems_task sampler_task(rtems_task_argument argument)
}
}

time = 0.0;
time = 0;
frame = 0;

while(rtems_event_receive(RTEMS_EVENT_0, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT, &dummy) != RTEMS_SUCCESSFUL) {
struct snd_buffer *recorded_buf;
@@ -188,6 +190,7 @@ static rtems_task sampler_task(rtems_task_argument argument)
recorded_descriptor = (struct frame_descriptor *)recorded_buf->user;
/* Analyze */
analyze_snd(recorded_descriptor, &history);
recorded_descriptor->frame = frame++;
recorded_descriptor->time = time;
time += 1.0/FPS;
/* Get DMX/OSC/MIDI inputs */