Quantcast

different responses of OnSets under windows and linux/mac

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

different responses of OnSets under windows and linux/mac

altern
hi

I am using the same code with OnSets on different OSs and I get rather
different responses under Windows than under Linux and Mac. In both
windows and Linux I am using the same hardware. In mac I only change the
computer, the sound card and mic are the same in the three OSs. The
incoming signal from the microphone looks pretty much the same amplitude
in the localhost levels. The windows version of supercollider is 3.8.0,
same form Mac. Linux supercollider version is 3.6.6

On windows I have to lower the threshold a lotto get the hits detected
and then I get loads of re-triggering, to compensate I need to raise the
relaxtime but then I get even more re-triggering, this is just the
opposite the documentation says. So I end up lowering the threshold and
lowering the relaxtime, check the code below. Notice that I have to use
very different setup parameters for Windows in order to get any decent
response.

This looks to me like a bug, sorry if this has been discussed before, I
am on a very bad internet connection and I can only used it for email
and little more...

thanks




(
s.boot;

SynthDef(\hits, { |in=0, gain=1, threshold=0.6, relaxtime=2.1,
floor=0.1, mingap=1, offset=0.04|
        var fft, fft2, onset, chroma, keyt, signal, level=0, freq=0,
hasfreq=false, del;
        signal = SoundIn.ar(in)*gain;
        level = WAmp.kr(signal, offset);
        fft = FFT(LocalBuf(2048), signal);
        onset = Onsets.kr(fft, threshold, \rcomplex, relaxtime, floor, mingap,
medianspan:11, whtype:1, rawodf:0);

        SendReply.kr(onset, '/onset', [level]);
}).store;


{
        // LINUX and MAC ok
        Synth(\hits, [
                                \in, 0,
                                \gain, 0.98,
                                \threshold, 0.38,
                                \relaxtime, 0.0024,
                                \floor, 0.069,
                                \mingap, 1
        ]);

        // WINDOWS kind of works...
        /*Synth(\hits, [
                                \in, 0,
                                \gain, 1, // just to control input level
                                \threshold, 0.07, // needs much lowe values on windows despite
signal being strong
                                \relaxtime, 0.00024, // if I INCREASE this value I get more
re-triggering!
                                \floor, 0.01,
                                \mingap, 2
        ]);*/

        OSCdef(\onsetOSCdef, {|msg, time, addr, recvPort|
                msg.postln;
        }, '/onset', s.addr);

}.defer(1);

)








enrike

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

ddw_music
altern wrote
I am using the same code with OnSets on different OSs and I get rather
different responses under Windows than under Linux and Mac. In both
windows and Linux I am using the same hardware. In mac I only change the
computer, the sound card and mic are the same in the three OSs. The
incoming signal from the microphone looks pretty much the same amplitude
in the localhost levels. The windows version of supercollider is 3.8.0,
same form Mac. Linux supercollider version is 3.6.6
One suggestion for troubleshooting is to eliminate as much indeterminacy from the tests. Instead of a mic, record a representative signal into a buffer and save it to disk, and use the same file for all the tests. That way, you can be sure any differences in behavior are because of Onsets or FFT and not because of mic or performance.

I don't have any other ideas now, but the more variables you can eliminate, the more you can trust the test results.

hjh
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

Rainer Schuetz
In reply to this post by altern
Hi enrike,

I agree that increasing the relaxtime and getting more re-triggering sounds so counter intuitive that it looks like a bug. Otoh debugging this problem is so difficult that I'd be surprised if somebody could be found to work on this in the nearer future. So I tend to think, if you need to get a job done, better work on a OSX or Linux system.

If you'd like to contribute to understanding the problem on Windows better, you could follow James advice to use a soundfile. That get's us closest to excluding the possibility of interference of hardware related factors (driver choice on Windows, sc interfacing with that driver on Windows). If, within your given setup, you want to experiment, you could try to see if the audio interface implicitly chosen by setting an audio device in server options makes any difference. By default the server boots using WMME, but if you have an ASIO driver available for your soundcard, you could try to see if choosing that makes any difference. That should also give you the option of experimenting with different hardware buffer sizes.

Best
.r.


On 21. Apr 2017, at 09:18, enrike <[hidden email]> wrote:

/*Synth(\hits, [
\in, 0,
\gain, 1, // just to control input level
\threshold, 0.07, // needs much lowe values on windows despite signal being strong
\relaxtime, 0.00024, // if I INCREASE this value I get more re-triggering!
\floor, 0.01,
\mingap, 2
]);*/

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

altern
In reply to this post by ddw_music

