/DSP/

Welcome to digital signal processing general. For the uninitiated, this thread is about using open source audio programming languages, to create instruments and generate sounds/music. These programming languages include, Csound, Supercollider, and PureData among others. I will be shareing some Supercollider code to get us started.

Attached: supercollider.jpg (1677x1028, 973K)

Other urls found in this thread:

synthesizer-cookbook.com
gsp.tamu.edu/
midifile.sapp.org),
fabfilter.com/products/pro-q-3-equalizer-plug-in
dmgaudio.com/products_equilibrium.php
eventideaudio.com/products/third-party-plug-ins/equalizer/equivocate
cdm.link/2018/11/the-guts-of-tracktion-are-now-open-source-for-devs-to-make-new-stuff/
audioz.download/
audioz.download/software/win/151283-download_eventide-newfangled-elevate-bundle-v157-happy-new-year-r2r.html
audioz.download/software/win/154295-download_fabfilter-total-bundle-v20190313-incl-patched-and-keygen-win-osx-r2r.html
producerspot.com/best-free-equalizer-eq-vst-au-plugins-on-internet
twitter.com/SFWRedditVideos

(
SynthDef.new(\pulse,{
|freq = 400, amp =0.5, phase= 0, width=0.5, atk=0.5,sus=1,rel=0.5, pan=0, mod= 10,mod2=20|
var sig, env;
env =Env.new([0,1,1,0],[atk,sus,rel]).kr(2);
sig = LFPulse.ar(freq + SinOsc.kr(mod+SinOsc.kr(mod2)),phase, width,amp);
sig = Pan2.ar(sig,pan);
Out.ar(0,sig*env);
}).add
)

Synth(\pulse,[\freq, 20,\mod, 30, \mod2, 10000]);

(
SynthDef.new(\blip, {
|freq = 100,amp=0.5,pan=0, atk= 0.05, sus= 0,rel=0.5, numharm=200|
var env, sig;
env=Env.new([0,1,1,0],[atk,sus,rel]).kr(2);
sig = Blip.ar(freq,LFNoise0.kr(numharm,100))*env*amp;
sig = Pan2.ar(sig,pan);
Out.ar(0,sig);
}).add
)

Synth(\blip,[\numharm, 200]);

(
Pdef(\bl, Pbind(
\instrument, \blip,
\dur, Pxrand([0.1,0.3,0.5],inf),
\freq, Prand([50,70,90,100],inf),
\numharm, Pseq([200,140,250],inf),
\amp, 0.55,
)).play
)


(
Pdef(\p1,Pbind(
\instrument, \pulse,
\dur, Pseq([2,0.5],inf),
\freq, Pseq([15,20,10,15,25,],inf),
\mod, Prand([20,30,25],inf),
\mod2, Prand([10000,9000,10500],inf),
)).play
)

So what you got here is two simple synth definitions and two patterns to control them.

I don't know anything about electronics. How are so many people able to make music with signal generators? These things don't terminate in 1/4" outputs. Will it fry my mixer?

Attached: i_googled_'retard_pepe'.png (200x299, 14K)

>DSPs are just for audio
Jow Forums everybody

Attached: 1554937762258.png (550x497, 146K)

>dsp is about electronics

Attached: 1552037390787.png (1066x600, 276K)

>generalposting ass cancer
>calling anyone a brainlet

Can someone please explain to me why all of these audio programming languages are garbage? I've been working on my own for the past 2 years and already have more functionality than things that have been around for 20 goddamn years

>doing dsp in software

>not doing dsp with pencil and paper

can you give some examples of ways you have more functionality? I don't really think they are garbage, but I know very little about it.

Does anyone with knowledge have ideas for better synth defs?

why is this topic so unpopular???

Does this include FamiTracker?

if it will get people to keep these threads alive sure. I might install it if we end up talking about it and there are fun ideas. I use Renoise myself but right now I'm trying to get going with Supercolllider. I know how to make a synth def and play it in a pattern but I haven't figured out how to design better and more useful synth defs.

If I keep posting these threads I wonder if they will take off?

