How about using with 1 - 8 to toggle mute/unmute for the trigger inputs? Haven’t done the update yet cause I did not succeed in saving my scenes to USB by now but I will definitely miss this feature.

Anyway, thanks for doing all the work - I am really looking forward to a lot of the new features!

Just a quick heads up, there is a bug in beta 2, where preset saving only saves script 1 to flash. Fix incoming.


Beta 3 available on the first post with fix.


FYI I’ve noticed another bug, the bar at the top of the screen in live mode doesn’t always display. I’ve fixed it already, and that fix will be in the next beta.

I’m seeing the same screen artifacts that @Leverkusen reported when I’m switching modes. It will happen for a few seconds and then correct itself.

I’m also experiencing a save/load or scene change bug (not sure which). I have the default TT scripts on a USB stick. I just loaded them back onto my TT now that this version was more stable for me. If I load Triangle Mountain and then switch to 4Track, it keeps the tracker data from T.Mountain and doesn’t load the 4 lanes saved with 4Track.

1 Like

I think I might know what’s causing that. Does it end up only loading the data from pattern 0, but patterns 1, 2 & 3 stay the same? You might find that you get the same thing with both USB loading/saving and preset loading/saving.

I’ll get it fixed tomorrow most likely. Then I’ll release a new beta with the fix and the new i2c code included too.

3 Likes

Yep! Pattern 0 loads correctly, but 1, 2, and 3 are always blank.

1 Like

Beta 4 posted in the first post.

Changes since beta 3.

  • Switch the metro script (and delayed commands) to running at the next available opportunity, rather than immediately. See this post and onwards for details as to why. The downside is that the metro clock may be a bit more jittery depending on system load. The upside is that i2c / II crashes are significantly reduced if not eliminated entirely… (famous last words…)
    Enormous thanks to @trickyflemming for all the testing he did as well as @tehn for coming up with the solution and @Leverkusen for his testing too.
  • Fix the pattern saving bug that @trickyflemming reported. Annoyingly the cause was the same as the script saving bug that necessitated beta 3.
  • Make sure that the activity bar in live mode always displays.

There are also some underlying changes to how II messages to the original trilogy modules are calculated, I’ve tried my hardest to check the values are correct, but due to my development setup it’s not that easy to check on actual hardware. I would appreciate feedback to make sure the II messages still work (and remember you don’t need to use the II op anymore).

Assuming there aren’t any major bugs I will get a PR in for this code this weekend… and then onto sorting out the USB memory stick issues.

6 Likes

Sam,

I appreciate your work on this very much and am currently trying out the new firmware - thanks a lot for all the afford you are dedicating to this!

There is just one thing I am not sure about. That is the new triple switch to change between tracker view, live view and edit view. I used to switch from edit view to live view back and forth to just change global values as the metro speed, single trigger pulse widths or the es.mode without looking on the screen - just a short press, typing something like M 100 and switching back to work on the script. Now I am constantly overwriting the pattern when I automatically do so and have to look on the screen where I am which is a bit cumbersome.

I understand live and edit modes as two sides of teletype functionality where it makes sense to switch between but the tracker view is somehow a different thing plus triple switching seems counter intuitive to me as you cannot do it blind.

Is there a special reason for the new method? Would you consider the old way coming back some day?

Thanks again for the great support,

Sven

btw: at a first glance i2c seems good with reading cycles and triggering non existing trigger.outs with a metro script and trigger input…:heart_eyes:

2 Likes

The original discussion about changing the live/edit/pattern shortcuts starts here:

And then this is what I wrote about it when I released beta 2 (which included the updated key bindings):

I still stand behind the, ‘please give it some time’ bit.

I do have some other ideas for what to do to solve the issue from a different angle, but they’re not quite fleshed out yet. I also think that muscle memory takes a few days to shift, so it’s worth trying to live with it for a while.

Thanks! The new beta fixed the tracker loading for me.

I just found another weird, minor bug. The up/down arrow keys seem to be sent simultaneously to the tracker view and the load screen view.

  1. Load a scene with a description long enough to require scrolling.
  2. Go to the tracker view.
  3. Hit Esc. to bring up the scene description.
  4. Use the down arrow to scroll the description.
  5. Hit Esc. to go back to tracker view. The tracker will now be scrolled a number of steps down.

If I hit Esc again, the description will have scrolled back to the top. If I hit Esc. yet again, the tracker will then be back at the top.

Another bug report (sorry!)

I’m not sure how long it’s been like this, but the factory default 4Track script isn’t working as intended. F5 is supposed to advance all four tracks, but it is only advancing the first track. The gate outs are responding correctly, though.

Can you post the contents of script 5 for me? I’m afraid I won’t be able to look at the bugs till Friday at the earliest now.


edit: managed to sneak a quick look before breakfast, I’ve found the script. I think there may be something odd going on with P.HERE / P.NEXT, etc. It probably happened when I created the PN versions of all the P ops.

I’ve also noticed another small bug with live mode, where it doesn’t always clear the output of the previous command.

Also, just noticed a much more serious bug with multiple commands (i.e. using ;)

Right this bug wasn’t too bad, but a bit obscure. Consider the following statements in live mode (this might be a bit beyond you if you don’t understand the theory behind the Teletype’s programming language):

