User Tools

Site Tools


midibox_sequencer_vx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
midibox_sequencer_vx [2006/03/25 03:37] – Formatting stryd_onemidibox_sequencer_vx [2007/04/18 09:45] – Added forum links stryd_one
Line 4: Line 4:
 Some of you will already know about my work on developing a somewhat unusual sequencer... Well, a few recent events have made major changes to the way I can do this, and so I thought that after such a long time, and the recent advances, it might be time to let you guys know what I'm up to - both for your interest, and for the purpose of any feedback that you might give in the form of suggestions or corrections etc... Some of you will already know about my work on developing a somewhat unusual sequencer... Well, a few recent events have made major changes to the way I can do this, and so I thought that after such a long time, and the recent advances, it might be time to let you guys know what I'm up to - both for your interest, and for the purpose of any feedback that you might give in the form of suggestions or corrections etc...
  
-Well the latest bit of good news is the PIC18F4620. Now, you may already know that it has a problem with the UART, or EUSART to be precise, and as such has problems with MIDI. This is about the end of the downsides to this chip, and so for the purpose of conversation, I'll ignore that major problem, for now... but the really big plus with the new chip is the massive increase in both code and RAM size. Previously, due to a need for more RAM, some board members here helped me to design an external SRAM interface (THANKS GUYS!!). With the 4620 in the picture, things get much easier. The new chip, combined with TK's absolutely brilliant highly modular coding work, means that most of the hard work has now been done for me. This new sequencer concept is quite different in practice to the MBSEQ, but a great deal of the original code is re-usable, so it's been well tested too. My work in developing this idea has illustrated to me how truly great TK's code is. We're very lucky that TK has gone to such an effort :)+Well the latest bit of good news is the PIC18F4620. Now, you may already know that it has a problem with the UART, or EUSART to be precise, and as such has problems with MIDI. This is about the end of the downsides to this chip, and so for the purpose of conversation, I'll ignore that major problem, for now... but the really big plus with the new chip is the massive increase in both code and RAM size. Previously, due to a need for more RAM, some board members here helped me to design an external SRAM interface (THANKS GUYS!!). With the 4620 in the picture, things get much easier. The new chip, combined with TK's absolutely brilliant highly modular coding work, means that most of the hard work has now been done for me. This new sequencer concept is quite different in practice to the MBSEQ, but a great deal of the original code is re-usable, so it's been well tested too. My work in developing this idea has illustrated to me how truly great TK's code is. We're very lucky that TK has gone to such an effort :) UPDATE - After some discussion with TK on the forums, I have been advised to start this project in C, so the code will now be written from the ground up in C, not made from adapted ASM code by TK.
  
-So anyway, enough background, lets get into the concept. This has changed a bit from the previous incarnations and may change again in the future... But this is how it works for now ;) Forgive me, this will probably be a very, very long post, as I feel I should give some insight into what I've been doing all this time, and I fear that with so many details, that it may be hard to explain well. I will do my best to explain it as clearly as I am able. The project has the working name of MIDIBox Sequencer vX - as in version X I've taken to calling it "vX" or "veX" because that's what Microsoft Word told me I was trying to spell ;) I gave it the name version X because the existing code is derived from the MBSEQ, but I don't believe that it could be a replacement or a "new version" due to it having a rather different purpose and functionality. I'm going to have two of each :D+So anyway, enough background, lets get into the concept. This has changed a bit from the previous incarnations and may change again in the future... But this is how it works for now ;) Forgive me, this will probably be a very, very long post, as I feel I should give some insight into what I've been doing all this time, and I fear that with so many details, that it may be hard to explain well. I will do my best to explain it as clearly as I am able. The project has the working name of MIDIBox Sequencer vX - as in version XI've taken to calling it "vX" or "veX" because that's what Microsoft Word told me I was trying to spell ;) I gave it the name 'version Xbecause the existing code is derived from the MBSEQ, but I don't believe that it could be a replacement or a "new version" due to it having a rather different purpose and functionality. I'm going to have two of each :D
  
 All that said, there are three major differences between the vX and the current MBSEQ: All that said, there are three major differences between the vX and the current MBSEQ:
Line 16: Line 16:
 One Master Loop, run either by incoming MIDI Clock or internal clocks run by the PIC's timer, has a length measured in MIDI Clock Ticks. The Master Loop Length is the number of MIDI Clock Ticks in one bar at the master time signature, and will be in a table which is looked up for the correct value when the song time signature is set. For eg, the MLL at 4/4 time signature is 384, at 3/4 it is 288, at 7/8 it is 336, at 5/4 it is 480. One Master Loop, run either by incoming MIDI Clock or internal clocks run by the PIC's timer, has a length measured in MIDI Clock Ticks. The Master Loop Length is the number of MIDI Clock Ticks in one bar at the master time signature, and will be in a table which is looked up for the correct value when the song time signature is set. For eg, the MLL at 4/4 time signature is 384, at 3/4 it is 288, at 7/8 it is 336, at 5/4 it is 480.
  
-Each clock has a pair (for simplicity of use) of multipliers and dividers. These are represented as N Steps per O Loops and P Steps per Q Loops of the Master Loop. Internally, they will be multiplied and converted to a single numerator and denominator of a master loop. +Each slave clock has a pair (for simplicity of use) of multipliers and dividers. These are represented as N Steps per O Loops and P Steps per Q Loops of the Master Loop. Internally, they will be multiplied and converted to a single numerator and denominator of a master loop. 
  
              O * Q * MLL                O * Q * MLL  
Line 36: Line 36:
 To play a polymeter, you would assign a pattern with more or less steps than this, to this same clock. For example, if you had a pattern with 5 steps (between the start and end point) assigned to this same clock along with a pattern with 4 steps, then every 20 Master Loops, they would sync up. To play a polymeter, you would assign a pattern with more or less steps than this, to this same clock. For example, if you had a pattern with 5 steps (between the start and end point) assigned to this same clock along with a pattern with 4 steps, then every 20 Master Loops, they would sync up.
  
-To have a 5:4 polyrhythm (five notes play in the same time as 4 notes), you would assign a clock such as the above to a 4 step pattern, and setup the clock assigned to a 5 step pattern clock like so:+To have a 5:4 polyrhythm (five notes play in the same time as 4 notes), you would assign a clock such as the above to a 4 step pattern, and setup the clock assigned to trigger a 5 step pattern clock like so:
  
         Steps         Steps
Line 42: Line 42:
         Loops         Loops
  
-Now the two patterns will loop in sync, despite having different lengths, because they are clocked by slaves to the one master loop.+Now the two patterns will loop in sync, despite having different lengths, because they are clocked by slaves of the master loop.
  
 If you wanted to play 4/4 triplets, you would set the clock parameters like so: If you wanted to play 4/4 triplets, you would set the clock parameters like so:
Line 76: Line 76:
 Pattern parameters include Pattern Play Sync, which works like this: You make a pattern and you have it triggered to play and step by clock #7. Now, you set the pattern to enter Play Mode after the next tick of clock #3. When you press Play for this pattern, it sits idle, until after clock #3 ticks, when the pattern is triggered to enter play mode. But it will not process and play the first step yet… until clock #7 ticks, because that is the clock which is set to trigger the steps to play.  Pattern parameters include Pattern Play Sync, which works like this: You make a pattern and you have it triggered to play and step by clock #7. Now, you set the pattern to enter Play Mode after the next tick of clock #3. When you press Play for this pattern, it sits idle, until after clock #3 ticks, when the pattern is triggered to enter play mode. But it will not process and play the first step yet… until clock #7 ticks, because that is the clock which is set to trigger the steps to play. 
  
-Other pattern parameters: +Other pattern parameters:\\  
-Direction:+Direction:\\ 
   * Forward - Plays from start point to end point   * Forward - Plays from start point to end point
-  * Reverse - Plays from end point to start point+  * Reverse - Plays from end point to start point\\ 
  
  
-Loop Mode:+Loop Mode:\\ 
   * Looped - Normal looped play in the above direction   * Looped - Normal looped play in the above direction
   * PingPong - Plays forward, reverse, then loops. Can be reversed as above   * PingPong - Plays forward, reverse, then loops. Can be reversed as above
-  * OneShot - Plays once only in direction above. Stops at end point in forward mode, or at Start point in Reverse mode+  * OneShot - Plays once only in direction above. Stops at end point in forward mode, or at Start point in Reverse mode\\ 
  