>signal generators
Turn down the voltage before you connect it to your mixer. Only turn it up to a reasonable level and you should be fine. Probably your mixer won't get fried regardless. Whatever your mixer outputs to might get fried though.

Garbage may have been an overstatement. The issue I have with them for me is that all have one or more of the following: very limited RTPCs (if they exist at all), low performance characteristics, limited portability and usage, old/outdated documentation, the inability to alter the audio processing graph at runtime, lack of direct control, or poor models for thinking about audio processing. I find, for example, that CSound is incredibly unintuitive for a lot of things which should be easy, and that PD makes an arbitrary distinction between control rate and audio rate for changing parameters. Users should be able to control the rate at which ANY parameter updates.

It would be extremely painful.

interesting. Have you looked at Supercollider? I don't know if it's what you mean by RTPC but it does shit in real time

...

Supercollider has its own set of problems associated with the server-client model it's going for. IIRC it instantiates new instruments on a per-note basis, which isn't very efficient. It's good in the case of realtime performance over the internet or Ethernet cables, but it's less good for high-performance situations like games

I feel like someone in this thread might know, so I'll ask here. Can anyone recommend an audio player with support for VST3 and 64bit VST plugins? Foobar almost fits the bill, but not entirely. I'm stuck on Windows 10.

never heard of an audio player that supports VSTs, don't you need a digital audio workstation for that?

It's pretty niche and kind of hard to get into, I'm interested in this but I have nothing to contribute.

I'm an audio programming intern in the games industry and willing to dump book recommendations if you're interested

not him but I am very interested.

Do you guys know any books or resources where I can find some synth recipes to recreate in superocollider?

This:

synthesizer-cookbook.com

I have both 1 & 2 and they're pretty solid

I've only ever worked with commercial DSPs like Biamp, Qsys and BSS, it's all drag and drop shit not actual procedural code. What's a good intro to Csound or SC? Do I need hardware or can I emulate it?

yeah that would be cool

for supercollider afaik the most known is “the supercollider book”.
Then there's good books about sound design for csound or pure data:
“the audio programming book” by richard boulanger
“designing sound” by andy farnell
“the electronic music tutorial” by curtis roads

The supercollider mailing list is also reasonably active. I don't know much about books targeting video games although I've seen some

there's some patches on sccode

You don't need any hardware for supercollider or CSound. They're both software based. I think they both have decent tutorials on various websites. You might also consider checking out ChucK

dsp is bigger than just audio tho

Attached: Lenna.png (512x512, 465K)

you aren't the first to say that here. What else is there? As far as I know it's just audio and video. Not sure what other signals you could be processing.

Telecommunications
Science shit like imaging that black hole

well for one the thing I posted isn't audio or video

Have you guys checked out faust dsp?
You code in some functional lenguage (too brainlet to understand what that means) and then you can generate c++ files, etc.
You can generate supercollider extensions too.
I'm pretty interested in it because of the physical modelling library.

Different types of data can be treated as signals in the same way as audio, image or video. This is the case for genomic data, gsp.tamu.edu/

Biosignals are also a subject of study (electrocardiogram, electroencephalogram) in the DSP literature.

In no particular order, here are my recommendations:

- A Digital Signal Processing Primer by Ken Stieglitz
- Everything written by Julius O Smith III (should all be available on his website - last I checked he had 4 excellent books and dozens of articles on there for free)
- Digital Filters for Everyone by Rusty Allred
- Game Audio Programming by Guy Somberg (also probably the 2nd volume although I haven't read it yet)
- Audio Effects: Theory, Application and Implementation by Joshua D. Reiss
- Real Sound Synthesis for Interactive Applications by Perry Cook
- Microsounds by Curtis Roads
- Head-Related Transfer Function and Virtual Auditory Display by Bosun Xie (careful with this one, it's quite dense and dry)
- A Wavelet Tour of Signal Processing: The Sparse Way by Stephane Mallet
- The Scientist & Engineer's Guide to Digital Signal Processing by Steven W. Smith

My bias for game audio is pretty obvious, but there are still some cool things to pick up even from the games-specific stuff. Some of these books also overlap with one another, so you may not need to read them all cover to cover. You should also probably check out the math surrounding AM/FM/CM synthesis, Ambisonics, Feedback Delay Networks, and Digital Waveguides. I also have more specific recommendations for programming libraries and tools if you plan to work in C++.

Also don't be scared by the breadth of topics here. There's a lot of challenge but also a lot to explore and a lot to love. If something is too challenging for you at whatever level you're at, try a different book or topic (even if it's completely unrelated) and come back to it later. I've done that a lot while reading through the above

For you

I should mention these recommendation assumes you have some decent knowledge of programming and that you know math up through calculus and possibly some linear algebra. It's not 100% necessary to know beforehand, and you can always look things up as you go, but it's easier if you're already there

The brainlet fears the fourier transform.

going through the patches on audiomasher.org/browse

currently trying to understand the waveguide examples. the code seems write-only at first but I think I'm getting some of it now.

bump

Foobar is the closest thing to that, if you use e additional components.

>I also have more specific recommendations for programming libraries and tools if you plan to work in C++
Yes please, thank you very much in advance.

It's used for sonars in submarines

Hmm I kind of look stupid because sonar is actually a form of audio...

For C++ libraries look into portaudio, midifile (midifile.sapp.org), and JUCE

Thank you.

Sorry if this is a stupid question, but for someone who doesn't know any programming and forgot all math from school, how long would it take to be able to make simple plugins or apps in JUCE?
I assume I have to learn at least the basics of C++, then the math to understand the fundamental DSP concepts to apply using C++, then the DSP "science" itself, correct?

What kind of math will I need to learn?

I don't want to make a living or sell these programs. I just want to implement certain ideas in my music that I can sort of implement with MaxForLive, but with better performance and stability.
Can I take "shortcuts" and use other people's code that I don't understand, like I do when I copy other Max patchers into mine? Or do I have to really understand how everything works in order to use it in my creations?

>audiomasher.org/browse
interesting, never heard of Sporth.

Thanks everyone for bumping the thread this long. Now that I woke up I can keep it alive more

>for someone who doesn't know any programming and forgot all math from school, how long would it take to be able to make simple plugins or apps in JUCE?
If you want something up and running quickly, and you're okay with not knowing how things work while working on them, you can pick up the JUCE tutorials and gradually alter them until they're what you need - although this is like taking shortcuts, described more below.
>I assume I have to learn at least the basics of C++, then the math to understand the fundamental DSP concepts to apply using C++, then the DSP "science" itself, correct?
Yes that's right. I would start with Khan Academy pre-calc + calculus, then move on to C++ (unfortunately I don't have a whole lot of resources for self study on this), and then move on to the Stieglitz book I recommended earlier. That will give you enough to at least understand a lot of the concepts in other books, although the Xie, Mallet, and JOSIII books might be a bit much to move on to immediately.

>What kind of math will I need to learn?
Definitely trig, calculus, complex math (enough to understand Euler's identity and do manipulations with complex numbers and ratios of complex numbers) and maybe some linear algebra
>I don't want to make a living or sell these programs. I just want to implement certain ideas in my music that I can sort of implement with MaxForLive, but with better performance and stability.
If you're looking for better performance and stability I would definitely go with JUCE. It's easy to get things set up quickly, reasonably performant, and it's fully cross platform
>Can I take "shortcuts" and use other people's code that I don't understand
I don't advise it. You'll end up either scratching your head for hours having no idea why your filter is blowing up, or why you're dropping audio frames, and then you end up treating the code as some magical entity you can reason with or personify. The only way to avoid magical thinking about technology, in my experience, is to understand how it works.

I enjoy answering questions, btw, so keep hitting me if you have any more :)

I could never grasp the concept of Kalman filters and when are they used. Many research papers say these are the shit.

Thank you very much user. I greatly appreciate your help.
I'm saving this thread and I'll reference it as I progress.

