[Csnd] ga-woes
Date | 2025-02-28 15:32 |
From | Maximilian Marcoll |
Subject | [Csnd] ga-woes |
Attachments | smime.p7s |
Hi everyone :) I have a situation in which my global a-variables don’t behave as I expected them to. I’m sure I might misunderstand some aspect of their general behaviour, maybe someone can help? In the following example, instr 10 is creating a ramp to either 1 or 0. I need the variable ga_tester to stay on its value until the next time instr 10 is being called. Alas, it doesn’t. In fact, it changes all the time. What am I missing here? <CsoundSynthesizer> <CsInstruments> sr = 44100 0dbfs = 1 nchnls = 1 ga_tester init 0 giramp = .01 instr 10 p3=giramp ga_tester linseg 1-p4, p3, p4 endin instr 81 asine poscil 1, 200 aout = asine * ga_tester out aout endin </CsInstruments> <CsScore> i10 1 1 1 i10 3 1 0 i81 0 5 </CsScore> </CsoundSynthesizer> ________________________________ Prof. Maximilian Marcoll Studio Director Studio for Electroacoustic Music (SEAM) University of Music Franz Liszt Weimar Bauhaus University Weimar |
Date | 2025-02-28 15:51 |
From | Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
Adding a printk, I see ga_tester climbing to 1 after 1 sec, staying at that value, then climbing down to zero, as expected. I hear it too. ======================== Prof. Victor Lazzarini Maynooth University Ireland > On 28 Feb 2025, at 15:32, Maximilian Marcoll |
Date | 2025-02-28 16:05 |
From | Maximilian Marcoll |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
Attachments | smime.p7s |
Hi! That’s exactly what I expected, but for some reaaon in my case ga_tester is oscillating rather weirdly all the time. I went back to 6.18 to see if there’s any difference but there isn’t. M ________________________________ Prof. Maximilian Marcoll Studio Director Studio for Electroacoustic Music (SEAM) University of Music Franz Liszt Weimar Bauhaus University Weimar
|
Date | 2025-02-28 16:27 |
From | Victor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE> |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
The value of ga_tester is steady here, tested on 6.18. Can you give printout showing the issue? You can add printk 0, ga_tester to instr 81.
Prof. Victor Lazzarini
Maynooth University
Ireland
On 28 Feb 2025, at 16:05, Maximilian Marcoll <maximilian.marcoll@hfm-weimar.de> wrote:
|
Date | 2025-02-28 16:56 |
From | Maximilian Marcoll |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
Attachments | favicon.ico smime.p7s |
Hi! I am afraid that doesn't illustrate the issue for me because the “weird oscillation” happens over exactly one k-cycle so that at every prrink-readout the values are ok. ksmps = 1 solves the issue (but is not possible in my situation). This is what the signal looks like after supposedly going back to zero: ________________________________ Prof. Maximilian Marcoll Studio Director Studio for Electroacoustic Music (SEAM) University of Music Franz Liszt Weimar Bauhaus University Weimar
|
Date | 2025-02-28 17:19 |
From | Eduardo Moguillansky |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
Attachments | favicon.ico |
I can see the "oscillations" also. Without looking at the source I assume that the offending part is changing p3 and its effects on linseg. This modification gets rid of the oscillations: instr 10 ga_tester linseg 1-p4, giramp, p4 if eventtime() > giramp then turnoff endif endin On Fri, Feb 28, 2025 at 5:57 PM Maximilian Marcoll <maximilian.marcoll@hfm-weimar.de> wrote:
|
Date | 2025-02-28 17:48 |
From | vlz |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
ah, ok but ga_tester does not change, it is the same block of ksmps that was last generated. The block may not have a single value sample, but a ramp, and that's what you see oscillating. The way to guarantee a single value at the end is to make sure the envelope stops ramping up before the instrument stops generating it. Prof. Victor Lazzarini Maynooth University Ireland On 28 Feb 2025, at 16:57, Maximilian Marcoll <maximilian.marcoll@hfm-weimar.de> wrote:
|
Date | 2025-02-28 21:19 |
From | Maximilian Marcoll |
Subject | Re: [Csnd] [EXTERNAL] [Csnd] ga-woes |
Attachments | smime.p7s |
Wow, ok, thanks a lot for that explanation! Like this it works now: <CsoundSynthesizer> <CsInstruments> sr = 44100 0dbfs = 1 nchnls = 1 ksmps = 32 ga_tester init 0 giramp = .01 instr 10 p3=giramp ga_tester linseg 1-p4, p3-1/kr, p4, 1/kr, p4 endin instr 81 asine poscil 1, 200 aout = asine * ga_tester printk 0, k(ga_tester ) out aout endin </CsInstruments> <CsScore> i10 1 1 1 i10 3 1 0 i81 0 5 </CsScore> </CsoundSynthesizer> ________________________________ Prof. Maximilian Marcoll Studio Director Studio for Electroacoustic Music (SEAM) University of Music Franz Liszt Weimar Bauhaus University Weimar
|