[Csnd] Reciprocal of a (HRIR) soundfile

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] Reciprocal of a (HRIR) soundfile

SteffenE
Hey list,

so I'm trying to close a little project I started a while ago in which I
want to take a reciprocal of a HRIR file
and convolute it with a different soundfile.
Therefore I could theoretically neutralize the natural head related transfer
function between the loudspeaker and the listeners ears. Of course I have
HRIR files for a lot of angles from which I will decide to choose the
appropriate one for the given angle.
Anyhow.. I'm not very experienced with CSound and I need a bit help.

1. The first part:
 • Converting the HRIR (wav) files to their reciprocal.

   

As you can see I simply take the sample from of the array devide it by 1.
The output message states following:



So CSound wasn't able to open the file.
In case anyone want to test exactly this code with the soundfiles I use:
http://sound.media.mit.edu/resources/KEMAR.html
<http://sound.media.mit.edu/resources/KEMAR.html>  
I've used: *full.zip (1.4M) - Complete set of HRTF measurements, Windows zip
file *

I have no idea whats the problem with the soundfile. As far as I remember,
the documentation of the soundiles states that it contains 512 samples of
16bit integers. In this case I dont have to tell diskin2 the format because
it defaults to 16bit integer samples. I've tried other formats anyway and
got the same result.

Is there anything else I messed up in the opcode?

Stage two of this project has yet to come, in which I plan to make a
convolution via pconvolve.
But I have to get over this problem I described above first and will create
another mail when I run into problems.

Kind regards,
Steffen




--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

joachim-3
hi steffen -

i downloaded the files, unzipped and no problems to play the first one
with diskin.

can you send a complete csd file?

mine is inserted below.  best -

        joachim


<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

instr 1

Sfile = "/home/jh/Downloads/elev0/L0e000a.wav"
print filelen(Sfile)
aSnd diskin Sfile
out aSnd, aSnd

endin

</CsInstruments>
<CsScore>
i 1 0 1
</CsScore>
</CsoundSynthesizer>


new alloc for instr 1:
instr 1:  #i0 = 0.012
diskin2: opened '/home/jh/Downloads/elev0/L0e000a.wav':
          44100 Hz, 1 channel(s), 512 sample frames



On 24/01/18 14:19, SteffenE wrote:

> Hey list,
>
> so I'm trying to close a little project I started a while ago in which I
> want to take a reciprocal of a HRIR file
> and convolute it with a different soundfile.
> Therefore I could theoretically neutralize the natural head related transfer
> function between the loudspeaker and the listeners ears. Of course I have
> HRIR files for a lot of angles from which I will decide to choose the
> appropriate one for the given angle.
> Anyhow.. I'm not very experienced with CSound and I need a bit help.
>
> 1. The first part:
>  • Converting the HRIR (wav) files to their reciprocal.
>
>
>
> As you can see I simply take the sample from of the array devide it by 1.
> The output message states following:
>
>
>
> So CSound wasn't able to open the file.
> In case anyone want to test exactly this code with the soundfiles I use:
> http://sound.media.mit.edu/resources/KEMAR.html
> <http://sound.media.mit.edu/resources/KEMAR.html>
> I've used: *full.zip (1.4M) - Complete set of HRTF measurements, Windows zip
> file *
>
> I have no idea whats the problem with the soundfile. As far as I remember,
> the documentation of the soundiles states that it contains 512 samples of
> 16bit integers. In this case I dont have to tell diskin2 the format because
> it defaults to 16bit integer samples. I've tried other formats anyway and
> got the same result.
>
> Is there anything else I messed up in the opcode?
>
> Stage two of this project has yet to come, in which I plan to make a
> convolution via pconvolve.
> But I have to get over this problem I described above first and will create
> another mail when I run into problems.
>
> Kind regards,
> Steffen
>
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

SteffenE
In reply to this post by SteffenE
Hey Joachim,

there is something strange going on with the preview of my post.
I've put my opcode into a "<"raw">" form and now it doesn't get displayed.
It worked in the preview mode though.

So here is the opcode:

    <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments>

    sr = 44100
    ksmps = 128
    nchnls = 1
    0dbfs = 1.0

    instr 1
            indx = 0
            ar1 init 512
            ar1[] diskin2 "L-40e000a.wav"
    loop:
            ar1[indx] = 1/ar1[indx]
            loop_lt indx, 1, 510, loop
            fout "reci_L-40e000a.wav", 1, ar1
    endin

    </CsInstruments>
    <CsScore>
    ; instrNum startTime duration
    i 1 0 1
    </CsScore>
    </CsoundSynthesizer>

