login

online now

We have 74 guests and no members online

search

 
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Generate 6 harmonics in synth mode

Generate 6 harmonics in synth mode 4 years 2 months ago #464

Hi,

First, I want to say thank to the developper because Ginsing is very helpful for our school project.

So, I'm student and I'm working on a synthetic instrument (a flute). The aim of the project is to generate the most frequency possible at the same time to create a complex sound. Thus, I have used the synth mode of Ginsing and this code to set the path :
Warning: Spoiler! [ Click to expand ]


As you can see, I managed to generate three frequency and it's working perfectly but I know that Ginsing has two banks of three oscillators and I tkink it's idiot to don't use the second bank. When I used the second bank with the first, I can hear a little gap.
I search help in the project "airmonica" and in the polyphonic library but I have found no answer.

Thanks to help me and sorry for my bad english but I'm french ;) )
Last Edit: 4 years 1 month ago by administrator.
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #466

Hi Dilink. Can you explain further what you mean by a little gap. Is this in time, frequency or perhaps something else?
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #467

I have try this code :
#include <GinSing.h>                                           
GinSing  GS;
GinSingSynth *s;
#define rcvPin  4                                              
#define sndPin  3                                             
#define ovfPin  2 

void setup() { 
  GS.begin ( rcvPin , sndPin , ovfPin );           
  s = GS.getSynth();                                 
  s->begin (); 
  s->selectBank   ( BANK_A );					       
  s->setPatch     ( OSC_1_TO_MIXER 
                   | OSC_2_TO_MIXER
                   | OSC_3_TO_MIXER);

     s->setFrequency ( OSC_1 , 529.0f );      
      s->setAmplitude ( OSC_1 , 1.0f );
      s->setFrequency ( OSC_2, 1073.0f );
      s->setAmplitude ( OSC_2 , 0.1f );
      s->setFrequency ( OSC_3 , 1592.0f );
      s->setAmplitude ( OSC_3 , 0.3f );

      //second bank

      s->selectBank   ( BANK_B );					       
      s->setPatch     ( OSC_1_TO_MIXER 
                   | OSC_2_TO_MIXER
                   | OSC_3_TO_MIXER);
      s->setFrequency ( OSC_1, 2358.0f );
      s->setAmplitude ( OSC_1 , 0.3f );     

void loop()
{ }

With this code, I can hear the three frequencies which are play together and few milliseconds later I hear the frequency of the second bank.The results is not pleasant to hear :D. So, I have supposed that bank A and B are not play together.
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #468

You could set up the amplitude, patch, and frequency for both banks at the same time, and then use the trigger() mechanism to minimize the amount of communication that happens when you turn them on. The two banks should have the same overhead and are mixed together for the final output, so I suspect its only the serial communication overhead that would cause a delay.
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #469

Can you post an example code please ?
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #470

Hi
I'm interested about your project. Do you success ?
Thanks for a reply :)
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #471

Our project has four parts : - the detection of the breath of the user (with an air flow sensor)
- buttons which represent the holes of the flute
- the synthesizer with arduino and GinSing
- the manufacturing of a wooden flute which contains all the electronics circuits

Actually, the wooden flute is almost finished (we just have to put parts together) and all works perfectly. The user blows and presses some buttons (the same as the holes combination on an real flute) and the corresponding note is played with three harmonics. To improve the sound (because we maybe participate for a competition), It would be perfect if we can generate more harmonics to have a better sound and I think GinSing is able to do this. It's why I have post on his forum :)
If you want more details (pictures, technical documentation...) don't hesitate to ask me some questions :D
The administrator has disabled public write access.
The following user(s) said Thank You: administrator, Mosfet_05

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #472

Sounds great!

Did you ever fix the delay? It seems like taking a look at the polyphonic sample code might show how you could use trigger/release in a more musical sense and may avoid the delay. For example in the code _3_polymode, you see this:

poly->setNote ( BASSVOICE , bass [ noteIdx ] ); // set the current bassline note
poly->trigger ( BASSVOICE ); // trigger the envelope

This uses the ADSR envelope generator which can produce more natural effects and minimize the data that is sent (thus minimizing delay).
The administrator has disabled public write access.
The following user(s) said Thank You: Mosfet_05

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #473

Hi
I tried this program
#include <GinSing.h>                                           
GinSing  GS;
GinSingSynth *s;
GinSingMaster *m = GS.getMaster();  
#define rcvPin  4                                              
#define sndPin  3                                             
#define ovfPin  2 

void setup() { 
  GS.begin ( rcvPin , sndPin , ovfPin );           
  s = GS.getSynth();
  s->begin (); 
  s->selectBank   ( BANK_A );					       
  s->setPatch     ( OSC_1_TO_MIXER 
                   | OSC_2_TO_MIXER
                   | OSC_3_TO_MIXER);
      
      s->setFrequency ( OSC_1 , 529.0f );      
      s->setAmplitude ( OSC_1 , 1.0f );
      s->setFrequency ( OSC_2, 1073.0f );
      s->setAmplitude ( OSC_2 , 0.1f );
      s->setFrequency ( OSC_3 , 1592.0f );
      s->setAmplitude ( OSC_3 , 0.3f );

      //second bank

      s->selectBank   ( BANK_B );					       
      s->setPatch     ( OSC_1_TO_MIXER);
      s->setFrequency ( OSC_1, 2358.0f );
      s->setAmplitude ( OSC_1 , 0.3f );
      
      //set triger for all mixer
      //s->trigger ( MIX_ALL); 
}  

