| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-n -m0 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 32 |
| 8 |
nchnls = 1 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
;Some macros |
| 12 |
#define ATS_SR # 0 # ;sample rate (Hz) |
| 13 |
#define ATS_FS # 1 # ;frame size (samples) |
| 14 |
#define ATS_WS # 2 # ;window Size (samples) |
| 15 |
#define ATS_NP # 3 # ;number of Partials |
| 16 |
#define ATS_NF # 4 # ;number of Frames |
| 17 |
#define ATS_AM # 5 # ;maximum Amplitude |
| 18 |
#define ATS_FM # 6 # ;maximum Frequency (Hz) |
| 19 |
#define ATS_DU # 7 # ;duration (seconds) |
| 20 |
#define ATS_TY # 8 # ;ATS file Type |
| 21 |
|
| 22 |
instr 1 |
| 23 |
iats_file=p4 |
| 24 |
;instr1 just reads the file header and loads its data into several variables |
| 25 |
;and prints the result in the Csound prompt. |
| 26 |
i_sampling_rate ATSinfo iats_file, $ATS_SR |
| 27 |
i_frame_size ATSinfo iats_file, $ATS_FS |
| 28 |
i_window_size ATSinfo iats_file, $ATS_WS |
| 29 |
i_number_of_partials ATSinfo iats_file, $ATS_NP |
| 30 |
i_number_of_frames ATSinfo iats_file, $ATS_NF |
| 31 |
i_max_amp ATSinfo iats_file, $ATS_AM |
| 32 |
i_max_freq ATSinfo iats_file, $ATS_FM |
| 33 |
i_duration ATSinfo iats_file, $ATS_DU |
| 34 |
i_ats_file_type ATSinfo iats_file, $ATS_TY |
| 35 |
|
| 36 |
print i_sampling_rate |
| 37 |
print i_frame_size |
| 38 |
print i_window_size |
| 39 |
print i_number_of_partials |
| 40 |
print i_number_of_frames |
| 41 |
print i_max_amp |
| 42 |
print i_max_freq |
| 43 |
print i_duration |
| 44 |
print i_ats_file_type |
| 45 |
|
| 46 |
endin |
| 47 |
|
| 48 |
</CsInstruments> |
| 49 |
<CsScore> |
| 50 |
;change to put any ATS file you like |
| 51 |
#define ats_file #"basoon-C4.ats"# |
| 52 |
; st dur atsfile |
| 53 |
i1 0 0 $ats_file |
| 54 |
e |
| 55 |
</CsScore> |
| 56 |
</CsoundSynthesizer> |
| 57 |
;Example by Oscar Pablo Di Liscia |