And here is the console output:

    SECTION 1:
    new alloc for instr 1:
    INIT ERROR in instr 1: diskin2: L-40e000a.wav: failed to open file
    ar1 diskin2 "L-40e000a.wav" 1 0 0 0 0 0 0
    Closing file 'reci_L-40e000a.wav'...
          B  0.000 - note deleted.  i1 had 1 init errors
    Score finished in csoundPerform().
    inactive allocs returned to freespace
    end of score.  
    overall amps:  0.00000  0.00000
      overall samples out of range:        0        0
    1 errors in performance
    Elapsed time at end of performance: real: 0.140s, CPU: 0.064s
    closing device
    0 256 sample blks of 64-bit floats written to dac

    Press return to continue

So I see you used diskin.
I've just changed diskin2 to diskin too but the console output still says
diskin2 wasnt able to open the file.





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

joachim-3
"failed to open file" means usually that you are not in the same
directory with your .csd as your audio files are.  can you check this?

perhaps you try to give a full path name in one example to be sure.

your code has some more problems, but perhaps you can check this first.
your error message should disappear once your directory is ok.

best -
        joachim



On 24/01/18 17:27, SteffenE wrote:

> Hey Joachim,
>
> there is something strange going on with the preview of my post.
> I've put my opcode into a "<"raw">" form and now it doesn't get displayed.
> It worked in the preview mode though.
>
> So here is the opcode:
>
>     <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments>
>
>     sr = 44100
>     ksmps = 128
>     nchnls = 1
>     0dbfs = 1.0
>
>     instr 1
>    indx = 0
>    ar1 init 512
>    ar1[] diskin2 "L-40e000a.wav"
>     loop:
>    ar1[indx] = 1/ar1[indx]
>    loop_lt indx, 1, 510, loop
>    fout "reci_L-40e000a.wav", 1, ar1
>     endin
>
>     </CsInstruments>
>     <CsScore>
>     ; instrNum startTime duration
>     i 1 0 1
>     </CsScore>
>     </CsoundSynthesizer>
>
> And here is the console output:
>
>     SECTION 1:
>     new alloc for instr 1:
>     INIT ERROR in instr 1: diskin2: L-40e000a.wav: failed to open file
>     ar1 diskin2 "L-40e000a.wav" 1 0 0 0 0 0 0
>     Closing file 'reci_L-40e000a.wav'...
>  B  0.000 - note deleted.  i1 had 1 init errors
>     Score finished in csoundPerform().
>     inactive allocs returned to freespace
>     end of score.
>     overall amps:  0.00000  0.00000
>       overall samples out of range:        0        0
>     1 errors in performance
>     Elapsed time at end of performance: real: 0.140s, CPU: 0.064s
>     closing device
>     0 256 sample blks of 64-bit floats written to dac
>
>     Press return to continue
>
> So I see you used diskin.
> I've just changed diskin2 to diskin too but the console output still says
> diskin2 wasnt able to open the file.
>
>
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

jpff
In reply to this post by SteffenE
On each k-cycle you try to read 512 samples into the array ar, except ksmps is 128 which feels all wrong. Anyway why not just

   
ar diskin2...
     fout.      ... 1/ar

and hope for no zero samples?



⁣Sent from TypeApp ​

On Jan 24, 2018, 16:27, at 16:27, SteffenE <[hidden email]> wrote:

>Hey Joachim,
>
>there is something strange going on with the preview of my post.
>I've put my opcode into a "<"raw">" form and now it doesn't get
>displayed.
>It worked in the preview mode though.
>
>So here is the opcode:
>
>    <CsoundSynthesizer> <CsOptions> </CsOptions> <CsInstruments>
>
>    sr = 44100
>    ksmps = 128
>    nchnls = 1
>    0dbfs = 1.0
>
>    instr 1
>    indx = 0
>    ar1 init 512
>    ar1[] diskin2 "L-40e000a.wav"
>    loop:
>    ar1[indx] = 1/ar1[indx]
>    loop_lt indx, 1, 510, loop
>    fout "reci_L-40e000a.wav", 1, ar1
>    endin
>
>    </CsInstruments>
>    <CsScore>
>    ; instrNum startTime duration
>    i 1 0 1
>    </CsScore>
>    </CsoundSynthesizer>
>
>And here is the console output:
>
>    SECTION 1:
>    new alloc for instr 1:
>    INIT ERROR in instr 1: diskin2: L-40e000a.wav: failed to open file
>    ar1 diskin2 "L-40e000a.wav" 1 0 0 0 0 0 0
>    Closing file 'reci_L-40e000a.wav'...
>  B  0.000 - note deleted.  i1 had 1 init errors
>    Score finished in csoundPerform().
>    inactive allocs returned to freespace
>    end of score.
>    overall amps:  0.00000  0.00000
>       overall samples out of range:        0        0
>    1 errors in performance
>    Elapsed time at end of performance: real: 0.140s, CPU: 0.064s
>    closing device
>    0 256 sample blks of 64-bit floats written to dac
>
>    Press return to continue
>
>So I see you used diskin.
>I've just changed diskin2 to diskin too but the console output still
>says
>diskin2 wasnt able to open the file.
>
>
>
>
>
>--
>Sent from:
>http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
>Csound mailing list
>[hidden email]
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

SteffenE
@Joachim
Both, the CSD file and the sample is currently on the desktop but I get the
same result.
I've even tried using the full path.

ar1[] diskin2 "/Users/Steffen/Desktop/L-40e000a.wav"

same result.

@Jan
Oh, this means the whole instrument code gets executed each k-cycle right?
Should I place the:
*    ar1 init 512
    ar1 diskin2 "L-40e000a.wav"*
above the instrument code then?





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

joachim-3
perhaps you can post the full console output here, to see whether you
miss anything.

as to the code: it is much easier than you do it.  the main problem is
that you have to care about ar1=0, because then you would perform a
division by zero.

i would do it like this:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 1
nchnls = 1
0dbfs = 1

instr 1

Sfile = "/home/jh/Desktop/L0e000a.wav"
p3 = filelen(Sfile)
aSnd diskin Sfile
if k(aSnd) != 0 then
  aSnd = 1/aSnd
endif
fout "myfile.wav", 18, aSnd

endin

</CsInstruments>
<CsScore>
i 1 0 1
</CsScore>
</CsoundSynthesizer>


        j



On 24/01/18 20:22, SteffenE wrote:

> @Joachim
> Both, the CSD file and the sample is currently on the desktop but I get the
> same result.
> I've even tried using the full path.
>
> ar1[] diskin2 "/Users/Steffen/Desktop/L-40e000a.wav"
>
> same result.
>
> @Jan
> Oh, this means the whole instrument code gets executed each k-cycle right?
> Should I place the:
> *    ar1 init 512
>     ar1 diskin2 "L-40e000a.wav"*
> above the instrument code then?
>
>
>
>
>
> --
> Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

genell
Wouldn’t divz be useful here?
Regards,
Anders

24 jan. 2018 kl. 21:12 skrev joachim heintz <[hidden email]>:

perhaps you can post the full console output here, to see whether you miss anything.

as to the code: it is much easier than you do it.  the main problem is that you have to care about ar1=0, because then you would perform a division by zero.

i would do it like this:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 1
nchnls = 1
0dbfs = 1

instr 1

Sfile = "/home/jh/Desktop/L0e000a.wav"
p3 = filelen(Sfile)
aSnd diskin Sfile
if k(aSnd) != 0 then
aSnd = 1/aSnd
endif
fout "myfile.wav", 18, aSnd

endin

</CsInstruments>
<CsScore>
i 1 0 1
</CsScore>
</CsoundSynthesizer>


   j



On 24/01/18 20:22, SteffenE wrote:
@Joachim
Both, the CSD file and the sample is currently on the desktop but I get the
same result.
I've even tried using the full path.

ar1[] diskin2 "/Users/Steffen/Desktop/L-40e000a.wav"

same result.

@Jan
Oh, this means the whole instrument code gets executed each k-cycle right?
Should I place the:
*    ar1 init 512
   ar1 diskin2 "L-40e000a.wav"*
above the instrument code then?





--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
      https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

joachim-3
yes, that's much easier then; thanks.
        j


On 24/01/18 21:49, Anders Genell wrote:

