Implementation of a step sequencer using Mozzi

681 views
Skip to first unread message

Shashwat Narkhede

unread,
Jan 7, 2016, 7:44:38 AM1/7/16
to Mozzi-users
Hi,
 I am new to the Mozzi library, I went through the mozzi introductory tutorial page on the website to get to know about the library but I don't seem to understand how to implement a step sequencer with the use of Mozzi. 

So far I have managed to continuously play and  change the frequency as well as the volume using a potentiometer.  
I would like to know how i could make mozzi play a set of 8 ( for a 8 step sequencer!) frequencies with a defined tempo and duration. 

I want to implement the sequencer which behaves like the one made in the following link but with mozzi!


Thanks, 
Shashwat

Mariano Velamazán

unread,
Jan 31, 2016, 8:00:36 AM1/31/16
to Mozzi-users
I would also be interested in that!! Same situation here.

Tim Barrass

unread,
Feb 1, 2016, 6:26:08 AM2/1/16
to mozzi...@googlegroups.com
Hi,
the standard Arduino example called toneMelody shows how to use an array to play a sequence.  If you get the hang of that, then you could try to adapt the basic idea to one of the Mozzi examples, like the ones in the Envelope menu, and add an extra array for each parameter you want to sequence.  See how you go!

Tim

--
You received this message because you are subscribed to the Google Groups "Mozzi-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mozzi-users...@googlegroups.com.
To post to this group, send email to mozzi...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/mozzi-users/e89a58ba-9940-4681-a0e9-993fd2d5dc21%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Mariano Velamazán

unread,
Feb 1, 2016, 8:31:46 AM2/1/16
to Mozzi-users
Thanks

Bob

unread,
Feb 6, 2016, 2:11:33 AM2/6/16
to Mozzi-users
You could do something along these lines, works for me: 

Metronome kMetro(250);

void setup(){
...
  kMetro.start();
...
}

void updateControl(){
  static byte cnt = 0;
  static byte stepVar = 0;

  byte buttons = ~readRegGPIO(MCP23S18_GPIOB); // this line would probably be replaced with whatever you use to get your step variable from, I use an external chip connected to 8 buttons for 8 steps
  static byte buttons_last;
  if(buttons && (buttons != buttons_last)) // if some input on the buttons has changed, update step var
    stepVar ^= buttons & ~buttons_last;
  buttons_last = buttons;

  if(kMetro.ready()){
    byte val = ~(1 << (cnt%8)) ^ ~stepVar;
    stepVoiceOnOff = val & (1<<(cnt%8));
    cnt++;
  }
}

On Monday, February 1, 2016 at 2:31:46 PM UTC+1, Mariano Velamazán wrote:
Thanks

Mariano Velamazán

unread,
Feb 7, 2016, 5:11:17 AM2/7/16
to Mozzi-users
Thanks again!
I am going to show what I have been doing vs. what I want to see if I can get suggestions from you guys!

WHAT I WANT
is to build a sequencer but with a different (simpler?) interaction (although also technically less efficient). The user would place a note on each step by just selecting it on a potentiometer. So it would have 8 potentiometers just for selecting the tone of each step. Then you can also change tempo and duration of notes (with other two pots). Finally, you would be able to add filters or effects. Ideally for each tone and step but I am ok with one filter for the whole sequence.

WHAT I HAVE
  1. This first sketch has the behavior described above but the sounds are boring. I am missing the "filters & effects" part.
  2. This second sketch (auduino grrovesizer mk1) has the kind of dirty electronic sound I would like to achieve but I don't know how to change the code to get the behavior I want (not having to select step with a button to change its properties with pots)
  3. This third one, is one of the three effects that I tried with Mozzi. I was able to add ADSR, waveshaper and delay on different sketches but I still don't find the sounds that I get. I couldn't figure out how to add a low pass filter. Besides, I don't know how to add the possibility of changing the duration of each tone (not the overall tempo, but the duration of each note in each step). 
SUGGESTIONS
  • Is it better to try the metronome approach suggested by bob?
  • Is there a way to add the filters of the groovesizer to what I have not using mozzi?
  • If I use mozzi, is it better to use eventDelay or Metronome for the sequencer? How do you control duration? What filters do you recommend?
Thanks a lot again. It is a project for school so any help is really appreciated!
Reply all
Reply to author
Forward
0 new messages