void loop()
{
  m->trigger ( MIX_ALL);
  delay (5000);
  m->release ( MIX_ALL);
  delay (2000);
}
The sound didn't be good, I always have a dalay whith the trigger (mix all) function. I tried to use the set-note function but I can't use it with the MIX_ALL argument. Do you have any solution ?
Thanks a lot
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #474

Hello,
I tried a new program :
#include <GinSing.h>                                           
GinSing  GS;
GinSingSynth *s;
//GinSingMaster *m = GS.getMaster();  
#define rcvPin  4                                              
#define sndPin  3                                             
#define ovfPin  2 
GinSingPoly *poly = GS.getPoly(); 

void setup() { 
  GS.begin ( rcvPin , sndPin , ovfPin );           
  s = GS.getSynth();
  s->begin (); 
  s->selectBank   ( BANK_A );					       
  s->setPatch     ( OSC_1_TO_MIXER 
                   | OSC_2_TO_MIXER
                   | OSC_3_TO_MIXER);
      
      s->setFrequency ( OSC_1 , 529.0f );      
      s->setAmplitude ( OSC_1 , 1.0f );
      s->setFrequency ( OSC_2, 1073.0f );
      s->setAmplitude ( OSC_2 , 0.1f );
      s->setFrequency ( OSC_3 , 1592.0f );
      s->setAmplitude ( OSC_3 , 0.3f );

      //second bank

      s->selectBank   ( BANK_B );					       
      s->setPatch     ( OSC_1_TO_MIXER);
      s->setFrequency ( OSC_1, 2358.0f );
      s->setAmplitude ( OSC_1 , 0.3f );
      
      //set triger for all mixer
      poly->setNote ( MIX_ALL,A_4); 
}  

void loop()
{
  poly->trigger (MIX_ALL);
  delay (5000);
  poly->release (MIX_ALL);
  delay (2000);
}
The sound is better whithout any delay, but it isn't what I expect.
Thanks a lot :)
Last Edit: 4 years 2 months ago by Mosfet_05.
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #475

Are your frequencies specified to musical notes? Using floating point you may get some frequency beating that you can avoid using integer frequency. Better yet, use the musical values unless those are unsuitable.
The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #476

Sorry, I see from the code now you are using the musical note A_4 for all six voices. This will produce no better sound than a single note as they are simply added in phase. You could try using timbre (different waveforms), and different complimentary notes ( i.e. major thirds) to produce richer content. Another thing is to use frequency distortion, which can produce a breathy or whistle sound.

As an example, you might hear some of the whistle effects in this project:

The administrator has disabled public write access.

Re: Generate 6 harmonics in synth mode 4 years 2 months ago #477

Hi
Thanks a lot, we find a solution with the ADSR which is satisfactory :
#include <GinSing.h>                                           
GinSing  GS;
GinSingSynth *s;
GinSingMaster *m = GS.getMaster();
#define rcvPin  4                                              
#define sndPin  3                                             
#define ovfPin  2 

void setup() { 
  GS.begin ( rcvPin , sndPin , ovfPin );           
  s = GS.getSynth();
  s->begin (); 
}

void loop () {
      //the first bank
      s->selectBank   ( BANK_A );					       
      s->setPatch     ( OSC_1_TO_MIXER 
                   | OSC_2_TO_MIXER
                   | OSC_3_TO_MIXER);
      
      s->setFrequency ( OSC_1 , 529.9f );      
      s->setAmplitude ( OSC_1 , 1.0f );
      s->setFrequency ( OSC_2, 1588.0f );
      s->setAmplitude ( OSC_2 , 0.125f );
      s->setFrequency ( OSC_3 , 1059.0 );
      s->setAmplitude ( OSC_3 , 0.062f );
      
      //second bank 

      s->selectBank   ( BANK_B );					       
      s->setPatch     ( OSC_1_TO_MIXER
                        | OSC_2_TO_MIXER
                        | OSC_3_TO_MIXER);
      s->setFrequency ( OSC_1, 2643.0f );
      s->setAmplitude ( OSC_1 , 0.055f );
      s->setFrequency ( OSC_2, 563.9f );
      s->setAmplitude ( OSC_2 , 0.05f );
      s->setFrequency ( OSC_3 , 400.0 );
      s->setAmplitude ( OSC_3 , 0.044f );
      m->trigger ( MIX_ALL); // release ADSR on banks
}
The problem is solved :lol:
Thanks
The administrator has disabled public write access.
The following user(s) said Thank You: administrator
  • Page:
  • 1
Time to create page: 0.212 seconds