> Wouldn’t divz be useful here?
> http://csound.com/docs/manual/divz.html
> Regards,
> Anders
>
> 24 jan. 2018 kl. 21:12 skrev joachim heintz <[hidden email]
> <mailto:[hidden email]>>:
>
>> perhaps you can post the full console output here, to see whether you
>> miss anything.
>>
>> as to the code: it is much easier than you do it.  the main problem is
>> that you have to care about ar1=0, because then you would perform a
>> division by zero.
>>
>> i would do it like this:
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> </CsOptions>
>> <CsInstruments>
>>
>> sr = 44100
>> ksmps = 1
>> nchnls = 1
>> 0dbfs = 1
>>
>> instr 1
>>
>> Sfile = "/home/jh/Desktop/L0e000a.wav"
>> p3 = filelen(Sfile)
>> aSnd diskin Sfile
>> if k(aSnd) != 0 then
>> aSnd = 1/aSnd
>> endif
>> fout "myfile.wav", 18, aSnd
>>
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i 1 0 1
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>>    j
>>
>>
>>
>> On 24/01/18 20:22, SteffenE wrote:
>>> @Joachim
>>> Both, the CSD file and the sample is currently on the desktop but I
>>> get the
>>> same result.
>>> I've even tried using the full path.
>>>
>>> ar1[] diskin2 "/Users/Steffen/Desktop/L-40e000a.wav"
>>>
>>> same result.
>>>
>>> @Jan
>>> Oh, this means the whole instrument code gets executed each k-cycle
>>> right?
>>> Should I place the:
>>> *    ar1 init 512
>>>    ar1 diskin2 "L-40e000a.wav"*
>>> above the instrument code then?
>>>
>>>
>>>
>>>
>>>
>>> --
>>> Sent from:
>>> http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>>
>>> Csound mailing list
>>> [hidden email] <mailto:[hidden email]>
>>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>> Send bugs reports to
>>>        https://github.com/csound/csound/issues
>>> Discussions of bugs and features can be posted here
>>>
>>
>> Csound mailing list
>> [hidden email] <mailto:[hidden email]>
>> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>> Send bugs reports to
>>       https://github.com/csound/csound/issues
>> Discussions of bugs and features can be posted here
> Csound mailing list [hidden email]
> <mailto:[hidden email]>
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
> https://github.com/csound/csound/issues Discussions of bugs and features
> can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

forrest
I don't understand exactly how you intend to use the inverse  values ...

but they are going to get painfully strong wherever the original signal gets anywhere near zero. We aren't just talking
'check for zero' here; there might be a safety issue?

(?)

Forrest
San Diego, US

On Wed, Jan 24, 2018 at 12:59 PM, joachim heintz <[hidden email]> wrote:
yes, that's much easier then; thanks.
        j


On 24/01/18 21:49, Anders Genell wrote:
Wouldn’t divz be useful here?
http://csound.com/docs/manual/divz.html
Regards,
Anders

24 jan. 2018 kl. 21:12 skrev joachim heintz <[hidden email]
<mailto:[hidden email]>>:

perhaps you can post the full console output here, to see whether you
miss anything.

as to the code: it is much easier than you do it.  the main problem is
that you have to care about ar1=0, because then you would perform a
division by zero.

i would do it like this:

<CsoundSynthesizer>
<CsOptions>
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 1
nchnls = 1
0dbfs = 1

instr 1

Sfile = "/home/jh/Desktop/L0e000a.wav"
p3 = filelen(Sfile)
aSnd diskin Sfile
if k(aSnd) != 0 then
aSnd = 1/aSnd
endif
fout "myfile.wav", 18, aSnd

endin

</CsInstruments>
<CsScore>
i 1 0 1
</CsScore>
</CsoundSynthesizer>


   j



On 24/01/18 20:22, SteffenE wrote:
@Joachim
Both, the CSD file and the sample is currently on the desktop but I
get the
same result.
I've even tried using the full path.

ar1[] diskin2 "/Users/Steffen/Desktop/L-40e000a.wav"

same result.

@Jan
Oh, this means the whole instrument code gets executed each k-cycle
right?
Should I place the:
*    ar1 init 512
   ar1 diskin2 "L-40e000a.wav"*
above the instrument code then?





--
Sent from:
http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email] <mailto:[hidden email]>
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here


Csound mailing list
[hidden email] <mailto:[hidden email]>
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
      https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list [hidden email]
<mailto:[hidden email]>
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features
can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
       https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Csound mailing list [hidden email] https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

SteffenE
@forrest:

Like I said on the first post I want to neutralize a real/natural HRTF using
a recorded HRIR. Therefore I have to create the opposite of the HRIR and
convolute the sound with it.

@genell:
thx for the input!