X 5
Y 7
X; Y

One would expect that the final statement will just print out the value of Y. In fact nothing is displayed and the value of Y has changed to 5!

What’s happening is that first sub command X; adds the value 5 to the command stack, the second sub command Y, sees that there is a single value on the command stack and assumes that it should set the value of Y to it, rather than retrieve the current value of Y.

The solution is fairly straightforward, just reset the command stack between sub commands.


Next up the far more annoying bug, which caused @trickyflemming’s weird scrolling bug, amongst many other weird things. See here for the technical details.

@tehn and @zebra I’ve added -fno-common to the compiler flags to catch ambiguous declarations (i.e. global variables where the compiler is trying to infer if they should be extern or static). These leads to errors with the following variables:

init_teletype.h

  • tcTicks
  • tcOverflow

I propose the following change to make them both static in init_teletype.c only. (The same issue also in init_ansible.h and init_trilogy.h.)

--- a/src/init_teletype.h
+++ b/src/init_teletype.h
@@ -4,8 +4,4 @@
 #include "types.h"
 
-// global count of uptime, and overflow flag.
-volatile u64 tcTicks;
-volatile u8 tcOverflow;
-
 extern void register_interrupts(void);
 extern void init_gpio(void);
--- a/src/init_teletype.c
+++ b/src/init_teletype.c
@@ -23,6 +23,6 @@
 //----- variables
 // timer tick counter
-volatile u64 tcTicks = 0;
-volatile u8 tcOverflow = 0;
+static volatile u64 tcTicks = 0;
+static volatile u8 tcOverflow = 0;
 static const u64 tcMax = (U64)0x7fffffff;
 static const u64 tcMaxInv = (u64)0x10000000;

kbd.h

  • old_frame

Again, I propose to make it static in kbd.c.

--- a/src/kbd.h
+++ b/src/kbd.h
@@ -50,6 +50,4 @@
 
 
-s8 old_frame[8];
-
 extern u8 hid_to_ascii_raw(u8 data);
 extern u8 hid_to_ascii(u8 data, u8 mod);
--- a/src/kbd.c
+++ b/src/kbd.c
@@ -4,4 +4,5 @@
 #include "kbd.h"
 
+static s8 old_frame[8];
 
 bool frame_compare(u8 data) {

edit 2017-04-22: I’ve made these changes on my libavr32 branch. I will post a PR soonish.

2 Likes

i need to read up on the links you posted - would it mean that tcTicks wouldn’t be available from main.c?

Yes. Not problem for the teletype code base (and init_teletype.c is only for teletype). Will you have a problem elsewhere?

If you don’t want to write to it, it would be better to add a function to return the current value IMO.

1 Like

reading only, i can change it easily - and having a function for it is a better implementation (i used it in clock div/mult implementation to calculate how long something takes)

Beta 5 posted in the first post.

Changes since beta 4.

  • Bug with sub command fixed
  • Various UI issues

Can you try this again with beta 5 please. If it still isn’t working can you print out the value of each patterns length, start and end in live mode for me.

I have successfully gotten memory stick loading and saving to work at any time, not just at boot time. Seems to be a lot more reliable, and also makes boot up really quick again.

The code is a very hackish, so I need to delete it and reorganise some of the teletype codebase before I redo it.

The plan is to implement it a little bit like how Ansible modes work, by first erasing all the current event handlers / timers and then assigning new ones just for memory stick mode (and then doing the reverse on memory stick removal). That should mean that it will be easy to write some UI for loading and saving (i.e. an “are you sure?” dialog using the pot and the button). Though I’m pretty sure I’m not going to have time to do that for 2.0 final.

The changes to libavr32 are very minimal, but it will require a small update to the config.mk for all modules. I’ll create issues on each repo when the time comes.

Aiming for a new beta by the end of this week.

6 Likes

@sam installed beta 5 last night. first of the betas i’ve tried, wonderful additions throughout!

one issue i ran into this afternoon. running 1 script clocked from meadowphysics after about 45 minutes the screen went black and all seemed lost. LEDs were still lit on the TT but no keyboard response. All is well upon reboot, but if it’s any help the script was close to the following:

1:
x toss; y toss
if x: cv 4 pn.next 0
if or x y: tr.p 4
if or x y: cv 3 rand vv 1000

and pattern 0 was about 6 values long

barring the blank screen, the new sub commands, aliases, etc all seem like awesome additions to this device

edit: i’ve been running a similar script for around an hour w/ no issues. so maybe that was just a fluke

Unfortunately, it’s still not working on my end.

P.L for all 4 patterns is 8
P.START is 0
P.END is 63

@tehn would you be able to test factory preset 4Track with Beta 5 to confirm that Script 5 isn’t working? On my Teletype, it triggers all 4 gate outputs correctly but only advances Pattern 0.

I’m wondering if (sorted from likeliest to unlikeliest):

  1. The current beta broke it.
  2. I have some weird version of the preset saved.
  3. Script 5 hasn’t worked previously (I swear it did, though)

Side note: Before 2.0 is officially released, it would be nice to add a few more default Scenes to show off the new features. One notable thing to me is that the standard Scenes include remote examples for the Trilogy, but not Ansible.