objarni's picture

Simple OpenTK/OpenAL example..?

I would like to play programmatically generated sine wave (or other waveform) through OpenTK.

1) Is it possible?
2) Does anybode have a GameWindow example of this?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
the Fiddler's picture

No such luck, big additions in 0.9.1 to OpenTK.Math (double precision numerals, many new matrix methods, courtesy of JTalton). The only classes that have stayed more or less stable are the ones in OpenTK.Input.

Starting from 0.9.1 things should get more stable, if only because there are few things left to change :p This includes OpenGL.GL, OpenAL.AL, Math, GraphicsContext and GLControl. GameWindow might see a few changes (multithreaded operation), but there's little else left to change on existing interfaces. The rest of the work is mostly internal (multisampled modes, OSX), plus a new interface for joystick input.

Inertia's picture

Thanks for proving my point. "more stable" still isn't "stable" ;)

Regarding examples, already when writing the bindings there was the plan to add a larger OpenAL app which shows how to use sources, Efx effects and filters together, so one can load a .wav of their choice and toy around with all the settings and see (or "hear") how they affect how the wav file is played back. Not sure what else is needed for OpenAL, it's kinda straightforward to use once you realize that it's alot simpler than OpenGL and there usually is only 1 way to do things. (AL ~100 functions with efx/xram extension, GL ~1500 functions with all extensions)

Edit: I've created a topic to gather feedback/suggestions for tutorials, all the functions that went through the VersionXY changes with 0.9.0 are probably not going to be changed anymore. http://www.opentk.com/node/292

objarni's picture

Is it only OpenTK.Math that has not changed at the public API level..? I thought OpenTK was supposed to be a wrapper around OpenGL/OpenAL, not a completely new library :)

the Fiddler's picture

Heh, you could call it a new wrapper around OpenGL/OpenAL. :)

Semantics aside, there's some stuff in OpenTK that, to the best of my knowledge, hasn't been done before. Token lists per GL/AL function, merging GL/AL functions into overloads, cross-platform integration with Windows.Forms to name a few. Not rocket science, but new nonetheless.

Not all features were available from the start, so we had to change e.g. the OpenGL API even though the underlying native library is the same.

Inertia's picture

Well, if you want pure bindings to GL/AL, then Tao is for you. OpenTK aims to assist in writing code for those APIs, the overloads and enums do remove alot of googling or otherwise looking up command parameters. Helpers are added where it makes sense and those changes affect the public API ofcourse, but I admit that the VersionXY removal was probably the largest change that OpenTK has seen for a while.

It's very important that you add your tutorial suggestions to the wishlist though, I'm just adding samples of techniques I'm toying around with (GLSL fractals will be in 0.9.1, deferred rendering in 0.9.2) but I wouldn't have come up with the samples you mentioned as 6&7.

Qba's picture

Only waves are supported right now
Would it be possible to add that information to the reference? Just spent some time testing various formats... :)

BTW - I am new here and would like to mention that OpenTK is really great! Very good idea and nice implementation. Hope that it will develop fast and I wish good luck to the authors!

Inertia's picture

Welcome :)

OpenTK.Utilities is currently very ... alpha ;) It will be properly documented once it's closer to completion.