>If you want something up and running quickly, and you're okay with not knowing how things work while working on them, you can pick up the JUCE tutorials and gradually alter them until they're what you need - although this is like taking shortcuts, described more below.
That's assuming you already know C++ and the underlying math and DSP, right?
Or does JUCE have "premade" stuff (like filters, pitch-shifters, etc.) that I can "plug" into my stuff without having to make them myself (like the objects in Max)?

>I don't advise it. You'll end up either scratching your head for hours having no idea why your filter is blowing up, or why you're dropping audio frames, and then you end up treating the code as some magical entity you can reason with or personify. The only way to avoid magical thinking about technology, in my experience, is to understand how it works.
I see...
But if I don't understand how it works and it becomes a huge headache, will I still be able to make things work, even if in a hacky way? Or would that be often impossible?
Because if it takes me years to go from "works with headache" and "works smoothly without headache", as someone who does it as a side thing, the years might not be worth the returns.
So in other words, how well do things made of code copied from somewhere else work?

I often see memes and jokes like pic related. Are they all making code that barely works?

Attached: pebkk4jb9as21.jpg (750x807, 69K)

Anyone knows really good fully parametric equalizer plugin?

>fully parametric
What do you mean?

Like a paragraphic EQ?
I highly recommend these:
fabfilter.com/products/pro-q-3-equalizer-plug-in
dmgaudio.com/products_equilibrium.php

If you mean a strictly parametric one (like with lots of fixed bands to move up and down), I recommend this:
eventideaudio.com/products/third-party-plug-ins/equalizer/equivocate

Can someone give me a lowdown on what csound, puredata, and supercollider actually do and how they are different? Do artists actually use this stuff? i always see those performance artists use the graphical mindmap looking programs on tv
t. chem major, knows c++ and fourier transforms

puredata is graphical, you connect objects in boxes with wires to write the code. The other two are text based like normal coding. Csound is the oldest and supposedly has better sound quality than any of them. Supercollider might be a little easier to learn, but for me it's the one I've put the most time into even though I've barely done anything with it. Artists certainly use all these. Pic related is an album by someone who uses Supercollider. Jeff Carey is another who uses Supercollider. Autechre use Max/MSP which is the proprietary version of PureData (or rather Pd is a free version of Max, made by the same person). There are a lot of other artists into this stuff too.

Attached: bellerue_yamaha.jpg (340x306, 13K)

>That's assuming you already know C++ and the underlying math and DSP, right?
>Or does JUCE have "premade" stuff (like filters, pitch-shifters, etc.) that I can "plug" into my stuff without having to make them myself (like the objects in Max)?
It does have basic stuff you can plug in and use. Depending on your use case, it might be sufficient. Definitely check out their tutorials section, because it's quite good.
>But if I don't understand how it works and it becomes a huge headache, will I still be able to make things work, even if in a hacky way? Or would that be often impossible?
>Because if it takes me years to go from "works with headache" and "works smoothly without headache", as someone who does it as a side thing, the years might not be worth the returns.
>So in other words, how well do things made of code copied from somewhere else work?
>I often see memes and jokes like pic related. Are they all making code that barely works?
I know other programmers can get by like that, but DSP is particularly math-oriented and performance-intensive compared to something like business applications or webdev. I'm sure some of those memes have more to do with the pervasive imposter syndrome in software than what they're literally doing day to day though. Either way, I'd say you're better off learning how to program.

I'd like them to be free and less fancy (I just need to do some correction to listen to music).
Also, is there any benefit of using hardware EQ if correcting only low range?

Got it, thank you very much.

Just another question:
What would a DSP dev do with this?
cdm.link/2018/11/the-guts-of-tracktion-are-now-open-source-for-devs-to-make-new-stuff/
Could they potentially just plug the components in their code with understanding of it, or would they need to have a good understanding of how this software works to use it in their own projects?

You can pirate them from audioz.download/
It's the main community for audio warez, and the sources are trustworthy.

In this case they're both R2R (the main audio software cracking team at the moment) releases, so you can trust them not to have malware.

audioz.download/software/win/151283-download_eventide-newfangled-elevate-bundle-v157-happy-new-year-r2r.html
audioz.download/software/win/154295-download_fabfilter-total-bundle-v20190313-incl-patched-and-keygen-win-osx-r2r.html