I've tried this:


<CsoundSynthesizer>
; <CsOptions></CsOptions>
        <CsInstruments>

        sr = 44100
        ksmps = 1
        nchnls = 1
        0dbfs = 1

instr 1
        Sfile = "/Users/Steffen/Desktop/L-40e000a.wav"
        p3 = filelen(Sfile)
        aSnd diskin Sfile
        aReci divz 1 k(aSnd) 0.0
        fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aSnd
endin

</CsInstruments>
<CsScore>
; instrNum startTime duration
i 1 0 1
</CsScore>
</CsoundSynthesizer>


and get this (full console output):

Steffen$
/var/folders/6s/x_z8sb9j4k976f4rvgdxxs1h0000gn/T/csoundqt_run_script-VI5746.sh
; exit;
csound -b128 -+rtaudio=pa_bl -iadc -odac --env:CSNOSTOP=yes
/Users/Steffen/Desktop/convertHRIR_Files3.csd
virtual_keyboard real time MIDI plugin for Csound
WARNING: STK opodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
0dBFS level = 32768.0
Csound version 6.06 (double samples) Sep 29 2015
libsndfile-1.0.25
WARNING: could not open library
'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjacko.dylib'
(-1)
WARNING: could not open library
'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjackTransport.dylib'
(-1)
WARNING: could not open library
'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/librtjack.dylib'
(-1)
UnifiedCSD:  /Users/Steffen/Desktop/convertHRIR_Files3.csd
STARTING FILE
Creating orchestra
Creating score
WARNING: STK opodes not available: define environment variable RAWWAVE_PATH
(points to rawwaves directory) to use STK opcodes.
rtaudio: PortAudio module enabled ...
using blocking interface
rtmidi: PortMIDI module enabled
Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
sorting score ...
        ... done
Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
--Csound version 6.06 (double samples) Sep 29 2015
graphics suppressed, ascii substituted
0dBFS level = 1.0
orch now loaded
audio buffered in 128 sample-frame blocks
PortAudio V19-devel (built Sep  4 2014 22:30:30)
   0: adc0 (Built-in Microph)
   1: adc1 (Soundflower (2ch))
   2: adc2 (Soundflower (64ch))
   3: adc3 (Pro Tools Aggregate I/O)
   4: adc4 (Loopback Audio)
PortAudio: selected input device 'Soundflower (64ch)'
2018-01-25 15:26:51.873 csound[6994:670624] 15:26:51.872 WARNING:  140: This
application, or a library it uses, is using the deprecated Carbon Component
Manager for hosting Audio Units. Support for this will be removed in a
future release. Also, this makes the host incompatible with version 3 audio
units. Please transition to the API's in AudioComponent.h.
reading 256-byte blks of shorts from adc (RAW)
   0: dac0 (Built-in Output)
   1: dac1 (Soundflower (2ch))
   2: dac2 (Soundflower (64ch))
   3: dac3 (Pro Tools Aggregate I/O)
   4: dac4 (Instant On Sound Effects)
   5: dac5 (Loopback Audio)
   6: dac6 (Multi-Output Device)
PortAudio: selected output device 'Built-in Output'
writing 128 sample blks of 64-bit floats to dac
SECTION 1:
new alloc for instr 1:
INIT ERROR in instr 1: diskinfo cannot open
/Users/Steffen/Desktop/L-40e000a.wav
#i0 filelen Sfile 1
INIT ERROR in instr 1: diskin2: /Users/Steffen/Desktop/L-40e000a.wav: failed
to open file
aSnd diskin Sfile 1 0 0 0 0 0 0 0
Closing file '/Users/Steffen/Desktop/reci_L-40e000a.wav'...
          B  0.000 - note deleted.  i1 had 2 init errors
Score finished in csoundPerform().
inactive allocs returned to freespace
end of score.   overall amps:  0.00000
           overall samples out of range:        0
1 errors in performance
Elapsed time at end of performance: real: 0.154s, CPU: 0.067s
closing device
0 128 sample blks of 64-bit floats written to dac

Press return to continue


Could it be something with the STK lib?
because:
   WARNING: STK opodes not available: define environment variable
RAWWAVE_PATH


Thank you already for this great contribution!



--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

jpff
Nothing to do with the warnings.  It just cannot open the file, so either permissions or the wrong name.  Are you sure about the upper case words? 

⁣Sent from TypeApp ​

On Jan 25, 2018, 14:30, at 14:30, SteffenE <[hidden email]> wrote:

>@forrest:
>
>Like I said on the first post I want to neutralize a real/natural HRTF
>using
>a recorded HRIR. Therefore I have to create the opposite of the HRIR
>and
>convolute the sound with it.
>
>@genell:
>thx for the input!
>
>I've tried this:
>
>
><CsoundSynthesizer>
>; <CsOptions></CsOptions>
> <CsInstruments>
>
> sr = 44100
> ksmps = 1
> nchnls = 1
> 0dbfs = 1
>
>instr 1
> Sfile = "/Users/Steffen/Desktop/L-40e000a.wav"
> p3 = filelen(Sfile)
> aSnd diskin Sfile
> aReci divz 1 k(aSnd) 0.0
> fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aSnd
>endin
>
></CsInstruments>
><CsScore>
>; instrNum startTime duration
>i 1 0 1
></CsScore>
></CsoundSynthesizer>
>
>
>and get this (full console output):
>
>Steffen$
>/var/folders/6s/x_z8sb9j4k976f4rvgdxxs1h0000gn/T/csoundqt_run_script-VI5746.sh
>; exit;
>csound -b128 -+rtaudio=pa_bl -iadc -odac --env:CSNOSTOP=yes
>/Users/Steffen/Desktop/convertHRIR_Files3.csd
>virtual_keyboard real time MIDI plugin for Csound
>WARNING: STK opodes not available: define environment variable
>RAWWAVE_PATH
>(points to rawwaves directory) to use STK opcodes.
>0dBFS level = 32768.0
>Csound version 6.06 (double samples) Sep 29 2015
>libsndfile-1.0.25
>WARNING: could not open library
>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjacko.dylib'
>(-1)
>WARNING: could not open library
>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjackTransport.dylib'
>(-1)
>WARNING: could not open library
>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/librtjack.dylib'
>(-1)
>UnifiedCSD:  /Users/Steffen/Desktop/convertHRIR_Files3.csd
>STARTING FILE
>Creating orchestra
>Creating score
>WARNING: STK opodes not available: define environment variable
>RAWWAVE_PATH
>(points to rawwaves directory) to use STK opcodes.
>rtaudio: PortAudio module enabled ...
>using blocking interface
>rtmidi: PortMIDI module enabled
>Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
>sorting score ...
> ... done
>Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
>--Csound version 6.06 (double samples) Sep 29 2015
>graphics suppressed, ascii substituted
>0dBFS level = 1.0
>orch now loaded
>audio buffered in 128 sample-frame blocks
>PortAudio V19-devel (built Sep  4 2014 22:30:30)
>   0: adc0 (Built-in Microph)
>   1: adc1 (Soundflower (2ch))
>   2: adc2 (Soundflower (64ch))
>   3: adc3 (Pro Tools Aggregate I/O)
>   4: adc4 (Loopback Audio)
>PortAudio: selected input device 'Soundflower (64ch)'
>2018-01-25 15:26:51.873 csound[6994:670624] 15:26:51.872 WARNING:  140:
>This
>application, or a library it uses, is using the deprecated Carbon
>Component
>Manager for hosting Audio Units. Support for this will be removed in a
>future release. Also, this makes the host incompatible with version 3
>audio
>units. Please transition to the API's in AudioComponent.h.
>reading 256-byte blks of shorts from adc (RAW)
>   0: dac0 (Built-in Output)
>   1: dac1 (Soundflower (2ch))
>   2: dac2 (Soundflower (64ch))
>   3: dac3 (Pro Tools Aggregate I/O)
>   4: dac4 (Instant On Sound Effects)
>   5: dac5 (Loopback Audio)
>   6: dac6 (Multi-Output Device)
>PortAudio: selected output device 'Built-in Output'
>writing 128 sample blks of 64-bit floats to dac
>SECTION 1:
>new alloc for instr 1:
>INIT ERROR in instr 1: diskinfo cannot open
>/Users/Steffen/Desktop/L-40e000a.wav
>#i0 filelen Sfile 1
>INIT ERROR in instr 1: diskin2: /Users/Steffen/Desktop/L-40e000a.wav:
>failed
>to open file
>aSnd diskin Sfile 1 0 0 0 0 0 0 0
>Closing file '/Users/Steffen/Desktop/reci_L-40e000a.wav'...
>  B  0.000 - note deleted.  i1 had 2 init errors
>Score finished in csoundPerform().
>inactive allocs returned to freespace
>end of score.   overall amps:  0.00000
>   overall samples out of range:        0
>1 errors in performance
>Elapsed time at end of performance: real: 0.154s, CPU: 0.067s
>closing device
>0 128 sample blks of 64-bit floats written to dac
>
>Press return to continue
>
>
>Could it be something with the STK lib?
>because:
>   WARNING: STK opodes not available: define environment variable
>RAWWAVE_PATH
>
>
>Thank you already for this great contribution!
>
>
>
>--
>Sent from:
>http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>
>Csound mailing list
>[hidden email]
>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>Send bugs reports to
>        https://github.com/csound/csound/issues
>Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