-Clock Patch Mode:+Clock Patch Mode:\\ 
   * Step,Trigger - Clock tick plays the step and then advances to the next step according to the above. This is the way MBSEQ works   * Step,Trigger - Clock tick plays the step and then advances to the next step according to the above. This is the way MBSEQ works
-  * !Trigger,Step - Clocks advance to the next step according to the above, but do not play the step before they advance. Similar to muting the pattern, but the steps can be triggered to play by remote control. When a pattern is muted, no steps will play, regardless of whether they are triggered by remote control, or a clock. +  * !Trigger,Step<sup>*</sup> - Clocks advance to the next step according to the above, but do not play the step before they advance. Similar to muting the pattern, but the steps can be triggered to play by remote control. When a pattern is muted, no steps will play, regardless of whether they are triggered by remote control, or a clock. 
-  * Trigger,!Step - Clocks trigger current step to play, but do not advance to the next step – the pattern is Stepped by remote control (either an absolute step number or an increment/decrement according to the pattern direction) +  * Trigger,!Step<sup>*</sup> - Clocks trigger current step to play, but do not advance to the next step – the pattern is Stepped by remote control (either an absolute step number or an increment/decrement according to the pattern direction). 
-  * !Trigger,!Step - No Clocks will be checked to trigger step to play or to advance to the next step. The pattern must be entirely remote controlled.+  * !Trigger,!Step<sup>*</sup> - No Clocks will be checked to trigger step to play or to advance to the next step. The pattern must be entirely remote controlled.
  
-While any pattern can be stepped or triggered regardless of these parameters, patterns set to these modes will need to be stepped/triggered by remote control.+<sup>*</sup>While any pattern can be stepped or triggered regardless of these parameters, patterns set to these modes will need to be stepped or triggered by remote control.
  
 This gives a brief overview of the modular patterns, but so far I have left out one major detail – I hinted that the above parameters, as well as all the other Pattern parameters including parameters for each step, and also all of the Clock parameters, accept input from remote control, but all the parameters can also be from other patterns. How does one pattern modify or trigger a clock or another pattern, I hear you ask?.... This gives a brief overview of the modular patterns, but so far I have left out one major detail – I hinted that the above parameters, as well as all the other Pattern parameters including parameters for each step, and also all of the Clock parameters, accept input from remote control, but all the parameters can also be from other patterns. How does one pattern modify or trigger a clock or another pattern, I hear you ask?....
Line 133: Line 133:
   * If the step has a value of 62, it is interpreted as -1. -1 + 45 = 44 = G#2\\    * If the step has a value of 62, it is interpreted as -1. -1 + 45 = 44 = G#2\\ 
  
-I hope to include another feature from the Notron (and about 1000 other algorithmic sequencers) where notes will be locked to a scale. This function would use a table lookup to map note numbers to the scale set in the pattern parameters.+I hope to include another feature from the Notron (and about 1000 other algorithmic sequencers heheh) where notes will be locked to a scale. This function would use a table lookup to map note numbers to the scale set in the pattern parameters.
  
 Similarly, a function could modify a parameter's value in a relative manner, by adding or subtracting the value as above. Similarly, a function could modify a parameter's value in a relative manner, by adding or subtracting the value as above.
 +
  
 ===== Order of Execution ===== ===== Order of Execution =====
Line 144: Line 145:
  
   * Patterns: -   * Patterns: -
-  * Start Sync - So that tracks are started for these other procedures… +    * Start Sync - So that tracks are started for these other procedures… 
-  * Control Functions - So that parameters are modified in time to be read for MIDI Functions +    * Control Functions - So that parameters are modified in time to be read for MIDI Functions 
-  * MIDI Functions - Then the notes get sent+    * MIDI Functions - Then the notes get sent
  
 All data is buffered with code based on that within the existing MBSEQ, so all this seems to happen at the same time :)  All data is buffered with code based on that within the existing MBSEQ, so all this seems to happen at the same time :) 
Line 160: Line 161:
 ===== A Touch of Normalcy ;) ===== ===== A Touch of Normalcy ;) =====
    
-Despite all of the differences, and that this sequencer is obviously something that will appeal to those interested in tribal/ethnic/algorithmic music, or just those with weird taste in music (like me ;) ), the default values for a new song will be pretty standard stuff… mostly in lots of 4 steps, 4/4 time, etc. This is just to give a starting point that is fairly neutral as a skeleton for a song, but as a side effect, the vX will be well configured to do traditional step-sequencing – but of course because the MBSEQ specialises in that field, it will always be superior for that purpose.+Despite all of the differences, and that this sequencer is obviously something that will appeal to those interested in tribal/ethnic/algorithmic music, or just those with weird taste in music (like me ;) ), the default values for a new song will be pretty standard stuff… mostly in lots of 4 steps, 4/4 time, etc. This is just to give a starting point that is fairly neutral as a skeleton for a song, but as a side effect, the vX will be well configured to do traditional step-sequencing – but of course because the MBSEQ specialises in that field, it will always be superior for that purpose. The vX is intended as a companion to the MBSEQ, not a replacement. 
 + 
 + 
  
  
Line 167: Line 171:
 The user interface will be reminiscent of the Doepfer Schaltwerk, with buttons for each of the steps arranged in a row for each pattern, and a single large character LCD, jog wheel and slider for fast data entry, buttons, and set of rotary controllers to edit parameters of the selected object. The user interface will be reminiscent of the Doepfer Schaltwerk, with buttons for each of the steps arranged in a row for each pattern, and a single large character LCD, jog wheel and slider for fast data entry, buttons, and set of rotary controllers to edit parameters of the selected object.
  
-There will be a set of buttons which will be used for selecting one of the clocks for configuration using the same LCD. Each button has an LED which flashes when that clock ticks. When a clock is selected for editing, the LED is set on, and flashes off for each tick (The LED is inverted).+There will be a set of buttons which will be used for selecting one of the clocks for configuration using the same LCD. Each button has an LED which flashes when that clock ticks. When a clock is selected for editing (as above), the LED is set on, and flashes off for each tick (The LED is inverted). 
 + 
 +I hope that eventually the grid of buttons for the steps will be arranged in an 8 row x 12 column grid. This will allow for two modes of operation. The first would be one that we are already familiar with, where each row is a pattern and each button within that row representing a step in the sequence. In this mode, there would be left/right buttons which would control which 8 of the 16 steps are displayed, and you can freely select which pattern will be displayed on each row. Pressing a button selects that step, and then you set the parameters for the step using the controls mentioned above. 
 + 
 + 
 +| Pattern 1  ^ Step 1 ^ Step 2 ^ Step 3 ^ Step 4 ^ Step 5 ^ Step 6 ^ Step 7 ^ Step 8 ^  
 +^ Track 1    |      |      |      |      |      |      |      |        |  
 +^ Track 2    |        |        |        |        |        |        |        |  X     |  
 +^ Track 5    |      |      |      |        |        |        |        |        |  
 +^ Track 16          |      |        |        |        |      |        |        |  
 +^ Track 15          |        |        |      |        |        |        |  X     |  
 +^ Track 8    |        |        |      |        |        |        |      |        |  
 +^ Track 3    |        |      |        |      |        |        |        |  X     |  
 +^ Track 6    |      |        |        |        |        |      |        |        |  
 +^ Track 13          |        |        |        |        |        |        |  X     |  
 +^ Track 12        |        |      |        |      |        |      |        |  
 +^ Track 7    |        |        |        |        |        |        |        |  X     |  
 +^ Track 9    |      |        |        |        |        |      |        |        | 
  
-I hope that eventually the grid of buttons for the steps will be arranged in an 8 row x 12 column grid. This will allow for two modes of operation. The first would be one that we are already familiar with, where each row is a pattern and each button within that row representing a step in the sequence. In this mode, there would be left/right buttons which would control which 8 of the 16 steps are displayed, and each row can be freely assigned to any pattern. Pressing a button selects that step, and then you set the parameters for the step  
  
 The second mode would be Grid Edit, where all of the buttons are used to set parameter values for a single pattern. In this mode, each column of buttons represents a single step, and each button in that vertical column represents a separate value for the selected parameter, so the 12 rows become, for example, an octave worth of notes. This is basically like a piano roll, but of course you can only edit one pattern at a time in this manner. When you press a button, it sets the selected parameter (eg Parameter 1, which is used for MIDI Note Number in the 'Send MIDI Note' Function) according to the row. In this mode, there would be left/right buttons which would control which 8 of the (up to) 16 steps are displayed, and pitch up/down buttons to 'scroll' up and 'scroll' down the grid. The second mode would be Grid Edit, where all of the buttons are used to set parameter values for a single pattern. In this mode, each column of buttons represents a single step, and each button in that vertical column represents a separate value for the selected parameter, so the 12 rows become, for example, an octave worth of notes. This is basically like a piano roll, but of course you can only edit one pattern at a time in this manner. When you press a button, it sets the selected parameter (eg Parameter 1, which is used for MIDI Note Number in the 'Send MIDI Note' Function) according to the row. In this mode, there would be left/right buttons which would control which 8 of the (up to) 16 steps are displayed, and pitch up/down buttons to 'scroll' up and 'scroll' down the grid.
  
-In the meantime, the User Interface will be driven by PC software… This is just until the core features are all done. I strongly suspect that a UI such as this may require a second core module, which would pass data to the second core, to drive the LCD and DOUTs. This has been discussed previously on the forum, and I am keen to implement it, as moving the control surface onto a second core will relieve the primary core of extra load driving IO.+ 
 +| Track  1  ^ Step 1 ^ Step 2 ^ Step 3 ^ Step 4 ^ Step 5 ^ Step 6 ^ Step 7 ^ Step 8 ^  
 +^ G                |        |        |        |        |        |      |        |  
 +^ F#        |        |        |        |        |        |        |        |        |  
 +^ F                |        |        |        |        |      |        |        |  
 +^ E                |        |        |        |      |        |        |        |  
 +^ D#        |        |        |        |        |        |        |        |        |  
 +^ D                |        |        |      |        |        |        |        |  
 +^ C#        |        |        |        |        |        |        |        |        |  
 +^ C                |        |      |        |        |        |        |        |  
 +^ B                |      |        |        |        |        |        |        |  
 +^ A#        |        |        |        |        |        |        |        |        |  
 +^ A              |        |        |        |        |        |        |        |  
 + 
 +In the meantime, the User Interface will be driven by PC software… This is just until the core features are all done. I strongly suspect that a UI such as this may require a second core module, which would pass data to the second core, to drive the LCD and DOUTs. This has been discussed previously on the forum, and I am keen to implement it, as moving the control surface onto a second core will relieve the primary core of extra load driving IO, increasing performance of the sequencer. 
  
  
Line 186: Line 221:
   * Remote control   * Remote control
   * Hardware UI   * Hardware UI
 +  * MBSEQv2 Control Surface Compatibility (So you can run vX app from your MBSEQ CS - although as I said, this is a companion to the MBSEQ, not a replacement)
  
  
Line 193: Line 229:
  
 **Please share any thoughts or ideas or concerns or criticism or whatever!! :)** **Please share any thoughts or ideas or concerns or criticism or whatever!! :)**
 +
 +
 +
 +
 +===== Forum Links =====
 +
 +These are links to forum posts which discuss the vx or matters related to the development of the seq. Just in case you're really bored, or maybe writing your own seq and want to learn from my mistakes ;)
 +
 +[[http://www.midibox.org/forum/index.php?topic=8442.0|vX]]
 +
 +
 +[[http://www.midibox.org/forum/index.php?topic=6884.0|when will come the TR seq?]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=8513.0|Any C Sequencer examples?]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=9028.0|So many questions....]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=2694.0|N00b needs some help!!]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=2755.0|Scanning Matrix]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=4140.0|x0x style seq... Need hardware help (LONG post!)]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=571.0|MIOS development question]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=1019.0|MB SEQ Event timings]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=1067.0|MidiBox Beatbox...combination w/ another project]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=1110.0|Utilization]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=1114.0|Bankstick latency]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=6478.msg40473#msg40473|Sequencer design for feedback]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=6814.0|Multidimensional arrays]]
 +
 +[[http://www.midibox.org/forum/index.php?topic=6030.0|MIOS C programming examples]]
 +
 +
 +