If you really want it to be free, google "best free eq vst" and check lists like this:
producerspot.com/best-free-equalizer-eq-vst-au-plugins-on-internet
They're all fine for basic usage.

A DSP programmer might plug components into their project directly, although I know a lot of companies will shy away from GPL licenses, so it might just be something to learn from. My personal opinion is that you should understand how these things actually work as much as possible, because it lowers the potential to develop magical thinking about them.

Is magic thinking so bad if I don't want to program for a living but just want to make little plugins for myself?

You will find more informed people over at t.Former DSP programmer

Yes, because
A) You will not know how your own creations work or how to debug them
B) You will not know the language required to research topics on where to go next (you can't find what you can't describe)
C) Magical thinking tends to spread over time through forums, Q&A, and personal discussions.
D) By entertaining magical thinking you may be inadvertently encouraging it in others, which leads to a prevalence of black-boxes, hand waving, and inefficiency/bloat, all of which (if I'm not mistaken), are part of what you're trying to avoid by getting into this in the first place.

I see, thank you very much.

>For the uninitiated, this thread is about using open source audio programming languages
so it's a DSP general about a very specific topic? that doesn't sound very general

I agree with this as well. Audio DSP is my specialty, but I'd be interested to hear from people using it in communications/imaging/etc

If you are interested in the applications of DSP in biomedical engineering, I'd strongly suggest Biosignal and Medical Image Processing by Semmlow & Griffel. If you've already had a course in DSP or some background working on DSP projects, it should be simple to understand. If it's your first time reading a DSP book, I still think the book makes it very simple to understand the basics of the field. The book also includes Matlab examples, Matlab files and a lot of short and long Matlab exercises which I found pretty enjoyable. This was definitely one of my favorite courses in university (I attend Texas Tech as a ECE major).

Is there a good, portable microphone API I can use with C++ out there? I want to develop a SDR application but not depending on Qt for everything.
Is PortAudio good?

Can any anons recommend me a half second but then lost.

I've never used their input functionality, but if it's anything like their output, it's solid

Ooh that looks nice. Definitely checking it out. Thanks!

Exercise for /new/: write something that will break headphones if used and then introduce it to somebody as a fun example program.

csound and pd are all you need

Also interested in this.
How long would one need to study C++ to be able to do this kind of stuff?
Assuming medium time and efort spent studying it.

I was ignorant when I made this thread about the true scope of the term DSP, cause I was only familiar with it in the context of music and video. Rather than splinter this general into smaller parts I think it would be better if someone writes a better OP for the next thread that references all forms of DSP, as there is clearly interest here in a general and different facets of the topic. I for one am interested in learning about more than just audio, even if it was audio that brought me here.

rf waves, temperature, voltage, current, weight, velocity, acceleration, position, wattage, etc.
literally any quantifiable measurement idk

this is the best thread on Jow Forums right now.
Anything that you can treat as a signal you can process. Audio, images, videos, biodata, radio, market information. so on and so forth.

I wish I could use those csound ugens inside supercollider

do you know any programming languages already?

No, but I have the "Programming: Principles and Practice Using C++" book.

so I don't think anybody can really give you any accurate assessment of how long it would take if you're starting from zero. it all just depends how much spare time you have, how quickly you take to the concepts, if you're enjoying it, etc
one idea might be to approach it from 2 ends - start learning programming at your own pace, but also learn DSP concepts and building synths from the other end (reaktor, synthmaker, csound / supercollider / etc). then at some point you might be able to fuse your learning in the two areas together.
otherwise it might be a long time before you're comfortable enough with C++ (or any other language).
but I really don't know. maybe they can be learned simultaneously. there might be some very good books on C++ DSP programming where you could start with their project templates and experiment and grow from those as your C++ knowledge improves.

Any ballpark estimate?
When you say
>otherwise it might be a long time before you're comfortable enough with C++
How long is "a long time"?
10 years? 5 years? 2?
I understand that there are too many variables, but is there a "typical" amount of time that self learners usually take?
I'm talking about the basics of C++, not C++ AND DSP (although I'd like to know how long it would take for that as well, if possible).

