Jump to content
IGNORED

Programming


zlemflolia

Recommended Posts

I made a compressor with some GUI features, very fun!

 

qr2lF6O.png

Woah, didn't even knew one could do such things in Pd... Been wanting to learn Pd for years, but then I thought I'd better learn Max - maybe I'm totally wrong!

 

Also, was thinking about learning Ruby for a while, and try to do some sound with it, just for the fun. I don't even know if that's possible or not, yet it seems far less complicated than doing it in C++, and when it comes down to programming I'm kind of a lazy as anyway so...

Link to comment
Share on other sites

  • Replies 467
  • Created
  • Last Reply

^ you'll have performance issues real quick, unless you just do offline rendering to wav files or something. and even this will be slow AF.

 

audio = C/C++.

 

with audio code, essentially you'll just be filling arrays (your audio channels) with numbers (your audio samples) - it doesn't really matter what language you're doing it with, this part isn't easier in Ruby than it is in C++, so better go with a language which can push more samples quicker. which is C or C++.

 

I've developed some sequential-numbers algorithmic thing in Objective C recently, and for shits'n'giggles I put it in a realtime audio thread to use it as a synth. The result was that it couldn't keep up, 100% CPU and glitchy. So I rewrote that thing in C++ and it's like 50 times as fast and can produce 8 channels of realtime audio (@48kHz, 64bit) no problemo. Objective-C is not exactly slow either, it's way faster than any of these interpreted or VM languages which are made for clueless web developers.

 

conclusion: definitely not do audio with Ruby, it's a dead end.

Link to comment
Share on other sites

however, if you're new to programming, pick a language which you think is fun to use.

just.... avoid frustration, don't expect it to be the right tool for realtime DSP.

Link to comment
Share on other sites

 

Woah, didn't even knew one could do such things in Pd... Been wanting to learn Pd for years, but then I thought I'd better learn Max - maybe I'm totally wrong!

 

Also, was thinking about learning Ruby for a while, and try to do some sound with it, just for the fun. I don't even know if that's possible or not, yet it seems far less complicated than doing it in C++, and when it comes down to programming I'm kind of a lazy as anyway so...

 

 

You can do pretty much anything if you're smart enough. It's low-level enough that you can insert the mathematical equations for various DSP processes and have an effect come out the other end.

 

I'm not exceedingly familiar with Max/Msp, although the two are closely related I'm fairly sure Max 7 has some advantages at this stage. However, this one is free, open source and Linux friendly...

Link to comment
Share on other sites

^ you'll have performance issues real quick, unless you just do offline rendering to wav files or something. and even this will be slow AF.

 

audio = C/C++.

 

with audio code, essentially you'll just be filling arrays (your audio channels) with numbers (your audio samples) - it doesn't really matter what language you're doing it with, this part isn't easier in Ruby than it is in C++, so better go with a language which can push more samples quicker. which is C or C++.

 

I've developed some sequential-numbers algorithmic thing in Objective C recently, and for shits'n'giggles I put it in a realtime audio thread to use it as a synth. The result was that it couldn't keep up, 100% CPU and glitchy. So I rewrote that thing in C++ and it's like 50 times as fast and can produce 8 channels of realtime audio (@48kHz, 64bit) no problemo. Objective-C is not exactly slow either, it's way faster than any of these interpreted or VM languages which are made for clueless web developers.

 

conclusion: definitely not do audio with Ruby, it's a dead end.

 

Is Obj C more useful for Core Audio, or does it not matter? I'm probably going to be developing for Mac since I use Logic. If you can still make plugins in C++ on a Mac, then I would rather just start there since I've learned some of the basics of C++ already.

Link to comment
Share on other sites

^ you'll have performance issues real quick, unless you just do offline rendering to wav files or something. and even this will be slow AF.

 

audio = C/C++.

 

with audio code, essentially you'll just be filling arrays (your audio channels) with numbers (your audio samples) - it doesn't really matter what language you're doing it with, this part isn't easier in Ruby than it is in C++, so better go with a language which can push more samples quicker. which is C or C++.

Do you know why there are so many more audio projects in C++ than C? Is it just because there's higher level constructs and OO built in? I'm learning C right now and I feel like I should wrap that up before I move onto C++ but it's interesting that there's so much more C++ DSP code than C. I've seen some DSP code in Lisp too (lol) so I guess it doesn't matter that much what you use, it's just easier to grab C++ code off the shelf than anything else for DSP.

Link to comment
Share on other sites

I've been playing with Atom a little at work (although I mostly just use VS there) and it seems really cool, looking forward to farting around with the configuration and shit and hopefully making or at least modifying some extensions. I usually stick to Vim in the command line at home though because I'm a neanderthal/neckbeard.

Link to comment
Share on other sites

 

[....]

 

Is Obj C more useful for Core Audio, or does it not matter? I'm probably going to be developing for Mac since I use Logic. If you can still make plugins in C++ on a Mac, then I would rather just start there since I've learned some of the basics of C++ already.

 

 

 

