[Csnd] FLslider problem when saving inverse min and max
Date | 2012-02-17 04:50 |
From | santiago ferreira |
Subject | [Csnd] FLslider problem when saving inverse min and max |
Hello, I encountered a strange problem using the FLTK opcodes (look for "PROBLEM" in the pasted code below). It seems that saving snapshots doesn't work for sliders with min > max (in the reverse direction). From the csound manual (http://www.csounds.com/manual/html/FLslider.html): The imin argument may be greater than imax argument. This has the effect of “reversing” the object so the larger values are in the opposite direction. This also switches which end of the filled sliders is filled. Am I doing something wrong or is this a bug? Thanks Santiago <CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform ; Audio out Audio in -odac -iadc ;;;RT audio I/O </CsOptions> <CsInstruments> sr=48000 ksmps=128 nchnls=2 ; PROBLEM: saving works when min is less than max: ; min max exp type disp w h ;#define SLDEFAULT #0, 1, 0, 6, -1, 20, 240# ; however, if min > max, saving doesn't work: ; min max exp type disp w h #define SLDEFAULT #1, 0, 0, 6, -1, 20, 240# FLpanel "ND_SaMPLeR", 880, 660, 0, 0, 3 FLscroll 880, 660, 0, 0 FLcolor 100, 118, 140 ; ----------------------------------------------------------------------------- ; FILTER ; ----------------------------------------------------------------------------- FLgroup "Filter", 300, 300, 20, 20, 5 gkSl1FFreq, ih FLslider "Freq", $SLDEFAULT, 40 * 1, 40 gkSl1FQ, ih FLslider "Q", $SLDEFAULT, 40 * 2, 40 gkSl1FMix, ih FLslider "Mix", $SLDEFAULT, 40 * 3, 40 FLgroupEnd ; ----------------------------------------------------------------------------- ; SAMPLER ; ----------------------------------------------------------------------------- FLgroup "Loop Sampler", 300, 300, 340, 20, 5 gkSl1SLStrt, ih FLslider "Lstrt", $SLDEFAULT, 40 * 9, 40 gkSl1SDur, ih FLslider "LsDur", $SLDEFAULT, 40 * 10, 40 gkSl1SXFade, ih FLslider "LsXF", $SLDEFAULT, 40 * 11, 40 gkSl1SStrt, ih FLslider "Strt", $SLDEFAULT, 40 * 12, 40 gkSl1SMode, ih FLslider "Mode", $SLDEFAULT, 40 * 13, 40 FLgroupEnd ; ----------------------------------------------------------------------------- ; AMPLITUDE ; ----------------------------------------------------------------------------- FLgroup "Amplitude", 300, 300, 20, 340, 5 gkSl1AAtck, ih FLslider "Atck", $SLDEFAULT, 40 * 1, 360 gkSl1ALevl, ih FLslider "Levl", $SLDEFAULT, 40 * 2, 360 gkSl1ARel, ih FLslider "Rel", $SLDEFAULT, 40 * 3, 360 gkSl1ALAmp, ih FLslider "Amp", $SLDEFAULT, 40 * 4, 360 gkSl1ALFrq, ih FLslider "Frq", $SLDEFAULT, 40 * 5, 360 gkSl1ALExp, ih FLslider "Exp", $SLDEFAULT, 40 * 6, 360 FLgroupEnd ; ----------------------------------------------------------------------------- ; PITCH ; ----------------------------------------------------------------------------- FLgroup "Pitch", 300, 300, 340, 340, 5 gkSl1PAtckT, ih FLslider "Atck", $SLDEFAULT, 40 * 9, 360 gkSl1PRelT, ih FLslider "RelT", $SLDEFAULT, 40 * 10, 360 gkSl1PStrtL, ih FLslider "StrL", $SLDEFAULT, 40 * 11, 360 gkSl1PSusL, ih FLslider "SusL", $SLDEFAULT, 40 * 12, 360 gkSl1PRelL, ih FLslider "RelL", $SLDEFAULT, 40 * 13, 360 gkSl1PLAmp, ih FLslider "lfoA", $SLDEFAULT, 40 * 14, 360 gkSl1PLF, ih FLslider "lfoF", $SLDEFAULT, 40 * 15, 360 FLgroupEnd ; ----------------------------------------------------------------------------- ; SNAPSHOTS ; ----------------------------------------------------------------------------- ; type #x #y w h x y gkSS, iSS FLbutBank 22, 4, 20, 200, 560, 20 * 33, 20, -1 ; ----------------------------------------------------------------------------- ; LOAD / SAVE ; ----------------------------------------------------------------------------- ; on off type w h #define BTNDEFLT #1, 0, 11, 60, 40# ;kout hnd FLbutton "label" x y op 1 2 3 4 gkLoad, iLd FLbutton "Load", $BTNDEFLT, 20 * 33, 600, 0, 24, 0, 3, gkSS gkSave, iSv FLbutton "Save", $BTNDEFLT, 20 * 38, 600, 0, 23, 0, 3, gkSS FLscrollEnd FLpanelEnd FLrun ; ----------------------------------------------------------------------------- ; LOAD / SAVE INSTR ; ----------------------------------------------------------------------------- instr 23 ; SAVE index init 0 ipstno = p4 Sfile sprintf "snapshot_simple.%d.snap", ipstno inumsnap, inumval FLsetsnap index ;, -1, igroup FLsavesnap Sfile endin instr 24 ; LOAD index init 0 ipstno = p4 Sfile sprintf "snapshot_simple.%d.snap", ipstno FLloadsnap Sfile inumload FLgetsnap index ;, igroup endin ; ----------------------------------------------------------------------------- </CsInstruments> <CsScore> f 0 3600 e </CsScore> </CsoundSynthesizer> |
Date | 2012-02-17 07:48 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Hello Santiago, As far as I know, this feature is not supported. You can not save presets of fltk sliders that are inverted. The support for fltk is limited and I think that no further development will be made to the opcodes either. They are in Csound for historical reasons, and for providing a quick and dirty way of making a gui. all best Oeyvind 2012/2/17 santiago ferreira |
Date | 2012-02-17 08:54 |
From | Tito Latini |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Attachments | None |
Date | 2012-02-17 14:33 |
From | luis jure |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
on 2012-02-17 at 09:54 Tito Latini wrote: >I have a fix, some tests and it will be soon in git that's great, tito, thank you! |
Date | 2012-02-17 16:00 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Fantastic Tito, I thought this was "case closed" :-) Oeyvind 2012/2/17 luis jure |
Date | 2012-02-17 18:43 |
From | Tito Latini |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Attachments | None |
Date | 2012-02-18 22:55 |
From | santiago ferreira |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Thanks a lot, you guys are fast! I should get more involved in the mailing list. What do you recommend as the best way of adding GUI to csound instruments? Since I'm using the C++ API, I'm actually just thinking now of doing the GUI in Qt, the FLTK opcodes are great though for quick prototyping. Best, Santiago On Fri, Feb 17, 2012 at 12:43 PM, Tito Latini <tito.01beta@gmail.com> wrote: I have noticed that also the following widgets |
Date | 2012-02-18 23:55 |
From | santiago ferreira |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
I just realized that my question was too broad, I'll explain what I'm working on so you have a better idea about the type of GUI I need. I am designing a drum machine with 4 voices. Each voice is assigned to a sample, amplitude and pitch envelopes and lfos, a low / high pass filter and the sample is played using flooper2. So basically... I need about 16 sliders controlling each voice (64 total). I need a way to load 16 parameters at once in csound each time a specific MIDI note is played. So for example, If I press middle C, a specific sample is loaded and 16 k-rate and i-rate variables are set. If I later press another note, another sample is loaded along with different 16 parameters. Then I want to save / load presets for each voice. I guess I could create the 64 variables, 16 for each voice and just assign sliders to all of them, but then I'll just end up with a lot of variables and code... not very nice... Any suggestions, comments? Thanks Santiago On Sat, Feb 18, 2012 at 4:55 PM, santiago ferreira <santifer1@gmail.com> wrote: Thanks a lot, you guys are fast! I should get more involved in the mailing list. What do you recommend as the best way of adding GUI to csound instruments? Since I'm using the C++ API, I'm actually just thinking now of doing the GUI in Qt, the FLTK opcodes are great though for quick prototyping. |
Date | 2012-02-19 01:57 |
From | Rory Walsh |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
CsoundQT is pretty good if you don't want to bother programming the API. You can quite quickly develop pretty complex GUIs there. I use the Juce C++ library. It's pretty nice. It's provides good cross platform MIDI and Audio IO classes so you can use Csound for the processing only. On top of that you can use Juce to create lots of plugin types. This is what Cabbage and Mike's CsoundVST do. They get VSTs to call Csound through the API. Anything you write with Juce that is a standalone instrument can pretty quickly be turned into a plugin. Apart from that I've had good experiences with wxWidgets. I found it really quite easy to use with lots of useful GUI classes. I've not used QT but obviously it's a pretty extensive toolkit too. Rory/ On 18 February 2012 23:55, santiago ferreira |
Date | 2012-02-19 03:53 |
From | santiago ferreira |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Hi Rory, Juce looks wonderful! I cannot believe I haven't seen it before. Do you use a designer to create the GUI in Juce? or do you code the GUI? I personally like to code GUI but it seems that using a designer is a better approach. Thanks for your informative email. Best, Santiago On Sat, Feb 18, 2012 at 7:57 PM, Rory Walsh <rorywalsh@ear.ie> wrote: CsoundQT is pretty good if you don't want to bother programming the |
Date | 2012-02-19 04:21 |
From | Michael Gogins |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
I am experimenting with using Qt and C++ directly to create compositions. I am changing some things about the CsoundAC MusicModel class to enable it to run Csound in a separate thread so the GUI remains responsive. I will make this available when it works and demonstrates what I am trying to do. CsoundQt is great, but it is possible to do larger and more complex GUIs directly in Qt. For you CsoundQt developers, I personally would find CsoundQt more useful if it had some sort of multiple tab control or multiple window facility. This would actually make a big difference. I've decided I need some GUI widgets to control Csound at least for tweaking instrument pans, positions, and for mastering (compression, reverb, EQ), and possibly for tweaking some instrument parameters. It may take me a while to figure out just what is the best way for me personally to work, or I may use one approach for some pieces and another approach for other pieces. Regards Mike On Sat, Feb 18, 2012 at 10:53 PM, santiago ferreira |
Date | 2012-02-19 15:28 |
From | Rory Walsh |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
I rather hand code my GUIs too. GUI designers are nice but I find they can be slower in the long run. On 19 February 2012 03:53, santiago ferreira |
Date | 2012-02-19 18:46 |
From | Tarmo Johannes |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Hello, On Saturday 18 February 2012 23:21:53 Michael Gogins wrote: > CsoundQt is great, but it is > possible to do larger and more complex GUIs directly in Qt. In CsoundQt (compiled with pythonqt support) it is possible to use a wrapper to Qt classes in python scripts or python cosole or even with python opcode s within the csound code. include it like from PythonQt.Qt import * and you cna reach all the power of Qt. greetings, tarmo |
Date | 2012-02-19 18:53 |
From | Michael Gogins |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
What you suggest would be a good suggestion for many people. However, for me, for my algorithmic composition code, I need the speed of LuaJIT or C++. Regards, Mike On Sun, Feb 19, 2012 at 1:46 PM, Tarmo Johannes |
Date | 2012-02-19 22:08 |
From | santiago ferreira |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
If I create the GUI in C++ Qt, how would you recommend I pass arguments back and forth? Right now I'm using the C++ API methods Csound::GetChannel(), Csound::SetChannel() and Csound::SetOutputValueCallback(). The problem with this is that I need to get/set each csound variable individually. Is there a way to get / set arrays of variables? Thanks On Sun, Feb 19, 2012 at 12:53 PM, Michael Gogins <michael.gogins@gmail.com> wrote: What you suggest would be a good suggestion for many people. However, |
Date | 2012-02-19 23:19 |
From | Rory Walsh |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
There is a method to retrieve the full list of channels. Can't recall its name but you'll find it in csound.h. It should help. On Sunday, 19 February 2012, santiago ferreira <santifer1@gmail.com> wrote: > If I create the GUI in C++ Qt, how would you recommend I pass arguments back and forth? Right now I'm using the C++ API methods Csound::GetChannel(), Csound::SetChannel() and Csound::SetOutputValueCallback(). > > The problem with this is that I need to get/set each csound variable individually. Is there a way to get / set arrays of variables? > > Thanks > > On Sun, Feb 19, 2012 at 12:53 PM, Michael Gogins <michael.gogins@gmail.com> wrote: >> >> What you suggest would be a good suggestion for many people. However, >> for me, for my algorithmic composition code, I need the speed of >> LuaJIT or C++. >> >> Regards, >> Mike >> >> On Sun, Feb 19, 2012 at 1:46 PM, Tarmo Johannes >> <tarmo.johannes@otsakool.edu.ee> wrote: >> > Hello, >> > >> > On Saturday 18 February 2012 23:21:53 Michael Gogins wrote: >> >> CsoundQt is great, but it is >> >> possible to do larger and more complex GUIs directly in Qt. >> > >> > In CsoundQt (compiled with pythonqt support) it is possible to use a wrapper >> > to Qt classes in python scripts or python cosole or even with python opcode s >> > within the csound code. include it like >> > >> > from PythonQt.Qt import * >> > >> > and you cna reach all the power of Qt. >> > >> > greetings, >> > tarmo >> > >> > >> > >> > >> > 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" >> > >> >> >> >> -- >> Michael Gogins >> Irreducible Productions >> http://www.michael-gogins.com >> Michael dot Gogins at gmail dot 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 | 2012-02-21 00:22 |
From | santiago ferreira |
Subject | Re: [Csnd] FLslider problem when saving inverse min and max |
Thanks to all for your helpful advice, I have a better idea of what direction to take now. On Sun, Feb 19, 2012 at 5:19 PM, Rory Walsh <rorywalsh@ear.ie> wrote: There is a method to retrieve the full list of channels. Can't recall its name but you'll find it in csound.h. It should help. |