The Wayback Machine - https://web.archive.org/web/20200920130454/https://github.com/tidalcycles/Tidal/issues/618
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio input #in glitch at every cycle #618

Closed
b1tfl0w opened this issue Mar 30, 2020 · 8 comments
Closed

audio input #in glitch at every cycle #618

b1tfl0w opened this issue Mar 30, 2020 · 8 comments

Comments

@b1tfl0w
Copy link

@b1tfl0w b1tfl0w commented Mar 30, 2020

Describe the bug
I'm not sure if this is a tidalcycles or superdirt issue, but when I use audio input #in I can hear a short audio clip at every cycle, something like a buffer drop, which coincides with tempo if I change cps.

To Reproduce
I connect my guitar to my audio card, then evaluate
d1 $ s "in"

Expected behavior
A clean sound without clips.

Environment:

  • OS: Linux Ubuntu 18.04
  • GHCi, version 8.6.4
  • tidal-1.4.8
  • SuperCollider 3.10.2

Additional context
I'm using Supercollider via ALSA direct portaudio becouse jack server is too glitchy, so apart from this issue the sound is clean at low latency when playing synths and samples, also I've no issues using audio input in other softwares like for example pure data.

@telephon
Copy link
Contributor

@telephon telephon commented Mar 30, 2020

Yes, that is quite possible, because the fade time in standard synths is very short (to keep the general feel crispy). You could try to write # legato 1.1 - is that better?

@b1tfl0w
Copy link
Author

@b1tfl0w b1tfl0w commented Mar 30, 2020

Nope, I tried 1.1, 1.01, 1.001 and other values. Maybe the only solution could be to elaborate an algorithm which makes the audio buffer continuous..becouse something is restarting when a cycle ends and the next starts...that gap should be filled, or maybe a fade effect that smooths the end with the start. I think this isn't an urgent issue..becouse while music is playing the glitch is inaudible..but it would be nice to have a fix. Maybe I could help but I don't know where to look at.

@telephon
Copy link
Contributor

@telephon telephon commented Mar 31, 2020

Could you try # fadeTime 0.2 ?

@b1tfl0w
Copy link
Author

@b1tfl0w b1tfl0w commented Mar 31, 2020

I did:
d1 $ s "in" # fadeTime 0.2

I got:

tidal> d1 $ s "in" # fadeTime 0.2 

<interactive>:19:15: error:
    Variable not in scope: fadeTime :: Double -> Pattern ControlMap

Also I can't find fadeTime keyword in the documentation..did I do something wrong? I'm a beginner.

@telephon
Copy link
Contributor

@telephon telephon commented Mar 31, 2020

Ah sorry, I didn't know it wasn't added to the tidal side (I can't try right now). If I remember correctly, it was in tidal:

let fadeTime = pF "fadeTime"

@yaxu shouldn't we add that?

you could try this.
Otherwise, in supercollider:

~dirt.orbits[0].set(\fadeTime, 0.1)

But then this is global, and all the sounds will be "softened".

@b1tfl0w
Copy link
Author

@b1tfl0w b1tfl0w commented Apr 1, 2020

Ok I made some test using the first option by putting let fadeTime = pF "fadeTime" in my Tidal.ghci in vim plugin, now it works..but it is like a fade out and still gives "digital kisses"..I did try negative values also. Better without it.

@telephon
Copy link
Contributor

@telephon telephon commented Apr 1, 2020

Ah now I understand why this is. Other synths have their own envelope for the attack section, but the input synths don't have this.

Forget about the fadeIn, just run this in sclang:

// live audio input
(
SynthDef(\in, { |out, sustain = 1, pan, inputFadeTime = 0.03|
	var env, sound;
	env = Env.linen(inputFadeTime, sustain - (2 * inputFadeTime), inputFadeTime).kr;
	sound = SoundIn.ar([0, 1]); // stereo in
	sound = sound * env;
	OffsetOut.ar(out,
		DirtPan.ar(sound, ~dirt.numChannels, pan)
	)
}).add
);

I'll correct the source as well. You can adjust the crossfade, if you add to tidal:
let inputFadeTime = pF "inputFadeTime", and then # inputFadeTime 0.02 or so...

@yaxu
Copy link
Member

@yaxu yaxu commented Apr 8, 2020

I made an issue on the tidal repo for the missing parameter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.