# Grains on fly (granular synthesis)

**URL:** <https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735>\
**Category:** Cabbage recipes\
**Created:** [28 July 2021 08:24 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735 "2021-07-28T08:24:33Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [28 July 2021 08:24 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/1 "2021-07-28T08:24:34Z")

</div>

Hi to all,  
I am pleased to share this realization of granular synthesis.  
This is an effect plugin.  
thanks to Rory and all the csounders! [GrainOnFly.csd](https://forum.cabbageaudio.com/uploads/short-url/68IdEmkFO18jr2Wgx5BICwg1cDw.csd) (9.1 KB)

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [28 July 2021 08:28 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/2 "2021-07-28T08:28:46Z")

</div>

This is nice. It took me a minute to realise I had to actual play notes on the keyboard after I sampled my voice :rofl I’m putting this down to it being too early in the morning for me!

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [28 July 2021 08:49 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/3 "2021-07-28T08:49:15Z")

</div>

☀ The original freq is assigned to key c3. I realize now that it is better to have middleC(1) instead of middleC(3) on the virtual keyboard settings. However, I notice that the number of keys changes, but the sound result remains as before. For me it is not important, because I use a masterkeyboard, but I suspect there is something to change in the “keyboard” widget.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [28 July 2021 08:59 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/4 "2021-07-28T08:59:14Z")

</div>

apart from that, it seems to me that the new version Cabbage 2.7 and the csound opcodes respond very well.

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [28 July 2021 09:07 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/5 "2021-07-28T09:07:03Z")

</div>

> [@strapparts](#):
>
> The original freq is assigned to key c3. I realize now that it is better to have middleC(1) instead of middleC(3) on the virtual keyboard settings.

This is just visual as different DAWs tend you label C60 as either C3 or C4. If you want to show a different range for the keyboard you can use `value(midiNoteNumber)`. If you want to remap MIDI notes you will need to it on the Csound side.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [28 July 2021 09:34 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/6 "2021-07-28T09:34:48Z")

</div>

Ok, thanks, with this:  
keyboard bounds( 5, 365, 480, 90), value(36), middleC(4)  
the matter is settled. 🙂

---

<div class="post-metadata">

**Author:** ![mjmogo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mjmogo/32/3522_2.png) [@mjmogo](https://forum.cabbageaudio.com/u/mjmogo)\
**Post date:** [28 July 2021 19:25 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/7 "2021-07-28T19:25:57Z")

</div>

The code looks cool, now if I only had my computer close by! I’ll try it tonight!

---

<div class="post-metadata">

**Author:** ![mjmogo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mjmogo/32/3522_2.png) [@mjmogo](https://forum.cabbageaudio.com/u/mjmogo)\
**Post date:** [29 July 2021 04:50 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/8 "2021-07-29T04:50:55Z")

</div>

This is really nice! While it doesn’t bother me in the slightest (mostly because I don’t like the sound of my own voice), but this is really nice, it didn’t sound like me at all! I’m still trying to wrap my head around some of the concepts. It would also be nice if I understand this correctly, that it would be cool to be able to move the pointer, as that moves the point where the granulator reads from (right?), but if it could be modulated with a modwheel, or something. I might actually learn to like the sound of my own voice, chewed up and spit back out by this program! I did try singing through all the vowel sounds in my recording, but I only ever got a choral “ah”.

It would be interesting to have a piece that starts off with different segments getting recorded, using multiple buffers, and then splicing them together somehow.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [29 July 2021 05:20 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/9 "2021-07-29T05:20:09Z")

</div>

> [@mjmogo](#):
>
> It would be interesting to have a piece that starts off with different segments getting recorded, using multiple buffers, and then splicing them together somehow.

You want to do this with a daw like Reaper. Configure the plugin on different tracks, split the keyboard (one zone for every tracks), remap midi notes (midi transpose). You can layer different sound with sustain pedal. Thanks for aopreciation!

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [29 July 2021 05:28 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/10 "2021-07-29T05:28:11Z")

</div>

Ops! You can to do.  
I should complete a piece with a violin in a month, I hope to be able to share it with a video.

---

<div class="post-metadata">

**Author:** ![Dr\_Richard\_Boulanger](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/dr_richard_boulanger/32/2291_2.png) [@Dr\_Richard\_Boulanger](https://forum.cabbageaudio.com/u/Dr_Richard_Boulanger)\
**Post date:** [3 August 2021 03:09 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/11 "2021-08-03T03:09:33Z")

</div>

Thank you, Andrea. It’s very cool! Fun. And Magical.

I will be showing it in my Csound Class at 10 am tomorrow morning!

I know that they will be inspired. Their final projects this semester are an instrument plugin and an effect plugin. They are getting there. (As am I ;-).

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [3 August 2021 19:04 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/12 "2021-08-03T19:04:23Z")

</div>

Thank you for appreciation, Richard!  
I’m sure you will come up with some very inspiring plugins!

---

<div class="post-metadata">

**Author:** ![RZorn](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rzorn/32/2611_2.png) [@RZorn](https://forum.cabbageaudio.com/u/RZorn)\
**Post date:** [10 August 2021 17:50 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/13 "2021-08-10T17:50:17Z")

</div>

Amazing! I tried it as an effect on different sampled instruments. Whether piano, cowbell, cymbals - it always produces magical, haunting sounds. Congratulations and thanks!

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [14 August 2021 00:20 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/14 "2021-08-14T00:20:59Z")

</div>

Thank you for appreciation! I’m the one who has to thank you: I have seen your “etudes” and I hope to find the time to deepen their functioning.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [4 September 2021 19:00 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/15 "2021-09-04T19:00:06Z")

</div>

> [@strapparts](#):
>
> I should complete a piece with a violin in a month, I hope to be able to share it with a video.

Well, this is the composition:

[![](https://img.youtube.com/vi/C_zxSFWQ3LU/maxresdefault.jpg "L'assiuolo - su una poesia di Giovanni Pascoli") ](https://www.youtube.com/watch?v=C_zxSFWQ3LU)

Good listening!  
documentation:

> **[L’assiuolo – strAppArts](https://www.strapparts.com/composizioni/lassiuolo/)**

All the best!

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [4 September 2021 19:26 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/16 "2021-09-04T19:26:45Z")

</div>

Hi mjmogo,  
Finally a was able to try the usefull graphic work about the resizing.  
I replaced the “form” variable with:  
iW = 490  
iH = 460  
(same size values of form)  
and I was able to get the file “GrainOnFly2.csd” to (I could’n get it to work with “cabbageGet”).  
[GrainOnFly2.csd](https://forum.cabbageaudio.com/uploads/short-url/g3g1ZSX3W3LdJr9EBWWTSJCpFdJ.csd) (15.2 KB)  
I have attached the modified file.  
AS

---

<div class="post-metadata">

**Author:** ![rorywalsh](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/rorywalsh/32/165_2.png) [@rorywalsh](https://forum.cabbageaudio.com/u/rorywalsh)\
**Post date:** [4 September 2021 21:10 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/17 "2021-09-04T21:10:41Z")

</div>

Beautiful piece. Very nicely presented too. I wish I could read the Italian version of the poem. ☹ Reading the English text is like listening to a Bach partita played back with a MIDI file using the old Windows MIDI synth.

---

<div class="post-metadata">

**Author:** ![mjmogo](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/mjmogo/32/3522_2.png) [@mjmogo](https://forum.cabbageaudio.com/u/mjmogo)\
**Post date:** [5 September 2021 03:39 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/18 "2021-09-05T03:39:40Z")

</div>

Huh… It might have something to do with the version of Cabbage you are running. I’ve kept current with what Rory is doing, so it should be enough to just change the size of the form in the section of the csd file. Yeah, now that I think about it, it is a version issue. Rory had to expose the form width and height, so maybe you could try with downloading the new version Rory just released.

But yeah, you got the right idea. As long as you match the values you gave to the form with iW and iH, it should rebuild the interface at the new size.

And that was really nice. I was trying to see if what (you?) at the computer were doing and see how it might have been notated in the score. I imagine that there might be some notes, or relationship with the violin part, and what gets recorded by your program. I only wish I had headphones.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [5 September 2021 10:18 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/19 "2021-09-05T10:18:25Z")

</div>

> [@mjmogo](#):
>
> I was trying to see if what (you?) at the computer were doing and see how it might have been notated in the score. I imagine that there might be some notes, or relationship with the violin part, and what gets recorded by your program.

The composition is in the form ABA (the second A is the refrain). The performance of B section it is not very faithful to the score. Section A is quite faithful.  
If you read in the keyboard part “REC. LOW” (written in a box frame), you have to record the simoultaneous violin sound in the specific GrainOnFly track.  
Then you have to play this recorded sound when in the score there is C (one octave below middle C).  
About the controllers, when you read “esplorazione di parametri” (parameter exploration), you can move the knobs etc.

---

<div class="post-metadata">

**Author:** ![strapparts](https://forum.cabbageaudio.com/user_avatar/forum.cabbageaudio.com/strapparts/32/6144_2.png) [@strapparts](https://forum.cabbageaudio.com/u/strapparts)\
**Post date:** [5 September 2021 15:16 UTC](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735/20 "2021-09-05T15:16:38Z")

</div>

Ah ah! Here in Italy it is said: “traduzione=tradimento” (“translation=betrayal”).  
I have included an English translation to facilitate understanding of the Italian text.  
I discovered that an Italian had translated the poem and published it on the web. I asked her for permission to include it in my documentation and she very kindly agreed.  
it is important that the performers know the meaning of the poem in order to make the right interpretative decisions, because a certain freedom is left in the choice of parameter controls, in the musical score.  
In any case, in the documentation I have prepared there is also the original Italian version.

[Next page](https://forum.cabbageaudio.com/t/grains-on-fly-granular-synthesis/2735.md?page=2)