I really don't know, you'd have to ask somebody in the business of teaching / observing newbies.

just completely out of my ass, I'd guess you could be doing some really cool shit within a year or two, because modern learning resources (books, tutorials, youtube videos, help in the IDEs themselves, etc) are abundant, and direct help is available on a multitude of forums. to say nothing of google which can solve a huge number of problems very quickly

oh and github is a fucking treasure for things like this, you can watch how other people are actually doing stuff, interact with them, contribute to other beginner-friendly projects

I "learned" C++ originally in the 90s, but I never wrote anything really major with it, then back around 2010 I got into it again and made huge strides just because it was so easy to find answers online (well, it also helped that I'd been doing Python for like 10 years at that point, which means I only had to relearn the C stuff [pointers, structs, etc], not learning OOP from scratch)

I say, don't worry about how long. there's just no way to know, but I CAN guarantee that you can be making stuff in a month that keeps your interest, if you don't obsess over long-term goals ("when will I be able to do X?"). being able to create even simple programs can be fascinating. again, the tools and resources have never been better.

and enjoy the learning process!! you only get to be a beginner once. savor the experience.

Thank you very much. I'm gonna look for people who deal with noobs to see what they think of this.
As for the rest, that's encouraging, thanks again.

>I'd guess you could be doing some really cool shit within a year or two
Like what?
Commercially viable stuff or just something cool and fun to keep you interested?

commercial viability something I know even less about (like, zero). I have no idea what's actually selling out there, or how much money they're making.

I had in mind stuff like audio plugins or standalone audio apps. there are enough books out there, and enough plugin-building frameworks (that abstract away all the platform-specific VST/AU/etc stuff), that I think it's reasonable a motivated person could make a handful of not-trivial projects to share and keep building upon.

again, we live in a time with the best learning resources that have ever existed for this stuff. sample projects galore.

and I think that's why any notion of commercial viability is difficult, because so many other people have access to the same resources. that's why there is an almost uncountable number of audio plugins and software in existence, because nearly anybody with some free time can create their own apps/plugins and share them.

Thanks user.

On a spectrum between "anyone can learn to do it in a few years of experience" and "black magic that only a select few can even try", how difficult is it to make a proper linear-phase filter/EQ that cancels out if you sum its output with the inverted dry signal (leaving only what you changed)?
And how hard is it to have it run reasonably well?

That seems like an oddly specific project. Do you have any motivation behind that particular thing, or was it just an example?

I was just wondering, since a few months ago I was looking for linear phase EQs to do a /prod/ thing with, and found that they're not that common, so I thought it might be a very hard thing to do.
If it's closer to "anyone can" than "black magic", I'd definitely like to try and build my own in the future, but this question isn't about a specific idea or anything.

Literally any time-dependent measurable quantity is a meaningful signal you fucking idiot

couldn't tell you, I'm not a DSP guy. I'm a generalist programmer who just happens to have an interest in audio/music software. I've only dealt with the outside of plugins, from an audio host perspective - never the innards.

well, a little bit of the innards. I'm currently modifying a cross platform GUI library to support being used to make GUIs for VST/AU ... but nothing touching the actual audio processing algos themselves.

off the top of my head I'd say, if you can understand the math behind what you're talking about, then the programming aspect is the easy part. you could probably find some simple C programs that do what you're talking about, operating on an input audio file (WAV or whatever). you could start from there (if you understand the math) and keep elaborating on the design until you have something you could plop into an audio plugin framework (ie, the stuff that generates all the VST/AU boilerplate for you, and you just focus on the algorithm)

Ah, so most of the difficulty in implementing even the craziest ideas is in the math and not the programming, correct?
Even for all those unparalleled incredible programs like Melodyne's polyphonic mode or spectral processors (like iZotope RX, the Zynaptiq plugins, etc)?

>difficulty
Eh it's not the math nor the programming though both can definitely present challenges. It's the creative design and arguably the design of your architecture's number of levels of abstraction.

Ah, got it, thank you.