; Csound orchestra file for resynthesizing sounds that were analysed with ; the fftw2csound program (that uses a Blackman-Harris window). ; COPYLEFT 2021, january 27 - Pieter Suurmond. ; ; Type for example: ; csound -o resynth.wav -W resynth.orc Sine440.aiff.sco sr = 44100 kr = 44100 ksmps = 1; kr * ksmps moet gelijk sr zijn. nchnls = 1 ;------------------------------------------ BLACKMAN-HARRIS ENVELOPE SINE PLAYER ; GEN20 Generates functions of different windows. ; Syntax: f # time size 20 window max ; size -- number of points in the table. Must be power of 2 (+1). ; window -- Type of window to generate: ; 1 = Hamming ; 2 = Hanning ; 3 = Bartlett (triangle) ; 4 = Blackman (3-term) ; 5 = Blackman-Harris (4-term) ; max -- For negative p4 this will be the absolute value at window peak point. ; If p4 is positive or p4 is negative and p6 is missing the table will be post- ; rescaled to a maximum value of 1. ; Example: f85 0 8192 20 5 1 ;------------------------------------- giEnv ftgen 0, 0, 8192, 20, 5, 1; 5 = Blackman Harris envelope. instr 1 ; Read envelope once during the note's duration: aEnv poscil p5, 1/p3, giEnv ; p3 = TOTALE tijdsduur in seconden. ; p4 = frequentie in hertz. a1 poscil aEnv, p4; p5 = lineaire amplitude. out a1 endin