Steven Yi
I wonder if this might be just a bug in older Csound, as the output notes:

Csound version 6.06 (double samples) Sep 29 2015

There's been a lot of fixes since then.  Steffen: Could you try
updating to 6.10?  If the problem persists after that, at least we'd
that information to use to help diagnose.

On Thu, Jan 25, 2018 at 9:37 AM, John ff <[hidden email]> wrote:

> Nothing to do with the warnings.  It just cannot open the file, so either permissions or the wrong name.  Are you sure about the upper case words?
>
> ⁣Sent from TypeApp
>
> On Jan 25, 2018, 14:30, at 14:30, SteffenE <[hidden email]> wrote:
>>@forrest:
>>
>>Like I said on the first post I want to neutralize a real/natural HRTF
>>using
>>a recorded HRIR. Therefore I have to create the opposite of the HRIR
>>and
>>convolute the sound with it.
>>
>>@genell:
>>thx for the input!
>>
>>I've tried this:
>>
>>
>><CsoundSynthesizer>
>>;      <CsOptions></CsOptions>
>>       <CsInstruments>
>>
>>       sr = 44100
>>       ksmps = 1
>>       nchnls = 1
>>       0dbfs = 1
>>
>>instr 1
>>       Sfile = "/Users/Steffen/Desktop/L-40e000a.wav"
>>       p3 = filelen(Sfile)
>>       aSnd diskin Sfile
>>       aReci divz      1 k(aSnd) 0.0
>>       fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aSnd
>>endin
>>
>></CsInstruments>
>><CsScore>
>>;      instrNum                startTime       duration
>>i      1                       0               1
>></CsScore>
>></CsoundSynthesizer>
>>
>>
>>and get this (full console output):
>>
>>Steffen$
>>/var/folders/6s/x_z8sb9j4k976f4rvgdxxs1h0000gn/T/csoundqt_run_script-VI5746.sh
>>; exit;
>>csound -b128 -+rtaudio=pa_bl -iadc -odac --env:CSNOSTOP=yes
>>/Users/Steffen/Desktop/convertHRIR_Files3.csd
>>virtual_keyboard real time MIDI plugin for Csound
>>WARNING: STK opodes not available: define environment variable
>>RAWWAVE_PATH
>>(points to rawwaves directory) to use STK opcodes.
>>0dBFS level = 32768.0
>>Csound version 6.06 (double samples) Sep 29 2015
>>libsndfile-1.0.25
>>WARNING: could not open library
>>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjacko.dylib'
>>(-1)
>>WARNING: could not open library
>>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/libjackTransport.dylib'
>>(-1)
>>WARNING: could not open library
>>'/Library/Frameworks/CsoundLib64.framework/Versions/6.0/Resources/Opcodes64/librtjack.dylib'
>>(-1)
>>UnifiedCSD:  /Users/Steffen/Desktop/convertHRIR_Files3.csd
>>STARTING FILE
>>Creating orchestra
>>Creating score
>>WARNING: STK opodes not available: define environment variable
>>RAWWAVE_PATH
>>(points to rawwaves directory) to use STK opcodes.
>>rtaudio: PortAudio module enabled ...
>>using blocking interface
>>rtmidi: PortMIDI module enabled
>>Elapsed time at end of orchestra compile: real: 0.003s, CPU: 0.003s
>>sorting score ...
>>       ... done
>>Elapsed time at end of score sort: real: 0.003s, CPU: 0.003s
>>--Csound version 6.06 (double samples) Sep 29 2015
>>graphics suppressed, ascii substituted
>>0dBFS level = 1.0
>>orch now loaded
>>audio buffered in 128 sample-frame blocks
>>PortAudio V19-devel (built Sep  4 2014 22:30:30)
>>   0: adc0 (Built-in Microph)
>>   1: adc1 (Soundflower (2ch))
>>   2: adc2 (Soundflower (64ch))
>>   3: adc3 (Pro Tools Aggregate I/O)
>>   4: adc4 (Loopback Audio)
>>PortAudio: selected input device 'Soundflower (64ch)'
>>2018-01-25 15:26:51.873 csound[6994:670624] 15:26:51.872 WARNING:  140:
>>This
>>application, or a library it uses, is using the deprecated Carbon
>>Component
>>Manager for hosting Audio Units. Support for this will be removed in a
>>future release. Also, this makes the host incompatible with version 3
>>audio
>>units. Please transition to the API's in AudioComponent.h.
>>reading 256-byte blks of shorts from adc (RAW)
>>   0: dac0 (Built-in Output)
>>   1: dac1 (Soundflower (2ch))
>>   2: dac2 (Soundflower (64ch))
>>   3: dac3 (Pro Tools Aggregate I/O)
>>   4: dac4 (Instant On Sound Effects)
>>   5: dac5 (Loopback Audio)
>>   6: dac6 (Multi-Output Device)
>>PortAudio: selected output device 'Built-in Output'
>>writing 128 sample blks of 64-bit floats to dac
>>SECTION 1:
>>new alloc for instr 1:
>>INIT ERROR in instr 1: diskinfo cannot open
>>/Users/Steffen/Desktop/L-40e000a.wav
>>#i0    filelen Sfile   1
>>INIT ERROR in instr 1: diskin2: /Users/Steffen/Desktop/L-40e000a.wav:
>>failed
>>to open file
>>aSnd   diskin  Sfile   1       0       0       0       0       0       0       0
>>Closing file '/Users/Steffen/Desktop/reci_L-40e000a.wav'...
>>         B  0.000 - note deleted.  i1 had 2 init errors
>>Score finished in csoundPerform().
>>inactive allocs returned to freespace
>>end of score.             overall amps:  0.00000
>>          overall samples out of range:        0
>>1 errors in performance
>>Elapsed time at end of performance: real: 0.154s, CPU: 0.067s
>>closing device
>>0 128 sample blks of 64-bit floats written to dac
>>
>>Press return to continue
>>
>>
>>Could it be something with the STK lib?
>>because:
>>   WARNING: STK opodes not available: define environment variable
>>RAWWAVE_PATH
>>
>>
>>Thank you already for this great contribution!
>>
>>
>>
>>--
>>Sent from:
>>http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html
>>
>>Csound mailing list
>>[hidden email]
>>https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
>>Send bugs reports to
>>        https://github.com/csound/csound/issues
>>Discussions of bugs and features can be posted here
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>         https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