>> I am using the same code with OnSets on different OSs and I get rather
>> different responses under Windows than under Linux and Mac. In both
>> windows and Linux I am using the same hardware. In mac I only change the
>> computer, the sound card and mic are the same in the three OSs. The
>> incoming signal from the microphone looks pretty much the same amplitude
>> in the localhost levels. The windows version of supercollider is 3.8.0,
>> same form Mac. Linux supercollider version is 3.6.6
>
> One suggestion for troubleshooting is to eliminate as much indeterminacy
> from the tests. Instead of a mic, record a representative signal into a
> buffer and save it to disk, and use the same file for all the tests. That
> way, you can be sure any differences in behavior are because of Onsets or
> FFT and not because of mic or performance.
>
> I don't have any other ideas now, but the more variables you can eliminate,
> the more you can trust the test results.

thanks, I run the tests with a sound file and I get pretty much the same
as with the mic. Windows onsets requires different parameters and
lowering the threshold which leads to many re-triggers and a worst onset
detection. I keep testing...

enrike



_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

altern
In reply to this post by Rainer Schuetz
I have been testing this evening and I found that the results both with
mic and listening to a sound file are weird under windows. I have tried
the default driver and also ASIO4ALL, but both are the same.

It feels very weird because within a very tiny range of values it goes
from not detecting or skipping hits to getting loads of re-triggering
and detecting small hits in the background sound. In my last test values
as low as 0.04 would retrigger a lot and 0.06 would skip some hits. This
is totally different in Linux and Mac where it works really well with
totally different values.

I have been trying to control the input level into the onsets to be
equal all the time and I have also played around with the level of the
sound in in the windows control panel just in case this was causing some
difference. I tried increasing it and lowering it. no way.

it would be nice to try it out on a different machine just in case but I
dont have anything else I can use atm.

> I agree that increasing the relaxtime and getting more re-triggering
> sounds so counter intuitive that it looks like a bug. Otoh debugging
> this problem is so difficult that I'd be surprised if somebody could be
> found to work on this in the nearer future. So I tend to think, if you
> need to get a job done, better work on a OSX or Linux system.
>
> If you'd like to contribute to understanding the problem on Windows
> better, you could follow James advice to use a soundfile. That get's us
> closest to excluding the possibility of interference of hardware related
> factors (driver choice on Windows, sc interfacing with that driver on
> Windows). If, within your given setup, you want to experiment, you could
> try to see if the audio interface implicitly chosen by setting an audio
> device in server options makes any difference. By default the server
> boots using WMME, but if you have an ASIO driver available for your
> soundcard, you could try to see if choosing that makes any difference.
> That should also give you the option of experimenting with different
> hardware buffer sizes.
>
> Best
> .r.
>
>
>> On 21. Apr 2017, at 09:18, enrike <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> /*Synth(\hits, [
>> \in, 0,
>> \gain, 1, // just to control input level
>> \threshold, 0.07, // needs much lowe values on windows despite signal
>> being strong
>> \relaxtime, 0.00024, // if I INCREASE this value I get more re-triggering!
>> \floor, 0.01,
>> \mingap, 2
>> ]);*/
>


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

Rainer Schuetz
> it would be nice to try it out on a different machine just in case but I dont have anything else I can use atm.

If you send me your code, a description of what to expect with different arguments and the soundfile, I'll try it over here. You can use my private email address. I don't know much about the stuff involved, but I'll try to learn, and I have various options for Windows systems available here...

Best
.r.
_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

altern
In reply to this post by Rainer Schuetz
hi all

more on this issue... Rainer did a very quick test yesterday in another
windows machine (thanks) and it looks like the results were very
unstable as it happened in my laptop under windows 7.

today I was able to test in on a desktop machine running Windows 7 but
it worked perfect there (!!???). I run the test with both the internal
soundcard and the cheap USB card I was using in my laptop tests. I
tested it both with a mic detecting live hits and with a soundfile of
prerecorded hits. All worked fine to my surprise.

Back to the laptop I checked all available Supercollider versions for
Windows. I checked both with the internal sound card and with the USB
sound card, both with a mic and a sound file, and both MME and ASIO
(ASI4ALL). None works as it should, very erratic results with loads of
retriggers. I checked the laptop's windows configuration comparing it
with the desktop: all similar. I checked the sclang and scsynth logs in
both machines and they are equal.

I went into playing around with LocalBuf sizes and FFT wintype
parameters: no luck.

I am waiting for Rainer to check it more properly or to get another
windows machine to be able to compare the results.

If anyone wants to have a go please find the test file attached and the
sound file here
https://www.dropbox.com/s/cexvquzi9kg12b8/txala.wav?dl=0

thanks

enrike


On or., 2017.eko apiren 21a 11:58, Rainer Schuetz wrote:

> Hi enrike,
>
> I agree that increasing the relaxtime and getting more re-triggering
> sounds so counter intuitive that it looks like a bug. Otoh debugging
> this problem is so difficult that I'd be surprised if somebody could be
> found to work on this in the nearer future. So I tend to think, if you
> need to get a job done, better work on a OSX or Linux system.
>
> If you'd like to contribute to understanding the problem on Windows
> better, you could follow James advice to use a soundfile. That get's us
> closest to excluding the possibility of interference of hardware related
> factors (driver choice on Windows, sc interfacing with that driver on
> Windows). If, within your given setup, you want to experiment, you could
> try to see if the audio interface implicitly chosen by setting an audio
> device in server options makes any difference. By default the server
> boots using WMME, but if you have an ASIO driver available for your
> soundcard, you could try to see if choosing that makes any difference.
> That should also give you the option of experimenting with different
> hardware buffer sizes.
>
> Best
> .r.
>
>
>> On 21. Apr 2017, at 09:18, enrike <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>> /*Synth(\hits, [
>> \in, 0,
>> \gain, 1, // just to control input level
>> \threshold, 0.07, // needs much lowe values on windows despite signal
>> being strong
>> \relaxtime, 0.00024, // if I INCREASE this value I get more re-triggering!
>> \floor, 0.01,
>> \mingap, 2
>> ]);*/
>


onsets_test.scd (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

Rainer Schuetz

On 24. Apr 2017, at 16:12, enrike <[hidden email]> wrote:

hi all

more on this issue... Rainer did a very quick test yesterday in another windows machine (thanks) and it looks like the results were very unstable as it happened in my laptop under windows 7.

today I was able to test in on a desktop machine running Windows 7 but it worked perfect there (!!???).

I seem to observe this in my system (3.9dev, msvc build 64-bit):

odftype power and magsum seem okay (!). Have you tried them?

complex, rcomplex, phase and wphase create a shattering noise, the frequency of which seems to be proportional to the buffer size, and the noise is made up of the sound created at a onset detection, but they're false detections not (?) related to anythin in the signal. You can almost get away the noise by choosing a large buffer (something like 4*4096), but then the timing of the onset detects seems totally random.

mkl behaves completely different, not sure yet...


I've been using this simplified version of the help-file code, just to play with the params and see when the noise occurs (on Mac all is fine). Maybe something wrong in the code? :
(
b = Buffer.alloc(s, 1024);
x = {
    var sig, chain, onsets, pips;
    sig = Decay2.ar(Impulse.ar(1), 0.01, 0.5, mul: SinOsc.ar(mul: 0.1));
    chain = FFT(b, sig);
    onsets = Onsets.kr(
        chain,
        threshold: 0.2,
        odftype: \rcomplex, //power, magsum okay, complex, rcomplex, phase, wphase, mkl broken (mkl might work with threshold 0.02)
        relaxtime: 1,
        floor: 0.1,
        mingap: 10,
        medianspan: 11,
        whtype: 1,
        rawodf: 0
    );
    pips = BrownNoise.ar(EnvGen.kr(Env.perc(0.01, 0.05, 0.1), gate: onsets));
    Out.ar(0, [sig, pips]);
}.play;
)

PS: I've been looking at the underlying code a bit (blindly ;) ). A far shot: does the desktop machine that works have a Itanium processor? There is a hypotf-function that requires some special msvc treatment, and it's only used in the complex upwards odftypes... I'll continue researching...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: different responses of OnSets under windows and linux/mac

altern


> PS: I've been looking at the underlying code a bit (blindly ;) ). A far
> shot: does the desktop machine that works have a Itanium processor?
> There is a hypotf-function that requires some special msvc treatment,
> and it's only used in the complex upwards odftypes... I'll continue
> researching...

this is the info about the processor in the desktop

vendor_id       : AuthenticAMD
cpu family      : 16
model           : 5
model name      : AMD Athlon(tm) II X4 645 Processor
stepping        : 3
microcode       : 0x10000c8
cpu MHz         : 2400.000
cache size      : 512 KB
physical id     : 0
siblings        : 4
core id         : 3
cpu cores       : 4
apicid          : 3
initial apicid  : 3
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge
mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext
fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl
nonstop_tsc extd_apicid eagerfpu pni monitor cx16 popcnt lahf_lm
cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch
osvw ibs skinit wdt hw_pstate vmmcall npt lbrv svm_lock nrip_save
bugs            : tlb_mmatch fxsave_leak sysret_ss_attrs null_seg amd_e400
bogomips        : 6228.45
TLB size        : 1024 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate


_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: http://www.listarc.bham.ac.uk/marchives/sc-users/
search: http://www.listarc.bham.ac.uk/lists/sc-users/search/
Loading...