[Csnd] Graphs/Visualizations - Csound and OpenGL
Date | 2010-12-02 09:59 |
From | 4g63gsx |
Subject | [Csnd] Graphs/Visualizations - Csound and OpenGL |
I am trying to create a program to make basic graphs (and hopefully subsequently more complex visualizations), either in real time, or from a .pvx file with OpenGL. I am new to using Csound, and OpenGL for that matter, and I am trying to figure out a good process for the program, as well as which opcodes I need to use. I'm trying to make basic 2D graphs, plotting frequency vs. amplitude. I would like to be able to graphically see this relationship as a sound file is played. I've mostly been reading about pvs opcodes, and as of now I believe that I should use the pvsanal opcode to create an fsig stream. My plan is to send this fsig out, and somehow use the information from the signal to plot the graph. Two things that are holding me up are 1) how to send the fsig out (should I be using pvsout?) and 2) how to translate the data inside the fsig into a meaningful format for OpenGL to plot as a graph. I would appreciate any insight. |
Date | 2010-12-02 12:56 |
From | Rory Walsh |
Subject | [Csnd] Re: Graphs/Visualizations - Csound and OpenGL |
Do you have to use openGL? If I was going to do this I would use csoundo and processing. On 2 December 2010 09:59, 4g63gsx |
Date | 2010-12-02 16:19 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Graphs/Visualizations - Csound and OpenGL |
Attachments | pvsbus.c pvsbus.csd |
I assume you're either using C or C++ for this, if so, please find attached an example (C, CSD) that shows how to access the pvsin/out bus Fsig data is basically organised as a array of N+2 floats, with bins 0, 1 ... N, where each bin contains an amp, freq pair. Freqs are in Hz. Victor Send bugs reports to the Sourceforge bug tracker https://sourceforge.net/tracker/?group_id=81968&atid=564599 Discussions of bugs and features can be posted here To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" On 2 Dec 2010, at 09:59, 4g63gsx wrote: > > I am trying to create a program to make basic graphs (and hopefully > subsequently more complex visualizations), either in real time, or > from a > .pvx file with OpenGL. I am new to using Csound, and OpenGL for that > matter, > and I am trying to figure out a good process for the program, as > well as > which opcodes I need to use. > > I'm trying to make basic 2D graphs, plotting frequency vs. > amplitude. I > would like to be able to graphically see this relationship as a > sound file > is played. I've mostly been reading about pvs opcodes, and as of now I > believe that I should use the pvsanal opcode to create an fsig > stream. My > plan is to send this fsig out, and somehow use the information from > the > signal to plot the graph. > > Two things that are holding me up are 1) how to send the fsig out > (should I > be using pvsout?) and 2) how to translate the data inside the fsig > into a > meaningful format for OpenGL to plot as a graph. > > I would appreciate any insight. > -- > View this message in context: http://csound.1045644.n5.nabble.com/Graphs-Visualizations-Csound-and-OpenGL-tp3289130p3289130.html > Sent from the Csound - General mailing list archive at Nabble.com. > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body > "unsubscribe csound" > |
Date | 2010-12-08 06:50 |
From | 4g63gsx |
Subject | [Csnd] Re: Graphs/Visualizations - Csound and OpenGL |
Thanks for the replies, sorry I haven't been able to work on the project again until today. I was originally planning on using C++ and OpenGL, but since I only want to do basic graphing, I have decided to use Java instead. I am also open to the idea of using Csoundo, but I am having a problem implementing the library for Java (also hitting this roadblock in the Java version) as per this post: http://csound.1045644.n5.nabble.com/jcsound-lib-on-Mac-10-5-td1120391.html Victor - Thank you so much for the source file and example csd. They were both extremely helpful. Where I am confused now is, after I wrap the csound code into my Java project, how to access the internal csound variables (namely the kamp and kfrq outputs of the pvsanal opcode) from within the Java code. I am looking at some channel opcodes (such as chnexport), and maybe using FloatBuffer() in Java to read the stream. Is there a good way to go about this? Also, the other problem I am anticipating is how to synch up the Java program with the krate of the csound program. Essentially I want the graph to update itself at the same rate as my csound program is outputting the pvsanal opcode data. Any thoughts on this? |