Showing the changes to python (1 of 1 file). Show all
Unified · Split
| @@ -5,7 +5,8 @@ import aubio · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | if __name__ == '__main__': |
| 7 | 7 | if len(sys.argv) < 3: |
| 8 | − print('usage: %s <inputfile> <outputfile> [transpose] [samplerate] [hop_size]' % sys.argv[0]) | |
| 8 | + print('usage: %s <inputfile> <outputfile> [transpose] [samplerate] [hop_size] [mode]' % sys.argv[0]) | |
| 9 | + print('available modes: default, crispness:0, crispness:1, ... crispness:6') | |
| 9 | 10 | sys.exit(1) |
| 10 | 11 | if len(sys.argv) > 3: transpose = float(sys.argv[3]) |
| 11 | 12 | else: transpose = 12. |
| @@ -13,12 +14,14 @@ if __name__ == '__main__': · 1 unmodified line | ||
| 13 | 14 | else: samplerate = 0 |
| 14 | 15 | if len(sys.argv) > 5: hop_size = int(sys.argv[5]) |
| 15 | 16 | else: hop_size = 256 |
| 17 | + if len(sys.argv) > 6: mode = sys.argv[6] | |
| 18 | + else: mode = available_modes[0] | |
| 16 | 19 | |
| 17 | 20 | source_read = aubio.source(sys.argv[1], samplerate, hop_size) |
| 18 | 21 | if samplerate == 0: samplerate = source_read.samplerate |
| 19 | 22 | sink_out = aubio.sink(sys.argv[2], samplerate) |
| 20 | 23 | |
| 21 | − pitchshifter = aubio.pitchshift("default", 1., hop_size, samplerate) | |
| 24 | + pitchshifter = aubio.pitchshift(mode, 1., hop_size, samplerate) | |
| 22 | 25 | if transpose: pitchshifter.set_transpose(transpose) |
| 23 | 26 | |
| 24 | 27 | total_frames, read = 0, hop_size |