Thanks a lot for this "replacement" code which works very well now.

I can make instruments with my own IR ... Wonderful !

Virginie

Le lun. 21 janv. 2019 à 18:10, Romain Michon <rmnmic...@gmail.com> a écrit :

> Hi Virginie,
>
> There was actually an issue with the definition of modalModel which I just
> fixed. This change might take some time to be reflected on the main
> repository. Also, it seems that ir2dsp doesn't use that function properly
> (no need to place the array a value in a take since modalModel already
> takes care of it).
>
> For reference, here's a working of the code that you sent:
>
> import("stdfaust.lib");
> nModes = 16;
>
> modeFrequencies=(510.0,622.0,916.6666666666666,1029.3333333333333,1212.6666666666665,1315.3333333333333,1496.6666666666665,1657.3333333333333,1820.6666666666665,2019.3333333333333,2358.6666666666665,2534.0,2652.0,2802.6666666666665,2946.6666666666665,3319.333333333333);
>
> massEigenValues=(0.7632999698692908,0.16355214794579387,0.2437629599769164,0.4669077030163351,0.5936267149823993,0.11437497826055203,0.12382368293629044,0.3220633399108091,0.13414751105069078,0.4434567262810993,0.20548994992757408,0.4203015037799922,1.0,0.18643409371607567,0.14579377779794966,0.11911179255542446);
>
> t60=(0.20955657477432674,0.20955657477432674,0.29334786011825087,0.24446961010177806,0.24446961010177806,0.20955657477432674,0.14671311285932173,0.20955657477432674,0.14671311285932173,0.18337179862758657,0.0978348684239287,0.06117619242259182,0.14671311285932173,0.09172508839273395,0.14671311285932173,0.0978348684239287);
>
> modalModel(n,modeFreqs,modeRes,modeGains) = _ <:
> par(i,n,gain(i)*pm.modeFilter(freqs(i),res(i))) :> _
> with{
> freqs(i) = ba.take(i+1,modeFreqs);
> res(i) = ba.take(i+1,modeRes);
> gain(i) = ba.take(i+1,modeGains);
> };
>
> test_model2 = modalModel(nModes,modeFrequencies,t60,massEigenValues);
> gate = button("gate");
> process = pm.impulseExcitation(gate) : test_model2 <: _,_;
>
> @PA Grumiaux <pierreamaury.grumi...@gmail.com> : could you send me the
> updated version of ir2dsp once it will include these fixes so that I can
> add it to the Faust repo?
>
> Thanks!
>
> Romain
>
> On Mon, Jan 21, 2019 at 8:51 AM Virginie YK <virginie...@gmail.com> wrote:
>
>>
>> Thanks a lot Sebastien. Well, all the dependancies are installed ...
>>
>> In between, Pierre Amaury Grumiaux - who wrote the script - answered me
>> and gave me a new version of the ir2dsp file, that I attach to this mail.
>> He encountered the same problem as me, and I am very surprised that you
>> didn't encounter it and could make the creation I could here on Soundcloud
>> (thanx for the link).
>>
>> So, with this new Python file, I can create my dsp file now.
>>
>> But now, when I run it (on the Faust Online Editor ... I'm a windows user
>> ;-) .... ) the following error message appears :
>>
>> *BoxIdent[take] is defined here :
>> https://faust.grame.fr/tools/editor/libraries/basics.lib:589
>> <https://faust.grame.fr/tools/editor/libraries/basics.lib:589>*
>>
>> As I understand it, the compiler is trying to redefine *ba.take *which
>> is a function already known in the standard lib.
>> So, it doesn't want to do it.... but I can't see why the compiler is
>> considering that using a loop is re-defining a function !!!
>> The only time ba.take is used is in this case :
>>
>> modeT60 = par(i,nModes,ba.take(i+1,t60));
>>
>> I attached the (simple) dsp file.
>>
>> Any Faust-user has an idea ?
>> Thanks
>> Virginie
>>
>>
>>
>> Le lun. 21 janv. 2019 à 00:05, Sébastien Clara <sebastiencl...@no-log.org>
>> a écrit :
>>
>>> Hi,
>>>
>>> Make sure you have installed dependencies :
>>>
>>> pip install scipy
>>> pip install matplotlib
>>> pip install peakutils
>>>
>>> Then you will be able to execute the script : python ir2dsp.py test.wav 
>>> test_model
>>> -20 100. You will find attached the script that allowed me to build dsp
>>> files for cabinet impulses.
>>>
>>> With the Guitarix project on Faust, you will have opportunities to work
>>> on your timbre and make cool sounds. If you wish, you can listen to my
>>> latest creation : https://soundcloud.com/s-bastien-clara/phantom-limb
>>>
>>> Cheers,
>>>
>>> Sébastien
>>>
>>>
>>> Le 13/01/2019 à 23:13, Virginie YK a écrit :
>>>
>>> Hi
>>>
>>> I'm trying to use ir2dsp although I don't know Python at all.
>>> Anyway, I could finally install it on my PC. Now, in the Windows command
>>> line, I type :
>>> python ir2dsp.py test.wav test_model.dsp -20 100
>>>
>>> where test.wav is a short file supposed to be a kind of Impusionnal
>>> Response, test_model.dsp is the resulting model file ; -20 ("Minimum value
>>> of peaks in dB (between -infinity and 0)" and 100 Hz (Minimum distance
>>> between two peaks in Hertz).
>>>
>>> The result is the following message :
>>>
>>> C:\Users\User\AppData\Roaming\Python\Python37\site-packages\scipy\io\wavfile.py:273:
>>> *WavFileWarning: Chunk (non-data) not understood, skipping it.*
>>>   WavFileWarning)
>>> Traceback (most recent call last):
>>>
>>>
>>> *  File "ir2dsp.py", line 32, in <module>     x = x/max(x) ValueError:
>>> The truth value of an array with more than one element is ambiguous. Use
>>> a.any() or a.all()*
>>>
>>> Is it a bug or are there any condition on the input file (the wave file)
>>> that I don't know ? I chose a very short and easy input file of 345 Ko.
>>>
>>> In fact, I can't use ir2dsp ........ could you help me please ?
>>>
>>> Thanks
>>> Virginie
>>>
>>>
>>
>>
>> _______________________________________________
>> Faudiostream-users mailing list
>> Faudiostream-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/faudiostream-users
>>
>
>
> --
>
> Romain Michon
> +33 (0)7 67 39 72 40http://grame.fr/~michon
>
>
_______________________________________________
Faudiostream-users mailing list
Faudiostream-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/faudiostream-users

Reply via email to