[Csnd] Rendering a multichannel file from multiple instances of one instrument
| Date | 2025-07-08 16:05 |
| From | Philipp Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | [Csnd] Rendering a multichannel file from multiple instances of one instrument |
hello everybody!
i try to find a quick solution for rendering a multichannel file, from a instrument that produces a mono signal, but is called in a loop an gets an index from the channel count.
here is a dummy code
instr ctrl_instr
iCnt init 0
while (iCnt < 21) do
event_i(„i“, „signal“, 0, 1, iChannel)
iCnt += 1
iChannel += 1
od
endin
instr signal
aSig poscil 0.5, 440
outch p4, aSig
endin
is there an elegant and quick solution for this?
greetings,
philipp
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2025-07-08 16:41 |
| From | vlz |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
your solution looks pretty good to me.
Prof. Victor Lazzarini
Maynooth University
Ireland
> On 8 Jul 2025, at 16:05, Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie> wrote:
>
> hello everybody!
>
> i try to find a quick solution for rendering a multichannel file, from a instrument that produces a mono signal, but is called in a loop an gets an index from the channel count.
>
> here is a dummy code
>
> instr ctrl_instr
> iCnt init 0
> while (iCnt < 21) do
> event_i(„i“, „signal“, 0, 1, iChannel)
> iCnt += 1
> iChannel += 1
> od
> endin
>
> instr signal
> aSig poscil 0.5, 440
> outch p4, aSig
> endin
>
> is there an elegant and quick solution for this?
>
> greetings,
> philipp
>
> Csound mailing list
> Csound@listserv.heanet.ie
> https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
> Send bugs reports to
> https://github.com/csound/csound/issues
> Discussions of bugs and features can be posted here
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2025-07-08 16:43 |
| From | "Jeanette C." |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
Hi Philipp,
you can use outch, which takes a channel parameter:
outch kchannel_number, aSignal ...
It can take further pairs of channel and signal.
Depending on what you REALLY want to do, there are other ways. If you want to
create an instrument that potentially oututs its audio to all channels that
the performance has, never mind how many or... You might take a look at the
out* opcodes or perhaps create an intermediate instrument that takes audio
from a channel (chn opcodes) and then performs magic with that, leaving the
source instrument(s) more or less untouched or in a simple form.
Best wishes,
Jeanette
--
* Website: http://juliencoder.de - for summer is a state of sound
* Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
* Audiobombs: https://www.audiobombs.com/users/jeanette_c
* GitHub: https://github.com/jeanette-c
'Cause I don't have to feel the heat of the sun
To know it's shining on me every day <3
(Britney Spears)
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here |
| Date | 2025-07-08 16:54 |
| From | Philipp Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
ok, thats weird. i reduced my code to a minimal example and it stillt not works like i suggested. i run csound in emacs and it runs forever when i try to render this. is there something wrong? |
| Date | 2025-07-08 16:58 |
| From | Eduardo Moguillansky |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
Your performance does not have an end. Either add an end score statement or call exitnow On Tue, Jul 8, 2025 at 5:54 PM Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie> wrote: ok, thats weird. i reduced my code to a minimal example and it stillt not works like i suggested. i run csound in emacs and it runs forever when i try to render this. |
| Date | 2025-07-08 17:03 |
| From | vlz |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
It will run forever because there is no score or end event. You can add "f 0 time" to close Csound at a given time. Or send in an "e" event, with 0, time as pfields. Prof. Victor Lazzarini Maynooth University Ireland > On 8 Jul 2025, at 16:54, Philipp Neumann <0000119f78f3a4f9-dmarc-request@listserv.heanet.ie> wrote: > > ok, thats weird. i reduced my code to a minimal example and it stillt not works like i suggested. i run csound in emacs and it runs forever when i try to render this. > is there something wrong? > > |
| Date | 2025-07-08 17:58 |
| From | Tarmo Johannes |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
Hi! As your score is empty, it is correct that ir runs forever. You can add f 0 to the score to keep it running for a certain time. Like f 0 5 ; keep running for 5 seconds or i "ctrl" 0 5 ; Csound exits when the score events will be ended. If you want to render the output to a file, you should add an -o FILE option, something like: -o name.wav not -odac But maybe you are using some other sort of solution or pipe the audio to some other program or so. As always, there are som many ways to achieve one thing. (like monitor and fout opcodes bu your solution should work, too). Best! tarmo Kontakt Philipp Neumann (<0000119f78f3a4f9-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval T, 8. juuli 2025 kell 18:54: ok, thats weird. i reduced my code to a minimal example and it stillt not works like i suggested. i run csound in emacs and it runs forever when i try to render this. |
| Date | 2025-07-09 07:25 |
| From | luis antunes pena <00000fd5d0d20dbf-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
|
Hi Philipp, maybe you are looking for the fout opcode, as Tarmo mentioned? Best, Luís On 08.07.25 18:58, Tarmo Johannes
wrote:
|
| Date | 2025-07-09 09:33 |
| From | Philipp Neumann <0000119f78f3a4f9-dmarc-request@LISTSERV.HEANET.IE> |
| Subject | Re: [Csnd] Rendering a multichannel file from multiple instances of one instrument |
Thanks all! The problem was, Csound was running forever, because of a missing end of score statement! Greetings, Philipp > Am 09.07.2025 um 08:25 schrieb luis antunes pena <00000fd5d0d20dbf-dmarc-request@LISTSERV.HEANET.IE>: > > Hi Philipp, > maybe you are looking for the fout opcode, as Tarmo mentioned? > Best, > Luís > > > On 08.07.25 18:58, Tarmo Johannes wrote: >> Hi! >> >> As your score is empty, it is correct that ir runs forever. You can add f 0 to the score to keep it running for a certain time. Like >> >> f 0 5 ; keep running for 5 seconds >> >> or >> >> i "ctrl" 0 5 ; Csound exits when the score events will be ended. >> >> If you want to render the output to a file, you should add an -o FILE option, something like: >> -o name.wav >> not -odac >> >> But maybe you are using some other sort of solution or pipe the audio to some other program or so. >> As always, there are som many ways to achieve one thing. (like monitor and fout opcodes bu your solution should work, too). >> >> Best! >> tarmo >> >> >> >> Kontakt Philipp Neumann (<0000119f78f3a4f9-dmarc-request@listserv.heanet.ie>) kirjutas kuupäeval T, 8. juuli 2025 kell 18:54: >> ok, thats weird. i reduced my code to a minimal example and it stillt not works like i suggested. i run csound in emacs and it runs forever when i try to render this. >> is there something wrong? >> >> |