Skip to content

Commit

Permalink
Cleaning up some unneeded comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Mellmer authored and Ryan Mellmer committed Mar 8, 2017
1 parent f3ad811 commit 4d96db4
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 40 deletions.
6 changes: 0 additions & 6 deletions AudioSynthWavetable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ void AudioSynthWavetable::update(void) {
tone_incr_offset = multiply_accumulate_32x32_rshift32_rounded(tone_incr_offset, vib_scale, vib_pitch_offset);

tone_incr_offset += (int32_t(vib_scale>>15) * vib_pitch_offset) >> 15;

//int16_t vib_scale = (((vib_phase - 0x40000000) & 0x80000000) ? vib_phase : (0x7FFFFFFF - vib_phase)) >> 15;
//tone_incr_offset += (int32_t(vib_scale) * (vib_scale >= 0 ? vib_pitch_offset_init : vib_pitch_offset_scnd)) >> 15;
}

int32_t mod_amp = tone_amp;
Expand All @@ -213,7 +210,6 @@ void AudioSynthWavetable::update(void) {

int32_t mod_pitch_offset = mod_scale >= 0 ? mod_pitch_offset_init : mod_pitch_offset_scnd;
tone_incr_offset = multiply_accumulate_32x32_rshift32_rounded(tone_incr_offset, mod_scale, mod_pitch_offset);
//tone_incr_offset += (int32_t(mod_scale>>15) * mod_pitch_offset) >> 15;

int32_t mod_offset = (mod_scale >= 0 ? s->MODULATION_AMPLITUDE_INITIAL_GAIN : s->MODULATION_AMPLITUDE_SECOND_GAIN);
mod_scale = multiply_32x32_rshift32(mod_scale, mod_offset);
Expand All @@ -231,7 +227,6 @@ void AudioSynthWavetable::update(void) {
tone_phase += tone_incr + tone_incr_offset;
if (s->LOOP == false && tone_phase >= s->MAX_PHASE) break;
tone_phase = s->LOOP && tone_phase >= s->LOOP_PHASE_END ? tone_phase - s->LOOP_PHASE_LENGTH : tone_phase;
//tone_phase = tone_phase >= s->LOOP_PHASE_END ? tone_phase - s->LOOP_PHASE_LENGTH : tone_phase;

index = tone_phase >> (32 - s->INDEX_BITS);
tmp1 = *((uint32_t*)(s->sample + index));
Expand All @@ -245,7 +240,6 @@ void AudioSynthWavetable::update(void) {
tone_phase += tone_incr + tone_incr_offset;
if (s->LOOP == false && tone_phase >= s->MAX_PHASE) break;
tone_phase = s->LOOP && tone_phase >= s->LOOP_PHASE_END ? tone_phase - s->LOOP_PHASE_LENGTH : tone_phase;
//tone_phase = tone_phase >= s->LOOP_PHASE_END ? tone_phase - s->LOOP_PHASE_LENGTH : tone_phase;
}
}
); //end TIME_TEST
Expand Down
4 changes: 0 additions & 4 deletions AudioSynthWavetable.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#define DEFAULT_AMPLITUDE 127
#define SAMPLES_PER_MSEC (AUDIO_SAMPLE_RATE_EXACT/1000.0)
#define TRIANGLE_INITIAL_PHASE (-0x40000000)

// int n in range 1..log2(AUDIO_BLOCK_SAMPLES/2)-1 (1..7 for AUDIO_BLOCK_SAMPLES == 128)
// where AUDIO_BLOCK_SAMPLES%n == 0, higher == more smooth and more CPU usage
#define LFO_SMOOTHNESS 3
#define LFO_PERIOD (AUDIO_BLOCK_SAMPLES/(1 << (LFO_SMOOTHNESS-1)))

Expand Down Expand Up @@ -106,7 +103,6 @@ class AudioSynthWavetable : public AudioStream
* @return a frequency
*/
static float noteToFreq(int note) {
//440.0 * pow(2.0, (note - 69) / 12.0);
float exp = note * (1.0 / 12.0) + 3.0313597;
return powf(2.0, exp);
}
Expand Down
5 changes: 0 additions & 5 deletions controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ def instrumentSelected(self, _selection):
idxs = _selection
if len(idxs) == 1:
self.model.setCurrInstrument(int(idxs[0]))
# self.model.update_samples()
#TODO set curr in view
curr_inst = self.model.getCurrInstrument()
self.view.setSampleList(curr_inst.samplesForDisplay())
#reset size labels
Expand Down Expand Up @@ -95,9 +93,6 @@ def decode(self, _selection):
elif out_name != default_name_check:
pass

# TODO user supplied filepath after updating decoder.py
# 2/28/2017

for samp in self.model.getCurrSamples():
selected_bags.append(samp.bag_idx)
if decoder.decode_selected(inFile, curr_inst.getOriginalIndex(),
Expand Down
24 changes: 0 additions & 24 deletions decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,6 @@ def gen_sample_meta_data_string(bag, global_bag, sample_num, instrument_name, ke
# Checks if the selected sample is valid. Input is a sample object, and output is
# a tuple with (boolean, error_message - if any)
def check_is_valid_sample(sample):
if sample.loop_duration >= sample.duration:
return False, 'Loop length >= sample length'
if sample.end_loop > sample.duration:
return False, 'End loop index is larger than sample end index'
return True, None
Expand Down Expand Up @@ -413,27 +411,5 @@ def error(message):
print("ERROR: " + message)


# Copying functionality from wav2sketch.c
# Currently unused
def ulaw_encode(audio):
if audio >= 0:
mag = audio
neg = 0
else:
mag = audio * -1
neg = 0x80

mag += 128
if mag > 0x7FFF: mag = 0x7FFF
if mag >= 0x4000: return neg | 0x70 | ((mag >> 10) & 0x0F) # 01wx yz00 0000 0000
if mag >= 0x2000: return neg | 0x60 | ((mag >> 9) & 0x0F) # 001w xyz0 0000 0000
if mag >= 0x1000: return neg | 0x50 | ((mag >> 8) & 0x0F) # 0001 wxyz 0000 0000
if mag >= 0x0800: return neg | 0x40 | ((mag >> 7) & 0x0F) # 0000 1wxy z000 0000
if mag >= 0x0400: return neg | 0x30 | ((mag >> 6) & 0x0F) # 0000 01wx yz00 0000
if mag >= 0x0200: return neg | 0x20 | ((mag >> 5) & 0x0F) # 0000 001w xyz0 0000
if mag >= 0x0100: return neg | 0x10 | ((mag >> 4) & 0x0F) # 0000 0001 wxyz 0000
return neg | 0x00 | ((mag >> 3) & 0x0F) # 0000 0000 1wxy z000


if __name__ == "__main__":
main(sys.argv[1:])
1 change: 0 additions & 1 deletion sf2elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def setGlobalBag(self, index):

class Sample:
def __init__(self, s_name, bag_idx, key_range, size):
# self.ownder = owner
self.s_name = s_name
self.bag_idx = bag_idx
self.key_range = key_range
Expand Down

0 comments on commit 4d96db4

Please sign in to comment.