jpff
In reply to this post by SteffenE
and

> p3 = filelen(Sfile)
> aSnd diskin Sfile
> aReci divz 1 k(aSnd) 0.0
> fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aSnd

surely

        aReci divz      1/k(aSnd), 0.0
        fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aReci

bt I did not notice the old version.  Still cannot explain the failure to
open.

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

jpff
Damn!
aReci divz      1, k(aSnd), 0.0



On Thu, 25 Jan 2018, jpff wrote:

> and
>
>> p3 = filelen(Sfile)
>> aSnd diskin Sfile
>> aReci divz 1 k(aSnd) 0.0
>> fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aSnd
>
> surely
>
>       aReci divz      1/k(aSnd), 0.0
>       fout "/Users/Steffen/Desktop/reci_L-40e000a.wav", 18, aReci
>
> bt I did not notice the old version.  Still cannot explain the failure to
> open.
>
> Csound mailing list
> [hidden email]
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
>       https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
>

Csound mailing list
[hidden email]
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Reciprocal of a (HRIR) soundfile

SteffenE
This post was updated on .
@Steven Yi
Yes, that sounds like a good idea.

@jpff
I've also tried the k(aSnd) cast. I reverted it afterwards because i wasn't
sure if this was really necessary. Thanks for clearing this up.

I'll install the newer Csound now and report back.

Edit: No, it didnt work. I'm actually sure the path is right.
Oh and @jpff

error:  Unable to find opcode entry for 'divz' with matching argument types:
Found: a divz ckc.
when using

aReci divz 1, k(aSnd), 0.0

Edit 2:
I've got to apologize. Sure it was just a typo.. File filename is without the "-".

--
Sent from: http://csound.1045644.n5.nabble.com/Csound-General-f1093014.html

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here