Perl 6 - the future is here, just unevenly distributed

IRC log for #openframeworks, 2013-11-19

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:00 admsyn actually it could probably just be safely assumed that OF_PATH = the addon path, but up a level :)
00:00 pizthewiz As a default value it might be nice though as it may be the general use case, no?
00:00 admsyn unless the user's doing something weird
00:00 admsyn yeah
00:00 pizthewiz Exactly
00:00 pizthewiz I'm trying to make my project somewhat isolated from where oF is and it is interesting how many places paths creep in :0)
00:00 admsyn I know right :)
00:01 pizthewiz Seems like it could be particularly problematic for people collaborating
00:01 admsyn yeah I've run into that before :/
00:02 admsyn so to do the OF_PATH, I think it just needs to be shimmed in here : https://github.com/admsyn/OFPlugin/​blob/master/OFPlugin/OFAddon.m#L85
00:02 admsyn at the end of that just going through all the build settings and OF_PATH-ing them
00:03 admsyn _config is just a dictionary of arrays, where the keys are e.g. ADDON_INCLUDES and the arrays are just all the values for that setting
00:03 admsyn so iterating through [_config objectEnumerator] and just replacing ../../../ with whatever OF_PATH is would do it :)
00:03 jedahan joined #openframeworks
00:03 admsyn it's been a whole week since I've looked at this so naturally I've forgotten everything
00:07 pizthewiz Debugging the plugin must be exciting, can you set a second instance of the app as the executable?
00:07 admsyn nope, it's debugged the dumb way :)
00:07 admsyn tail -f /var/log/system.log
00:07 admsyn or whatever
00:07 admsyn and NSLog-ing everything :/
00:08 admsyn in theory you could attach the debugger to xcode and run two xcodes but…engh
00:17 pizthewiz Hmm, I tried enumerating keys/objects after -parseAddonConfig:forPlatform: and it was apparently empty. To investigate another time
00:17 admsyn yeah it'll only get populated if there's an addon_config.mk
00:17 admsyn but thanks for checking it out
00:18 pizthewiz Ahh, the Osc add-on doesn't have one of those
00:41 pizthewiz Strange, even though we have OF_PATH cracking open the PG-generated project.pbxproj file, it has several hard-coded uses of "../../.." a few of which are easily swapped to $(OF_PATH) but the GLUT framework reference doesn't appear to be
00:47 robot joined #openframeworks
01:14 pizthewiz Hasty fixes for 3 of the 5 hardcoded "../../.." references from PG: https://gist.github.com/pizthewiz/7538466
01:49 admsyn pizthewiz: oh nice
01:50 pizthewiz I got it down to 4 of 5 and if we are ok not recompiling the oF static libs (normal use case for people that download binary builds?), then the reference to the parent oF Xcode project can be removed too.
01:51 pizthewiz Are there situations when someone downloading an oF release *would* want to clean and rebuild the oF library as part of a dependency to their own project?
01:52 admsyn I don't think, assuming you're not going to be modifying oF itself of course
01:52 admsyn you mean just having an openFrameworks static lib and linking against that?
01:53 pizthewiz Ahh, I thought the binary releases had pre-built binaries, it looks like users still build them.
01:53 admsyn yeah
01:54 admsyn also I believe the rationale for that is it's less indirection for when people want to look at the oF source
01:54 pizthewiz Either way in my project needs, I can handle building oF separately from projects, it seems like a major bummer (for the earth) that the default project behavior for a clean will ripple into the oF subproject as well.
02:05 modality joined #openframeworks
02:09 modality_ joined #openframeworks
02:33 modality joined #openframeworks
02:47 _ilbot joined #openframeworks
02:47 Topic for #openframeworks is now Welcome to http://openframeworks.cc/ | logs at http://irclog.perlgeek.de/openframeworks/
03:28 test___ joined #openframeworks
04:02 pizthewiz joined #openframeworks
04:06 modality joined #openframeworks
04:18 modality joined #openframeworks
05:05 dantheman joined #openframeworks
05:20 dantheman joined #openframeworks
05:33 modality joined #openframeworks
05:46 modality joined #openframeworks
06:14 pizthewiz joined #openframeworks
06:24 pizthewiz joined #openframeworks
06:28 oktapodi_ joined #openframeworks
07:09 modality joined #openframeworks
09:40 ldvg joined #openframeworks
09:46 igorline joined #openframeworks
09:49 visuman joined #openframeworks
10:09 sh1v Any OF peeps going to burning man next year?
10:27 neue joined #openframeworks
10:51 igorline joined #openframeworks
11:19 oktapodi joined #openframeworks
12:20 jonbro joined #openframeworks
12:20 jonbro sup openframeworks.
12:20 jonbro anyone around :?
12:20 jonbro :)
12:20 jonbro ha
12:44 oktapodi_ joined #openframeworks
13:40 superFluid joined #openframeworks
13:52 jonbro_ joined #openframeworks
14:05 galitl joined #openframeworks
14:05 galitl hey all :) I'm new to of and was wondering if you can hep me with a silly question
14:25 asper dont ask to aks.
14:28 jonbro yeah, hit us.
14:29 jonbro although taking things into the forums tends to get you quicker response in my experience.
14:30 galitl thanks :)
14:32 galitl i'm trying to set an ofCircle in the testApp.h but get an error that it's an unknown type :/
14:32 jonbro paste bin your code.
14:32 jonbro actually nvmnd...
14:33 galitl #pragma once  #include "ofMain.h"  class testApp : public ofBaseApp{ public: void setup(); void update(); void draw();  void keyPressed(int key); void keyReleased(int key); void mouseMoved(int x, int y); void mouseDragged(int x, int y, int button); void mousePressed(int x, int y, int button); void mouseReleased(int x, int y, int button); void windowResized(int w, int h); void dragEvent(ofDragInfo dra
14:33 jonbro I mean, do if you want...
14:33 jonbro http://pastebin.com/
14:33 jonbro put it there.
14:33 jonbro the problem is that ofCircle is a function call, and should be called within the draw loop for it to show up on screen.
14:33 jonbro inside of testApp.cpp
14:34 galitl so It doesn't work like the ofRectangle? :(
14:35 galitl I wanted to set these up so i can re-use them instead of copy-pasting code :/
14:36 jonbro nope, it doesn't work like ofRectangle.
14:36 jonbro you could make your own circle class if you wanted to.
14:37 jonbro it works more like ofRect()
14:37 jonbro why would you be copy pasting code?
14:37 galitl got it! thanks so much!
14:37 galitl won't be, if I use a for loop :)
14:38 jonbro if you wanted to make a circle class, it wouldn't be the hardest thing.
14:38 jonbro it would just have a ofVec2f (or ofVec3f) to define the center, and then a float radius
14:38 jonbro and maybe a draw function if you wanted.
14:40 galitl thanks :) I think i'll tackle it step by step
14:40 galitl off to class, thank you so much for helping me out!
14:43 jonbro lol at this chat room
15:25 modality joined #openframeworks
15:26 modality joined #openframeworks
15:30 dackdel1 joined #openframeworks
15:34 vade joined #openframeworks
15:35 dackdel joined #openframeworks
15:44 Zovi joined #openframeworks
15:44 Zovi anyone familiar with making soundstream not break?
15:45 Zovi I'm trying to make one soundstream do more than one waveform at a time
15:45 Zovi is that something that's impossible?
15:47 jonbro nope, should be possible.
15:47 oneirona1t joined #openframeworks
15:47 jonbro what is the issue you are having?
15:48 ximian_ joined #openframeworks
15:48 Zovi jonbro, I'm trying to modify the code in the sound example that comes with OF
15:49 Zovi so that I can have a nested for loop
15:49 Zovi that gives it a bunch of different pan and frequency values from a 2D array
15:49 Zovi basically I'm making a grid of oscillators
15:49 Zovi that I want all to make sound
15:49 Zovi right now it's 768 of them but it didn't work when I cut it down to 6 so it's totally not the size
15:50 Zovi when I run it, no sound is created, and it gets under/overflow warnings
15:53 jonbro hmmm.
15:53 jonbro well, buffer underflows suggest that it is taking too long to calculate.
15:53 Zovi actually, with only one going (in the for loop, but it shouldn't matter, right?) it still has issues and outputs nothing
15:54 jonbro can you post your code on https://gist.github.com/
15:54 Zovi err the specific warning is "ofRtAudioSoundStream: stream over/underflow detected"
15:54 Zovi yes I'll post the relevant parts
15:54 jonbro yeah, that shouldn't stop it from making audio, should just make it glitch out.
15:58 ldvg joined #openframeworks
15:58 Zovi jonbro here's the setup, update, and audioOut for this https://gist.github.com/ano​nymous/14782d0237a0e39db310
15:59 Zovi they do everything I think
15:59 Zovi apologies for messy code
15:59 jonbro yeah, that should be enough.
16:00 jonbro are you sure the findbri array isn't full of 0s?
16:00 Zovi well it isn't initialized as anything before I start filling it
16:00 Zovi it would be full of 0s though if the screen is black
16:00 Zovi I think
16:01 jonbro you might just want to take out the * volume bit to make sure that isn't the issue.
16:01 jonbro or set volume to 1
16:01 Zovi ok
16:01 Zovi that will create a wonderful wall of pain
16:01 Zovi I'll go for it
16:01 jonbro also, if you want to mix together a bunch of waveforms, you should first 0 out the output arrays, then += the value of the wave forms into them.
16:01 jonbro DON'T WEAR HEADPHONES!
16:01 Zovi I MAKE NOISE MUSIC I'LL BE OK
16:01 Zovi but you're right I won't for this
16:01 jonbro dap fuckups are worse than the worst noise music ever.
16:02 jonbro er dsp...
16:02 Zovi I already experienced one with this
16:02 jonbro haha,
16:02 Zovi after closing the program, actually
16:02 jonbro oof.
16:02 Zovi it just flipped its shits
16:02 Zovi and did this http://i.imgur.com/FFnBB2f.png
16:03 Zovi aight going to run it now
16:03 Zovi okay it doesn't sound like I thought it would hahah
16:03 Zovi oh
16:03 Zovi that's why
16:03 Zovi nvm
16:04 jonbro hahah
16:04 jonbro wait, so what fixed it?
16:04 Zovi no it's not fixed
16:04 jonbro ok.
16:04 jonbro that output is bonkers!
16:04 Zovi ok so
16:04 Zovi tons of warnings
16:05 Zovi oh sweet it's beeping like nuts
16:05 Zovi it did it again
16:05 Zovi yeah that doesn't work
16:05 jonbro hmmm.
16:05 Zovi even with volume out of it
16:05 Zovi volume is 1
16:05 jonbro ok, I think there is an issue on windows with the audio.
16:05 jonbro let me try and remember while staring deeply into your code.
16:05 Zovi :o
16:05 Zovi thanks for helping, by the way
16:05 jonbro can you set it to run in release mode rather than debug?
16:05 jonbro np!
16:06 Zovi I have never run an OF project in release mode hahah
16:06 Zovi I need to look up how to do that
16:06 jonbro I seem to recall debug mode produced a bunch of beeping on windows
16:06 jonbro what IDE are you using?
16:06 Zovi codeblocks
16:06 jonbro there should just be a drop down to switch between debug and release.
16:06 Zovi oh it's already on release
16:06 Zovi should I try debug then?
16:07 jonbro maybe?
16:07 jonbro also changing the buffer size might help.
16:07 Zovi oh yes
16:07 Zovi that actually might be a good diea
16:07 Zovi idea
16:07 Zovi higher, I'd assume?
16:07 jonbro yeah.
16:07 jonbro set buffer size to 1024.
16:07 Zovi ok
16:08 jonbro try setting that "4" at the end of soundStream.setup to 8 also?
16:08 jonbro oh, also... if you are using a good sound card, don't.
16:08 jonbro like unplug it, and use your shitty windows sound card.
16:08 jonbro there is a fix deep in the code for that.
16:08 Zovi nah I'm using default windows sound card
16:08 jonbro ok, cool.
16:08 Zovi I think
16:08 Zovi I mean yes
16:08 jonbro does it support ASIO?
16:09 jonbro because I had issues with OF defaulting to ASIO soundcards.
16:09 Zovi y'know I never really checked that but I use an external sound card that does
16:09 Zovi however, that's not plugged in
16:09 jonbro ok, that shouldn't be the issue.
16:10 Zovi going to try running again with those settings
16:15 Zovi yeah nope
16:17 jonbro hmmm, maybe take it to the forum.
16:17 jonbro when you run the audio example does it work?
16:18 Zovi yes, the audio example works
16:18 jonbro hmm.
16:21 jonbro ok, so it should a be playing a 100 hz sine wave
16:21 Zovi well let's see what happens when I run it without the for loops, just one instance
16:22 jonbro what does             phaseAdder = 0.95f * phaseAdder + 0.05f * phaseAdderTarget;
16:22 jonbro do?
16:22 jonbro the for loops shouldn't be doing anything.
16:23 Zovi that line decides the frequency
16:23 Zovi er
16:23 jonbro but phaseAdderTarget = (pitch / (float) sampleRate) * TWO_PI; decides the frequency.
16:23 Zovi yes
16:24 Zovi uh
16:24 Zovi this is how the audio example works
16:24 jonbro oh rly.
16:24 Zovi like this is pulled straight from that
16:24 jonbro hah, ok cool.
16:24 Zovi it does seem kind of weird but I think it has something to do with how it generates sine tones
16:26 jonbro yeah, that line is fucking baffling.
16:26 Zovi anyway the for loop's purpose is to populate the grid of tones
16:26 Zovi pitch & pan
16:26 jonbro yep.
16:26 Zovi and then the volume is the brightness
16:26 Zovi so
16:26 jonbro that all makes sense.
16:26 Zovi I removed that
16:26 Zovi went for n = 5 and p = 5 hardcoded
16:26 Zovi and it gives a weird pulse
16:26 Zovi and crashes
16:27 jonbro oh I see why they have phase adder and phase adder target...
16:27 jonbro it is so it lerps between the values.
16:28 jonbro are pitch and pan floats?
16:28 Zovi yeah
16:30 jonbro I see a problem :D
16:30 jonbro float sample = sin(phase)+phase;
16:30 jonbro in your code...
16:31 jonbro float sample = sin(phase);
16:31 jonbro in the example code.
16:31 jonbro shouldn't cause it to crash.
16:31 Zovi oh
16:31 Zovi oops
16:31 jonbro but it might, if phase is big enough.
16:31 Zovi I meant to get rid of that anyway
16:32 Zovi oh hey it stopped screwing up
16:32 Zovi was THAT it
16:32 jonbro :D
16:32 jonbro haha
16:32 jonbro yeah, I think so.
16:32 Zovi now let's try turning everything back on
16:32 Zovi and hope it doesn't explode
16:32 jonbro there is another problem with your code...
16:32 Zovi ?
16:32 jonbro it isn't going to work.
16:32 Zovi oh
16:32 Zovi that's a problem yes
16:32 Zovi is there a specific reason?
16:33 jonbro or it will, but it will reset the sine phases down to 0 for every loop.
16:33 jonbro you are going to need to have an array of phases equal to the size of the number of sine waves you want playing.
16:35 jonbro because each sine wave needs to store its own offset as it goes along.
16:35 Zovi okay, so I'd populate that array in the for loop and build the sound outside of it, then?
16:36 jonbro well, it would look like phase[p][n] += phaseAdder
16:36 jonbro then float sample = sin(phase[p][n])
16:37 Zovi wait, so, it'll just keep going in the for loop and I wouldn't have to change anything except for it being an array instead of a regular thing?
16:38 jonbro I am not sure I follow.
16:39 jonbro also that             phaseAdder = 0.95f * phaseAdder + 0.05f * phaseAdderTarget; is going to give you problems.
16:39 Zovi I mean, can I just replace instances of "phase" with "phase[p][n]" and change the declaration to be an array and it'll work?
16:39 jonbro yeah.
16:39 Zovi huh, what sort of problem?
16:39 jonbro make sure you populate the array with 0s up front though.
16:39 Zovi both arrays or just that one in particular?
16:40 jonbro you mean the findBri array?
16:40 Zovi yea
16:40 Zovi h
16:40 jonbro yeah, you should probably just ignore that for now, until you get the audio working.
16:40 jonbro just set volume to 1.
16:41 jonbro also the phaseAdder should just be phaseAdder = phaseAdderTarget.
16:41 jvcleave_ joined #openframeworks
16:41 Zovi ok
16:41 jonbro get rid of any frequency lerping you have going on.
16:42 jonbro you might actually want to set volume lower, so you don't add (1+1)*however many sins you have.
16:42 jonbro will blow out your speaker.
16:42 Zovi well it's multiplied by 0.5
16:42 Zovi I've got my sound quite low don't worry
16:43 Zovi but sure, I'll go for 0.1 instead
16:43 jonbro I might multiply by 1.0f/number_of_sines
16:43 Zovi 1/768 then
16:46 Zovi nah too quiet
16:46 jonbro ha, ok.
16:46 jonbro you might want to try with just 10 sines first.
16:46 Zovi also it's only doing one tone with some clicking on the right and high
16:46 Zovi mm
16:46 Zovi or 6
16:47 jonbro that pitch=50*(p+1) means that by the 400th sine, it will be over 22050 frequency, which means you won't hear it anyways.
16:49 jonbro did you change your output lines to be += rather than just =?
16:49 jonbro because you need to sum the outputs of the sines together
16:49 Zovi wait, what
16:49 jonbro if you don't, it will just play the last sin you put in.
16:51 jonbro lAudio[i] = output[i*nChannels    ] = sample * volume * 0.5 * leftScale;
16:51 jonbro should actually be                 output[i*nChannels    ] += sample * volume * 0.5 * leftScale;
16:51 Zovi oh
16:51 Zovi no but also
16:51 jonbro otherwise just the last sin you put in will get to the soundcard
16:51 Zovi pitch should never get that high
16:52 Zovi since it's the same pitch range for each pan position
16:52 jonbro oh right.
16:52 jonbro good call.
16:52 Zovi that said, I totally just realized it'll have high on the bottom and low on the top
16:52 Zovi oops
16:52 Zovi but that's ok if it works
16:52 Zovi lemme try with the +-=
16:52 Zovi =
16:53 Zovi hey, there we go
16:54 Zovi that solved the multiple things going at once thing
16:54 Zovi now
16:54 Zovi going to try with 24 and 32 again
16:54 Zovi it is making the coolest sound
16:55 jonbro sweet!
16:55 Zovi not a good one
16:55 jonbro haha
16:55 Zovi also shittons of stream over/underflow warnings
16:55 Zovi maybe i should just tone down the number
16:55 Zovi jeez I needed to pop my ears after that
16:55 jonbro maybe do output[i*nChannels    ] += sample * (1.0f/(p+n));
16:56 jonbro or actually output[i*nChannels    ] += sample * (1.0f/(p*n));
16:56 Zovi what would that do?
16:56 jonbro it would lower the volumes based on the number of sines you have.
16:57 jonbro and guarantee that your numbers aren't going out of range.
16:57 Zovi that second one is good
16:58 Zovi huh ok so I brought it down halfway and it's much easier to manage but it crashes
16:58 Zovi hmm
17:05 jonbro you brought what down halfway?
17:05 Zovi uh the resolution of everything
17:05 Zovi except I think I did it wrong
17:05 jonbro ah.
17:05 Zovi gotta check
17:05 Zovi it broke for some reason
17:05 Zovi I think I did one of the math wrong
17:13 dackdel joined #openframeworks
17:25 Zovi !mail
17:25 Zovi o
17:25 Zovi well if anyone sees jonbro let them know it went well
17:25 Zovi or something
17:33 GuidovanPossum joined #openframeworks
17:47 jonbro joined #openframeworks
18:30 visuman joined #openframeworks
18:38 dackdel left #openframeworks
18:38 pizthewiz joined #openframeworks
18:42 GuidovanPossum joined #openframeworks
19:28 modality joined #openframeworks
19:28 modality joined #openframeworks
20:38 modality joined #openframeworks
20:39 modality joined #openframeworks
20:51 admsyn joined #openframeworks
21:12 GuidovanPossum joined #openframeworks
21:18 jvcleave joined #openframeworks
22:12 robot joined #openframeworks
22:16 admsyn joined #openframeworks
22:20 admsyn joined #openframeworks
22:32 modality joined #openframeworks
22:33 modality joined #openframeworks
23:06 igorline joined #openframeworks
23:30 admsyn joined #openframeworks
23:56 robot joined #openframeworks

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary