Zynseq - A native step sequencer

@riban BTW (and I don’t know if you solved this already), you remember that problem where long notes got cut off prematurely? It looks like the sequencer sends a NOTE_OFF 24 clocks before the actual end of the note.

Now, again, I haven’t been keeping up to date with the stepseq branch (I’m not very brave :grimacing:), so you might have solved this already! In which case…

Will a :face_with_monocle: suffice for an apology? :slightly_smiling_face:

I did a lot of work on sync and JACK scheduling to remove issues with events being incorrectly scheduled. (If you schedule out of order, JACK says, “No!”.) I do remember you mentioning bad behaviour with notes ending prematurely but then promptly forgot :blush:. I have not noticed the issue occurring in the feature branch but have also been rather focused on specific issues so not taken it for a long ride.

… so I hope it is fixed but haven’t specifically addressed it!

3 Likes

Hmm. I think I will try the stepseq branch.

I just updated feature/stepseq branch to add drum maps and scales in the pattern editor. A new menu option allows loading a map / scale and another menu option allows selecting the root note of a scale. The default is Chromatic which is the behaviour we have seen before. For this to work you need some map files in /zynthian/zynthian-my-data/sequences. Here are a few I have created:

[Content deleted]

Let me know what you think. I know this isn’t perfect (yet), e.g. you keep having to manually select them. Maybe someone has a good idea on how these might bind to certain conditions???

Enjoy xxx

Question to the class:

What workflow do we want to (automagically) select keymaps? I looked at some DAWs but could not see that they do it at all (or I just don’t know how to use them!!!). Some ideas:

  • Link map to pattern so that every time you edit the pattern the map is selected.
  • Link map to song track so that every time you access track 10 you get the map allocated to track 10. I don’t think this is very flexible although it may work within a single session which may be sufficient.
  • Link map to current song’s tracks so that every time you access track 10 in a particular song, you get the map allocated to track 10 in that song.
  • Link map to current instrument, so if Black Pearl drums are used by track 10* then you will get the map for Black Pearl drums.
  • Linking to instruments may prove challenging as there isn’t necessarily a direct link between a song’s track / patterns and the instrument and this may change over time.

Also, where should such linking be saved? With the song? As a global setting so it gets restored with each reboot but spans songs?

…to answer my own question (but opinion is still very desirable), I played with it and think that each track of each song should have a map saved. This might be a scale or a drum map. I think they are probably the only two options. We could define each scale with an index and flag the drum maps with a specific index. It would be good if we could then look up what map is required for the instrument connected to that channel. I would like to open pattern 5 in track 4 of song 6 which is configured to play on MIDI channel 10 and see the map for GM-Drums if channel 10 is feeding Fluidsynth + FluidR3 GM or see the map for AVL Drums if channel 10 is feeding JV/Black Pearl 5.

@jofemodo can you think of a way that the Python code can find out what instrument (engine / preset) is connected to a particular MIDI channel?

This would also need a mapping of instruments (engine + preset) to maps but that will be the next problem to solve if this is all feasible.

I have figured out how to map the instrument on a particular MIDI channel to a map and have it working in my lab. I just need to redo it using the MIDI standard for note naming (instead of the custom JSON I had initially used). I hope to get this out later today but there are a couple of bugs to iron out and I have to add the XML handling for the MIDI names…

3 Likes

I’m struggling a bit with these. Maybe I’m doing something wrong… Hard to explain exactly what’s happening… probably easier in our next jitsi or maybe with a video?

I have updated feature/stepseq branch:

  • Drum maps are now available and should detect the instrument relevant to the selected MIDI channel. If the drum map does not show you can go to the Scales menu option and select the lowest value (below Chromatic).
  • Scales can be applied to filter notes to just those within each octave relevant to the selected scale. The scale is selected from the menu Scales option. I have added:
    • Chromatic
    • Major (Ionian mode)
    • Minor (Aeolian mode)
    • Blues
    • Blues pentonic (Japanese pentonic)
  • The tonic (root or base note of the scale) may be adjusted with the menu Tonic option. For chromatic scale this just moves the octave marker.

The scale is saved with the pattern including if you selected (or it defaulted to) a drum map.

This update requires extra files to be placed in the /zynthian/zynthian-my-data/sequences folder: maps.zip (4.1 KB)

@jofemodo I am aware this isn’t necessarily the best location for these configurations. Maybe you want to suggest a better location? I can updated the code accordingly.

@MrBroccoli We can have a play next week or give me a shout if you want to discuss what is going wrong. Knowing you it is probably smoke bellowing from a screen… :wink:.

external-content.duckduckgo.com
:rofl:

1 Like

two questions:

In feature/stepseq, how do I navigate to the pattern editor view of the step sequencer? I can not find it in the menu (layer button). I can only navigate to Song Editor, Pad Editor, ZynPad.

In master, Step Sequencer (alpha) brings up Step Sequencer, and in the menu (layer button) there is an entry “Pattern Editor” which is actually the same as Step Sequencer… I find the names confusing. Shouldn’t the Pattern Editor view be titled “Pattern Editor”? The Menu entry “Pattern Editor” is then redundant.

Hi @hal80

Access to pattern editor has changed since the version in master. I hope soon to see master updated with the most recent changes because it is significantly different and it would be good to avoid users becoming familiar with the old design.

To access the pattern editor in the latest version:

  • Open Song editor
  • Select the song you wish to edit
  • Add patterns to the song
  • Highlight the pattern you want to edit
  • Bold press SELECT or click and hold on the pattern with a mouse / touchscreen a second

The Pattern editor should display, loaded with the selected pattern from the song and configured with the same MIDI channel as configured in the song’s track.

I will update the WIKI when @jofemodo performs the next merge of feature/stepseq to master.

Your question about master behaviour is redundant in the newer version so I won’t get into that!

1 Like

@jofemodo has linked the MIDI player to the JACK MIDI master clock. This means when we stop playing a MIDI track, the step sequencer also stops including ZynPads. (There is a side-effect that when the clock stops, ZynPad stops playing but does not mark its pads as stopped so when clock resumes the pads will continue to play - maybe it should mark pads as stopped!) Question: Should we link MIDI player to master clock and if so, should it start (probably yes) and stop (maybe not) the master clock?

I guess the wider question is, what should be allowed to start and stop the master clock. This has been puzzling me for some time as different modules use the clock in different ways and we should have some coordinated approach.

The master MIDI clock acts as the time master. This means it has the concept of tempo. If an external clock is used instead of the internal JACK MIDI Clock then the concept of tempo lies entirely within that external device and Zynthian has no influence over this. Step sequencer has the ability to flag tempo changes but I am struggling to figure out what to do with these. I think I may only be able to control the internal MIDI clock’s tempo so the step sequencer’s tempo is only relevant if using internal clock. I guess that makes sense. (There is a technical challenge to get this to work due to the internal clock being a separate entity that does not have an API that allows dynamic tempo change without stopping the clock - grrrr! We may need to hack it or submit a feature request upstream. We may have some traction because I think its author may be a member of this community.)

1 Like

I hope I got the problem right.
I assume that it is not necessary to run the midi player and stepseq at the same time. After all, we work with a raspi and a maximum of 16 midi channels …
My suggestion would be that the two players exclude each other, and what was started first is then the midi-clock master.
Of course, the midi player should be integrated into the song editor at some point. :innocent:
When it comes to the function that the audio recorder should start a player when recording, I would suggest the following points in the recorder menu:

  • Record - mainly intended for midi-in and audio-in - midi player or stepseq must be started manually.

and additional:

  • Record + Midi Player: like record -but the midi player starts automatically
  • Record + Stepseq: like record - you guessed it …

It is {insert prefix}day so here is another update:

  • Fixed songs playing when switching between editors (I have to stop the transport which is suboptimal but there is a quirk of jack_transport - I may patch later)
  • Can now change tempo (was broken for a while) but only at start of song or during pattern editing. There remains an issue changing tempo during song (despite there being a working master track which can have tempo changes) due to some functionality in jack_transport missing (I may patch later)
  • Moving selection highlight in song editor now skips any space it cannot populate with the selected pattern. Note: This behaviour differs to pattern editor which does allow overlapping notes and will remove any existing notes that overlap. I feel there should be consistent behaviour between these two editors but want to live with each and garner opinion on which is more desirable. The song editor behaviour is designed to reduce the accidental removal of a pattern, particularly when using a touchscreen. This may be resolved by recent change to pattern editor where you can drag your input around before releasing. Thoughts?
  • Fixed copy song feature
  • @le51 I can’t reproduce the partially obscured last menu item now. Maybe I fixed it! Will you please retest?

There are many things on my list yet to do and I may add some to the next sprint but I am painfully aware that the interface is slow (particularly song editor full screen refresh or pattern editor with lots of steps in pattern) so I should really look at that. What I should do and what I want to do may of course differ… :wink:

Enjoy

@spurkopf I don’t think we do want to exclude modules. It may be the case that someone has a MIDI backing track which they want to use in conjunction with the step sequencer, either for simultaneous performance or during preparation or transfer of ideas to the step sequencer. Indeed I believe this was an idea that led @jofemodo to sync these together. We also need to consider engines that will benefit from MIDI timecode, e.g. sooperlooper (but probably a future full engine version rather than LV2 which does not support this - reference Zynth Club discussion). I reckon we may want to leave the transport running, issuing MIDI clock and just control the start / stop and position of modules. This is currently not possible with jack_transport, hence the comments above about needing to patch (or replace) it but I think we may want a master clock that is always available (like the LFO in an old analogue synth) so that it may be used to sync anything that needs it then have a separate concept of play / pause / recue that sits on top of this and does not control the MIDI clock.

1 Like

I see you want to leave all doors open. :wink:
If you can synchronize, start and stop everything, so much the better!
Then I actually misunderstood the problem with the midi clock. Thank you for the new update, saving the song tempo works. The patterns now seem to run synchronously.

Hi,
I’ve been away from my box a couple of days. I’ve just updated and unfortunately same thing occur with the last menu item.

Presumably you updated the feature/stepseq branch? What is your screen resolution?

Yes, latest commit (c7f13dd)

screen resolution is 800x480 (waveshare 7inch HDMI+usb)
All other zynthian screen (mixer, engine, stepseq, …) are looking good btw.

What is your font size?

good point !
I was using 14px for font size, changing to 12px solves the problem.
:+1:

1 Like

I will take a look later. I have some improvements to code optimization which speed up the interface that need a little more testing (and I am still building my kitchen). I hope to get another update out by end of weekend.

And do we get to see pictures of the kitchen? frankly I’m not sure how much progress is being made there…