Changeset c34336e
- Timestamp:
- Dec 17, 2013, 5:13:28 PM (11 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 941c9f9
- Parents:
- 5d10ac1
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubionotes.c
r5d10ac1 rc34336e 52 52 53 53 aubio_pitch_do (pitch, ibuf, pitch_obuf); 54 smpl_t new_pitch = fvec_ read_sample(pitch_obuf, 0);54 smpl_t new_pitch = fvec_get_sample(pitch_obuf, 0); 55 55 if(median){ 56 56 note_append(note_buffer, new_pitch); … … 59 59 /* curlevel is negatif or 1 if silence */ 60 60 smpl_t curlevel = aubio_level_detection(ibuf, silence_threshold); 61 if (fvec_ read_sample(onset, 0)) {61 if (fvec_get_sample(onset, 0)) { 62 62 /* test for silence */ 63 63 if (curlevel == 1.) { -
examples/aubioonset.c
r5d10ac1 rc34336e 34 34 fvec_zeros(obuf); 35 35 aubio_onset_do (o, ibuf, onset); 36 is_onset = fvec_ read_sample(onset, 0);36 is_onset = fvec_get_sample(onset, 0); 37 37 if ( is_onset ) { 38 38 aubio_wavetable_play ( wavetable ); -
examples/aubiopitch.c
r5d10ac1 rc34336e 33 33 fvec_zeros(obuf); 34 34 aubio_pitch_do (o, ibuf, pitch); 35 smpl_t freq = fvec_ read_sample(pitch, 0);35 smpl_t freq = fvec_get_sample(pitch, 0); 36 36 aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) ); 37 37 aubio_wavetable_set_freq ( wavetable, freq ); … … 45 45 void 46 46 process_print (void) { 47 smpl_t pitch_found = fvec_ read_sample(pitch, 0);47 smpl_t pitch_found = fvec_get_sample(pitch, 0); 48 48 outmsg("%f %f\n",(blocks) 49 49 *hop_size/(float)samplerate, pitch_found); … … 70 70 if (pitch_unit != NULL) 71 71 aubio_pitch_set_unit (o, pitch_unit); 72 72 73 pitch = new_fvec (1); 73 74 -
examples/aubiotrack.c
r5d10ac1 rc34336e 29 29 fvec_t * tempo_out; 30 30 smpl_t is_beat = 0; 31 smpl_t is_onset = 0;32 31 uint_t is_silence = 0.; 33 32 34 33 void process_block(fvec_t * ibuf, fvec_t *obuf) { 35 34 aubio_tempo_do (tempo, ibuf, tempo_out); 36 is_beat = fvec_read_sample (tempo_out, 0); 37 is_onset = fvec_read_sample (tempo_out, 1); 35 is_beat = fvec_get_sample (tempo_out, 0); 38 36 if (silence_threshold != -90.) 39 37 is_silence = aubio_silence_detection(ibuf, silence_threshold); … … 54 52 outmsg("%f\n", aubio_tempo_get_last_s(tempo) ); 55 53 } 56 //if ( is_onset )57 // outmsg(" \t \t%f\n",(blocks)*hop_size/(float)samplerate);58 54 } 59 55 -
examples/jackio.c
r5d10ac1 rc34336e 253 253 for (j=0;j<(unsigned)nframes;j++) { 254 254 /* put synthnew in output */ 255 output[0][j] = fvec_ read_sample(dev->obuf, dev->pos);255 output[0][j] = fvec_get_sample(dev->obuf, dev->pos); 256 256 /* write input to datanew */ 257 fvec_ write_sample(dev->ibuf, input[0][j], dev->pos);257 fvec_set_sample(dev->ibuf, input[0][j], dev->pos); 258 258 /*time for fft*/ 259 259 if (dev->pos == (int)(dev->hop_size) - 1) { -
src/fvec.c
r5d10ac1 rc34336e 37 37 } 38 38 39 void fvec_ write_sample(fvec_t *s, smpl_t data, uint_t position) {39 void fvec_set_sample(fvec_t *s, smpl_t data, uint_t position) { 40 40 s->data[position] = data; 41 41 } 42 42 43 smpl_t fvec_ read_sample(fvec_t *s, uint_t position) {43 smpl_t fvec_get_sample(fvec_t *s, uint_t position) { 44 44 return s->data[position]; 45 45 } … … 59 59 } 60 60 61 void fvec_set (fvec_t *s, smpl_t val) {61 void fvec_set_all (fvec_t *s, smpl_t val) { 62 62 uint_t j; 63 63 for (j=0; j< s->length; j++) { … … 70 70 memset(s->data, 0, s->length * sizeof(smpl_t)); 71 71 #else 72 fvec_set (s, 0.);72 fvec_set_all (s, 0.); 73 73 #endif 74 74 } 75 75 76 76 void fvec_ones(fvec_t *s) { 77 fvec_set (s, 1.);77 fvec_set_all (s, 1.); 78 78 } 79 79 -
src/fvec.h
r5d10ac1 rc34336e 76 76 */ 77 77 fvec_t * new_fvec(uint_t length); 78 78 79 /** fvec_t buffer deletion function 79 80 … … 82 83 */ 83 84 void del_fvec(fvec_t *s); 85 84 86 /** read sample value in a buffer 85 87 … … 92 94 93 95 */ 94 smpl_t fvec_read_sample(fvec_t *s, uint_t position); 96 smpl_t fvec_get_sample(fvec_t *s, uint_t position); 97 95 98 /** write sample value in a buffer 96 99 … … 104 107 105 108 */ 106 void fvec_ write_sample(fvec_t *s, smpl_t data, uint_t position);109 void fvec_set_sample(fvec_t *s, smpl_t data, uint_t position); 107 110 108 111 /** read data from a buffer … … 130 133 131 134 */ 132 void fvec_set (fvec_t *s, smpl_t val);135 void fvec_set_all (fvec_t *s, smpl_t val); 133 136 134 137 /** set all elements to zero -
tests/src/spectral/test-phasevoc-jack.c
r5d10ac1 rc34336e 75 75 for (i=0;i<channels;i++) { 76 76 /* write input to datanew */ 77 fvec_ write_sample(in[i], input[i][j], pos);77 fvec_set_sample(in[i], input[i][j], pos); 78 78 /* put synthnew in output */ 79 output[i][j] = fvec_ read_sample(out[i], pos);79 output[i][j] = fvec_get_sample(out[i], pos); 80 80 } 81 81 /*time for fft*/ -
tests/src/spectral/test-phasevoc.c
r5d10ac1 rc34336e 15 15 16 16 // fill input with some data 17 fvec_set (in, 1.);17 fvec_set_all (in, 1.); 18 18 fvec_print (in); 19 19
Note: See TracChangeset
for help on using the changeset viewer.