that's good - I stayed clear of C++ for far too long just because the syntax looked super awkward, and wished I'd had started earlier..... definitely stick with C++.

 

CoreAudio itself is entirely C.

Actually Apple strongly advises against using ObjC in the audio thread for performance reasons.

 

not sure if you know this, but you can "mostly" just mix C and C++ code. Or C and ObjC code. or C++ and ObjC code.

 

(ObjC is mostly useful if you want to use higher-level Apple libraries (e.g. UI stuff). Personally I'm trying to migrate away from it to get out of Apple land. You'll only need it if you plan on developing iOS/Mac apps using Apple-only libraries.)

 

Haven't developed an AU or VST plugin yet (though I guess what makes it a plugin (vs standalone app) is just a bunch of boilerplate setup code?). Sure you can do the whole thing in C++ from scratch, including UI, with OpenGL graphics for example...

 

Lot of people use the JUCE libraries for plugins (when they don't want to write everything from scratch): http://www.juce.com

(haven't tried it because commercial license costs money && dunno if worth the investment for me etc.)

 

for Core Audio, you'll want this book:

http://www.amazon.com/Learning-Core-Audio-Hands-On-Programming/dp/0321636848

CoreAudio = just a lot of C boilerplate code to setup your audio context, this book explains it quite well (does not go as far as plugins though!)

Link to comment
Share on other sites

 

[...]

 

Do you know why there are so many more audio projects in C++ than C? Is it just because there's higher level constructs and OO built in? I'm learning C right now and I feel like I should wrap that up before I move onto C++ but it's interesting that there's so much more C++ DSP code than C. I've seen some DSP code in Lisp too (lol) so I guess it doesn't matter that much what you use, it's just easier to grab C++ code off the shelf than anything else for DSP.

 

 

 

yeah this, the OOP features and tons of existing libraries combined with performance must be the reason, because C++ is definitely not known for its elegance or ease of use.

 

as mentioned above, I stayed clear of C++ for a long time, just because it looks exactly like this overly complex mess of tons and tons of features grafted onto C since the 80s that it actually is. :)

 

I really like the simplicity of C... everything you learn in C will be directly useful knowledge in C++.

Link to comment
Share on other sites

started teaching myself programming a year ago. did C, then Java, then some other stuff, now C++. i think that was a good path, i think someone in this thread recommended starting with C. it's easy and fundamental and the syntax is what a lot of languages are based on. then java was good from there because it's the object oriented stuff but it's a pretty easy language. definitely glad i did those before c++. people say c++ is powerful, that's because it's a pain in the ass. you can do any freaking thing in c++, but you control everything.

 

anyway this book is good

 

416RIbCnwiL._SY344_BO1,204,203,200_.jpg

Link to comment
Share on other sites

Updated my compressor, GUI and internals are pretty renewed.

 

3SZSEYy.png

 

I took a bit of a crash course in some heavy math (for me) like complex numbers, logarithms & fourier transform in order to understand some stuff better and be more comfortable making use of expressions rather than ham-fisted object connections. The bulk of the transfer function is now handled by a single expression object doing the simple and classic audio compressor equation y=((x - t) / r) + t.

 

The most important part was having good attack and release behavior, and gain controls for each stage. The REF or reference point fader is an experimental setting that changes how the threshold relates to the actual processing. It's all starting to sound pretty good to me, but I'm just scratching the surface of the ways you can make a compressor work.

Link to comment
Share on other sites

 

 

[....]

 

Is Obj C more useful for Core Audio, or does it not matter? I'm probably going to be developing for Mac since I use Logic. If you can still make plugins in C++ on a Mac, then I would rather just start there since I've learned some of the basics of C++ already.

 

 

 

that's good - I stayed clear of C++ for far too long just because the syntax looked super awkward, and wished I'd had started earlier..... definitely stick with C++.

 

CoreAudio itself is entirely C.

Actually Apple strongly advises against using ObjC in the audio thread for performance reasons.

 

not sure if you know this, but you can "mostly" just mix C and C++ code. Or C and ObjC code. or C++ and ObjC code.

 

(ObjC is mostly useful if you want to use higher-level Apple libraries (e.g. UI stuff). Personally I'm trying to migrate away from it to get out of Apple land. You'll only need it if you plan on developing iOS/Mac apps using Apple-only libraries.)

 

Haven't developed an AU or VST plugin yet (though I guess what makes it a plugin (vs standalone app) is just a bunch of boilerplate setup code?). Sure you can do the whole thing in C++ from scratch, including UI, with OpenGL graphics for example...

 

Lot of people use the JUCE libraries for plugins (when they don't want to write everything from scratch): http://www.juce.com

(haven't tried it because commercial license costs money && dunno if worth the investment for me etc.)

 

for Core Audio, you'll want this book:

http://www.amazon.com/Learning-Core-Audio-Hands-On-Programming/dp/0321636848

CoreAudio = just a lot of C boilerplate code to setup your audio context, this book explains it quite well (does not go as far as plugins though!)

 

 

 

Thanks for the info! I had actually read a book on C before jumping into C++, so it didn't look too intimidating. I've actually been eyeing that Core Audio book for a few months, and I had bought Designing Audio Effect Plug-ins in C++ but it primarily uses Visual Studio as a software companion. Good to know I'm on the right track!

Link to comment
Share on other sites

  • 2 weeks later...

this is the worst fucking shit.

exhibit a) android studio - c++ for native opengl interface --> c++ without a debugger

exhibit b) JNI is the worst shit ever. fickle as fuck, and when there's something wrong, it generates errors from hell.

Link to comment
Share on other sites

i am soo bad at like actual programming/the stuff you compile, even though I'm a boss with ReaJS imo. It's just sometimes I'd like to try some things ReaJS can't, or would be a great speed improvement

 

I also want to make a VST IRC client for the lulz

 

for the record I made some rudimentary stuff in NES assembly too, but that compiles or whatever very fast because assembly?

 

I do wish ReaJS had fucking RECURSION why would they not include recursion

Link to comment
Share on other sites

In an effort to find some joy in programming again I've been learning how to "play" CoreWars. The game takes place on a finite, circular, initially empty array of instructions. The "players" are 2 programs, who are loaded randomly into the array, with no way of knowing where your opponent is located. These programs are written in a very simple, assembly-like language called Redcode. The programs are executed in turns: 1 cycle for player 1, 1 cycle for player 2. The goal is to make the other player's program execute a DAT instruction, which kills the process. It's quite fun if you're into that kind of stuff. The language was really simple when the game was first formulated, with 10 or so instructions, but it's since been expanded in such a way that lets you do really complex stuff

 

This is an excelent primer: http://vyznev.net/corewar/guide.html

Link to comment
Share on other sites

quick question: does recursion come into play when figuring out the routing/signal path of a modular synth, or could I do it with push/pulls from a stack

 

edit: also when patching something in, doing a check to see if there would be feedback

Link to comment
Share on other sites

quick question: does recursion come into play when figuring out the routing/signal path of a modular synth, or could I do it with push/pulls from a stack

 

edit: also when patching something in, doing a check to see if there would be feedback

 

I wouldn't have thought so, if you're programming any kind of complicated audio processing interface you should be dealing with classes, not recursive procedural code. You can have a kind of recursion with a class pointing to itself to create feedbacks, etc. but that's not what is usually meant by recursion. If you're just creating a simple delay effect or something it might make sense, but if you want a general purpose modular-like setup then no. You could do it, but it would end up conceptually very complicated and thus prone to bugs and such. I have little experience coding audio stuff though, so I could be talking out of my ass.

Link to comment
Share on other sites

yea.. audio or not, this is like a flat graph with a tangible amount of nodes where each node has some state, not some abstract math hocuspocus.

 

so you'll have nodes with state and references to other nodes and can navigate iteratively.

but doing this purely functional might be fun too I guess but wouldn't know how tbh :D

Link to comment
Share on other sites

In an effort to find some joy in programming again I've been learning how to "play" CoreWars. The game takes place on a finite, circular, initially empty array of instructions. The "players" are 2 programs, who are loaded randomly into the array, with no way of knowing where your opponent is located. These programs are written in a very simple, assembly-like language called Redcode. The programs are executed in turns: 1 cycle for player 1, 1 cycle for player 2. The goal is to make the other player's program execute a DAT instruction, which kills the process. It's quite fun if you're into that kind of stuff. The language was really simple when the game was first formulated, with 10 or so instructions, but it's since been expanded in such a way that lets you do really complex stuff

 

This is an excelent primer: http://vyznev.net/corewar/guide.html

 

I really want to play this - no time now, fighting the JNI for the good cause >:||

Link to comment
Share on other sites

i am soo bad at like actual programming/the stuff you compile, even though I'm a boss with ReaJS imo. It's just sometimes I'd like to try some things ReaJS can't, or would be a great speed improvement

 

I also want to make a VST IRC client for the lulz

 

for the record I made some rudimentary stuff in NES assembly too, but that compiles or whatever very fast because assembly?

 

I do wish ReaJS had fucking RECURSION why would they not include recursion

A CHATMM-VST would be the best thing ever, like "yo dawg I've heard you like IDM so we put some IDM in your IDM so you can IDM while you IDM !"
Link to comment
Share on other sites

In an effort to find some joy in programming again I've been learning how to "play" CoreWars.

Have you heard of TIS-100, it's from the makers of Spacechem and involves trying to make simple programmes in the cells you have given so the input bits match the expected output bits. Not erm the most beautiful game but here's a level I managed to do after a bit of brain huring -

 

CGwnec_W8AEabGb.png

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.