High Voltage Forum

General electronics => Computers, Microcontrollers, Programmable Logic, Interfaces and Displays => Topic started by: TMaxElectronics on June 07, 2020, 12:17:38 AM

Title: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on June 07, 2020, 12:17:38 AM
What's the point? Aren't there already plenty other midi interrupters out there?

Since I have always liked musical tesla coils, but been disappointed in how boring most other interrupters out there sound, I decided to build my own:
(https://i.imgur.com/0jsfUq5.jpg) (https://i.imgur.com/HJNIKTb.jpg)

As far as I know it is the most advanced Midi Interrupter publically available, as it supports full modulation of EVERY parameter of the signal using the VMS (Versatile Modulation System), configurable with a fully graphic scripting language,
and also supports presets which can be selected with the Midi program change command to make it easy to use for those that just want a cool sounding coil :D

Key features of the MidiStick:

Where can I get one?
You can buy one from me or make your own :)
I sell them in the shop on my website: https://tmax-electronics.de/product/midistick-v1-2/ (https://tmax-electronics.de/product/midistick-v1-2/)
All of the pcb files you need to make one yourself are here (hot air soldering station is required): https://github.com/TMaxElectronics/MidiStick_PCB (https://github.com/TMaxElectronics/MidiStick_PCB)
The firmware is here (you will need a pic32mx compatible programmer to burn the bootloader): https://github.com/TMaxElectronics/MidiStick_Firmware (https://github.com/TMaxElectronics/MidiStick_Firmware)

Here are some demo videos (the VMS demo is unfortunately not on a coil, since I couldn't go to the HV lab for a while due to the lockdown and running it in my basement is a little boring):

Disclaimer: I did edit this post to make it look better, I didn't start off posting this :D
Title: Re: compact midi interrupter
Post by: Max on June 07, 2020, 10:36:18 AM
Hi TmaxElectronics,

Love that minimalistic approach! Would you share some more details? What MIDI commands does it support? How do you set your ontime, etc.

Thanks!
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 07, 2020, 01:05:56 PM
Sure!
As i said, the software isn't 100% yet, so some things i still need to implement, so far it supports Midi Volume control (with minimum and maximum on time), Pitch bend and of course note on/off with two voices. It also has attac and decay.
I still plan to add frequency and amplitude adjustable FM & on time modulation, and want to allow it to play midi files with both hands of a keyboard on one track (low and high notes) without requiring modification of the midi file.
That small pin header next to the usb stick will be configurable as either an input or output, so it can be used to test wit a speaker or connect an E-Stop button or something like that.

The thing i am working on at the moment is configurability, because it is not the most user friendly if you need to recompile the code to change the max on time :P
It will be done with a small program, that saves the configuration to the stick, and maybe then use the program change command to switch between saved coils (?). Might be dangerous though if there is a programm change command in the midi file, though i might just lock it once it has started to play music, not sure about that yet. I also still need to decide how the config utility communicates with the thing, if I can convince the USB lib to have a dual role, then it would use a custom HID interface, otherwise i will use another midi channel for that. It would then technically not be midi compatible though and any controller change commands on that channel might mess up settings, so i hope to get the HID thing working.

I also want to make a 3D printed housing for it, but i don't have enough resin to print at the moment.
Title: Re: compact midi interrupter
Post by: futurist on June 07, 2020, 05:11:55 PM
Nice project, thanks for sharing!

I'd love to try it myself!
Title: Re: compact midi interrupter
Post by: Max on June 07, 2020, 11:02:34 PM
Oh - two notes. Cool. I'm curious to see your code. Btw. which microcontroller is it?

Configurability/Usability is an important point! The best features are pointless if they are a pain in the ass to use. I opted for a touchscreen for my MIDI interrupter (https://highvoltageforum.net/index.php?topic=1020.0 (https://highvoltageforum.net/index.php?topic=1020.0)). Although powerful and easy to use its an expensive solution. For your "tiny-Interrupter" I think a program on PC is the only viable solution. Any additional hardware would contradict your "usb-stick" solution.
I also think that you need to be able to change the ontime easily while its running. I already had MIDI files which got unexpectedly intense, so I had to reduce the ontime. MIDI volume is not really an option since it is controlled by the MIDI file (= your settings could be overwritten at any point).

Program changes are in my opinion not the best way to go. They happen quite "frequently", meaning in 10 MIDI files you download there will likely be one or two files which do program changes in the middle of a track. Of course you can remove them, but it is still a risk. Some MIDI programs always send a (default) program at the beginning to make sure the device knows how to play. Since you already mentionned ADSR, you could use program changes to switch between different ADSR timings?

I would suggest to use the SysEx commands. They are there for exactly this purpose: allowing manufactors to implement device specific commands, to configure things that are not covered by the MIDI specs. The command is 0xF0 (for chn. 0) and can be followed by any amount of data bytes.


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 07, 2020, 11:55:38 PM
It's a pic32mx270f256b, very much overkill for what i am doing, but its my go to pic with usb and I usually have some in stock so i used it. I'm using two timers combined in 32bit mode for each note, with the interrupt starting the fifth timer that controls the on time.

Quote
I opted for a touchscreen for my MIDI interrupter
That looks great! I was thinking of something similar, but since I have a laptop around to play the midi files anyway, I decided make it small so I don't have to setup as much stuff and also don't have to worry about power for the thing.

I also got the dual role working, so I can access the device directly, without needing to go through midi (didn't know thats what the SysEx cmds where for though :D ).
As for ADSR timings, the user would be able to add different configurations to each saved coil, which can then be selected through MIDI program change cmds. (So P1 - P2 would be coil one and P3-P6 would be coil two for example)
Kind of like this
(https://i.imgur.com/HVrxTz8.jpg)
And then only allow switching between different coils, when the last command was a controller reset or something else, that would never be sent as part of a song.

Since the software can communicate with the synth independently of current midi commands, changing parameters on the fly should be easy enough, though I will still use the midi volume control, just with an adjustable minimum and maximum on time (i might make that be able to be turned off).


Title: Re: compact midi interrupter
Post by: Mads Barnkob on June 08, 2020, 08:40:28 AM
Very nice project and certainly is no shame to remove that cheap-usb-to-midi cable that properly is just picking up more noise than doing good!

Would it be possible to slap 8 of these in a USB hub and have 8 instruments or is it showing as 8 voices? I am not very experienced with how MIDI really works.

I am in for 2 of these, if two are needed to play dual coils. Which I assume given there is only one optical output :)
Title: Re: compact midi interrupter
Post by: Max on June 08, 2020, 11:10:34 AM
I’m still not a fan of the dual use of the program change commands, especially if there is a second independant access. However adding the check with the controller reset should be fine and prevent unintended changes. I guess it‘s rather a personal preference than an objective advantage/disadvantage.

That microcontroller seems powerful enough to do more than two voices! 4 at least should be possible.

Of course the MIDI volume command should be respected and used! Maybe my last post was misleading. What i meant was that there needs to be an independant possibility to set the limits within which all MIDI commands operate. And that‘s what you want to do if I understand right.
Minimum ontime is an interesting idea. While I understand why one would want to do it, I thought it would be problematic for fade in/out effects and for ADSR. I‘m curious to see how it behaves in reality!
I forgot one thing in my last post: you mentionned „ontime modulation“ what exactly do you mean with that?

@Mads from a MIDI point of view this will work like a charm. The question would rather be how you configure them; does the configuration software properly support multiple ones.

Kind regards,
Max
Title: Re: compact midi interrupter
Post by: HighVoltageRulezz on June 08, 2020, 02:22:47 PM
Hi-

nice Work! I would be really interested if you would do a small production run- is one of the 24 boards still available? Would be great if you had the time to send me a PM!
My coil works not too bad so far but my experimets with making it play music were deafening... ::)

Kind regards
Roman
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 08, 2020, 03:44:31 PM
Quote
That microcontroller seems powerful enough to do more than two voices! 4 at least should be possible.
It Certainly would be. Right now i am using 100% hardware timing, but the thing is likely fast enough to run a software-postscaler on those timers, maybe even using some DMA magic ;)
For now i will focus on getting the software together though and once thats done add more features!

Quote
I’m still not a fan of the dual use of the program change commands, especially if there is a second independant access.
I'm not so sure about them either  ::)
My thought was that it would allow for limited configuration without needing the software, but i am starting to question wether that is actually a useful feature.

Quote
Minimum ontime is an interesting idea.
I have had issues on my coil (a VERY shitty small one, my big one isn't quite done yet) that at short on times was not able to strike the arc sometimes and it sounded bad when using very long attack or release times, i hope to fix that with that setting.

Quote
you mentionned „ontime modulation“ what exactly do you mean with that?
It will make the controller continuously vary the on time while a note is playing (by a varying amplitude and at varying frequency), creating an arc that sounds like it has more than one note playing, while in reality it doesn't (at least thats what it sounded like last time i experimented with this). I would post a video, but unfortunately I don't have a working coil at the moment and can only test with a speaker  :-[

Quote
Would it be possible to slap 8 of these in a USB hub and have 8 instruments or is it showing as 8 voices?
Honestly i don't know how USB Midi behaves in that situation, i have only ever used one synth at a time ;)
But i would expect it to show up as different midi out devices, instead of one midi out with multiple channels. My software only supports one additional midi out device so a workaround would be needed (which is exactly was i am trying to avoid with this board)
For that it might be a better solution to just make on synth with multiple interrupter outputs, an FPGA for the timing and a uController for USB Comms (for just two outputs the pic alone would be fine though i think). That might be a project for a later time if I ever have more than one Coils simultainiously :P

I would also like to hear your thoughts on an idea:
What if, in addition to having the settings dialog, there was a seperate (always on top) window for live performance, that has a panic button (incase the midi software messes up), the option to override the current ADSR & modulation settings from the selected programm and the selector for the current coil configuration.
Would you guys find that useful or not?
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 08, 2020, 07:29:01 PM
quick update: I more or less got the ui layed out the way i envisioned it:
(https://i.imgur.com/WlVO1nB.jpg)
what do you think? The programms are now unrelated to the selected coil, and the live preview of parameters is working, now comes saving&loading

I'm not sure about the top label though (the "Connected to..." one)... it looks kinda stupid  ???
Title: Re: compact midi interrupter
Post by: Mads Barnkob on June 08, 2020, 10:01:47 PM
A status bar the bottom has been windows standard for many years, add one :)
Title: Re: compact midi interrupter
Post by: futurist on June 08, 2020, 11:37:52 PM
Minimum ontime is an interesting idea. While I understand why one would want to do it, I thought it would be problematic for fade in/out effects and for ADSR. I‘m curious to see how it behaves in reality!

I think that minimum on-time is must-have feature for good midi playback. Bellow some on-time the coil won't output a spark, or it will be too quiet
My min. on-time is set to around 40 us, and less than that the midi playback sounds bad
Title: Re: compact midi interrupter
Post by: davekni on June 09, 2020, 05:56:30 AM
Yes, I also find minimum on-time helpful.  Besides enforcing a minimum, I'm making pulse width proportional to sqrt(volume).  That subjectively seems to help, but I don't have good comparisons.  At least for pulses towards the short end, current is growing roughly linearly with time, so total energy is growing as time squared.  Sqrt() undoes that square relationship.  For longer pulses, primary current envelope is more complex, especially with the beat between primary and secondary frequencies.  The sqrt() function isn't a match for long pulses.  On my coil it works out well, however, reducing excessively-long pulses.

The sqrt() function is applied after merging or separating pulses that are too close.

I'd love to make a more accurate translation from instantaneous note volume (including any other notes outputting a pulse at the same) to pulse width.  The mapping would need to be quite complex, perhaps too complex and variable to be within reason.  Spark behavior depends heavily on pulse history - how much of an ionized air path is built up.  Relevant history appears to go back much farther than I was guessing.  And, of course, ground strikes make a significant difference too.  My hope was to set up a microphone and measure sound impulse energy vs. pulse width.  The long history makes that impractical.  If only one or two pulses of history matter, could capture that before echos interfere.  Anyone have access to an an-echoic chamber for coil testing? :)
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 11, 2020, 10:04:45 PM
Just thought I'd post another update:

I have now got the PC software more or less finished. I still need some way of selecting the active coil configuration and give it the ability to update the software on the synth.
The UI now (kinda) has a status bar on the bottom left below the tree view, but i am not 100% sure if i like it that way...
Changes are also not automatically sent to the device at the moment, because I want to keep NVM writes to a minimum, even if it can handle at least 20.000 writes. At least the program marks any changed settings on orange, as you can see on the left.
(https://i.imgur.com/b7kStY6.jpg)

The other features work; it can save Coil configurations and Midi programs to the synth and the synth can recall them when the Midi player tells it to (at least the programs). Attac and release also work, sustain and decay don't yet though :/
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 14, 2020, 04:15:14 PM
I've just released a beta firmware if anyone want's to have a look:
https://github.com/TMaxElectronics/MidiStick_Firmware (https://github.com/TMaxElectronics/MidiStick_Firmware)

Still some coding to do though, sorry it is taking so long. The project is a little more complex than I had anticipated  ::)
If i'm lucky i will also have my larger coil working to test with soon! :D
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 19, 2020, 12:48:29 AM
So i am now working on proper decision making logic to decide which of the notes to play and am not sure in which direction to go.
At the moment I have a list that contains all notes currently on, and wan't to select the most important ones, musically speaking .
My initial plan was to get the set of notes that are part of the melody (right hand) and those that are part of the **** (i actually don't know the name for those  :-[ ) from the left hand, then play either one note from each, only the melody or only the left hand.
But some tracks don't seem to follow the piano scheme but still have multiple notes on... So either I just ignore the tracks that have more than two simultaneous notes, since most songs are available in tesla friendly versions, or to make a better system.
Maybe just checking if the note is higher than the median of currently playing notes, if there are more than two, and then using voice one for the most recent upper one and two for the lower one, but that relies on the piano style system again.

What are your thoughts on this? Is a smart note controller a useless feature or actually useful (by allowing un-edited songs to be played).
Title: Re: compact midi interrupter
Post by: Max on June 19, 2020, 08:11:25 PM
Hello TmaxElectronics,


I had a quick look at your code when you released it. I wondered about how you solved ADSR. It looked like some amplitudes were hard coded? And i didn't quite understand why A, D, S and R were implemented differently. If you stay with linear curves (e.g. linear rise for A, linear fall for R), you actually don't need 4 different implementations. If you have a look over here at my code (https://github.com/MMMZZZZ/Syntherrupter/blob/master/Tiva_Interrupter_Source/MIDI.cpp#L515) it is basically this (assuming we are doing an attack):
Code: [Select]
gradient = (attackAmplitude - releaseAmplitude) / attackDuration;
noteAmplitude += gradient * timeDiff;
if ((gradient >= 0 && noteAmplitude >= attackAmplitude) || (gradient < 0 && noteAmplitude <= attackAmplitude))
{
    noteAmplitude = attackAmplitude; // Prevent overshooting
    // Target reached, proceed to next mode (here: decay).
}
The big advantage is that it does not matter if the gradient is positive or negative. That means your ADSR parameters can be completely arbitrary. Doesn't matter if sustainAmplitude is higher or lower than decayAmplitude.

Quote
So i am now working on proper decision making logic to decide which of the notes to play and am not sure in which direction to go.
At the moment I have a list that contains all notes currently on, and wan't to select the most important ones, musically speaking .
Thought about that, too. The short answer is: there is no "perfect" way to do this. Here is why: Accompaniment (the term you were looking for, if my translator is correct) does not stay in a strict range. Even on a piano (playing it for 14 years now ;) ) it rarely stays in "its own region". Sometimes the melody is in the middle, with additional lower and higher notes. Admitted, this is more problematic if you have many voices, as f.ex. in an unmodified MIDI from the internet or simply the original version of a piece. Once it is reduced to two voices only, it is a lot more often true that the melody is higher than the accompaniment - and still there are exceptions.
Second option would be to select by volume/velocity. This would probably work in quite a few more cases than the previous idea and makes musically more sense. Its the melody you want to have "in front" of all the rest. The problem with this kind of detection is that many MIDI files don't have real nuances (variation in volume) - especially not inside the same track.

So if a musical recognition of the melody is not that easy, what other solutions are possible? Simplest option (although musical nonsense): put all notes in a buffer. If the buffer is full, overwrite the oldest note. Thats what I have done. Considering the high limit of 8 voices for my interrupter the buffer strategy really isn't that important anymore.
In your case however you could try a combination to get the best results. What if you had a buffer for each voice? Except for some very few (and often low quality) MIDIs you never have melody and accompaniment on the same channel. This means that you would effectively have one buffer with all currently playing notes of the melody and one with the active notes of the accompaniment. Then you could - from each buffer - select the one with the highest velocity and only play that one. And in case they are all the same, you simply take the most recent note. Additionally you could say that if the "accompaniment buffer" is empty, you take two notes from the "melody-buffer". Then even the crappier single-channel MIDIs will play with two voices. The advantage of the dual buffer solution is that your accompaniment can‘t overwrite your melody. If there are melody notes, at least one of them will be played.
In your desktop tool you would be able to assign any channels to any of the two buffers. It is very useful to listen to multiple channels since it is quite common that the melody is divided in multiple channels, which don't play at the same time. It is mostly done if the melody switches the instrument.

Hope this makes sense and is useful. :)


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 20, 2020, 02:39:26 AM
Quote
I wondered about how you solved ADSR.
I based my implementation on one i did in VHDL for an FM Synth a while back, that's why it has a state machine ;)
I also wanted to use exponential waveforms, since I felt they sounded better than linear ones, especially with long release times from things like guitars.
Basically the way I have implemented it is by using a multiplier (Midi_currOT1Mult/Midi_currOT2Mult) that scales the output on-time. In the different states it multiplies the appropriate coefficient with the multiplier, so you get the formula

Code: [Select]
onTime = maxOnTime * coef^t   ;   with coef > 1 for attac and coef < 1 for decay&release
and then checks if the required on-time is reached:

Code: [Select]
if(Midi_currReqNoteOT1 > 0){   //this checks if the note is still turned on (by the midi controller)
   Midi_currOT1Mult *= Midi_attacCoef; //then it updates the multiplier
   if(Midi_currOT1Mult > 1 || Midi_attacCoef == 1){  //checks if the note has reached the target on time (for attac the multiplier must be 1) or if attac was disabled by setting the coefficient to one
      Midi_currOT1Mult = 1;    //we need to do this if we entered this code because the coefficient is one, so we instantly get to 100% on time
      Midi_currNoteOT1 = Midi_currCoil->minOnTime + Midi_currReqNoteOT1; 
      /*update the on time that the timer interrupt actually uses (technically we still need to multiply Midi_currCoil->minOnTime with Midi_currOT1Mult, but since the coefficient is one we can ignore that)*/
      Midi_adsrState1 = DECAY; //advance the state machine
   }else{  //if we have not reached our target on time, we adjust the current on time with the multiplier value
      Midi_currNoteOT1 = Midi_currCoil->minOnTime + (uint16_t) ((float) Midi_currReqNoteOT1 * Midi_currOT1Mult);  //the requested on time is always what needs to be added to the minimum on time settings of the current coil
   }
}else{
   Midi_adsrState1 = RELEASE;
}
I hope those comments explained the code a bit better.

Quote
It looked like some amplitudes were hard coded?
No that shouldn't be the case ??? My code is a bit confusing though I must admit ::)
All of the Waveform parameters (min/max on time, duty cycle) are adjustable by software and saved in the NVM, and then read from the Midi_currCoil struct.

I'm also wondering which fiber-optic connectors other people are using for their coils, the transmitter I'm using is from a range with ST,SC,FC and SMA versions, but i think some coils use just bare fiber (like the OneTesla one), so those would at least need some kind of an adapter to fit. Maxs Syntherrupter uses SC if I recall the post correctly
Title: Re: compact midi interrupter
Post by: Max on June 20, 2020, 05:33:57 PM
Ok I see I should have spent more time with your code before commenting it.

It is true, I'm using SC connectors. Not because they are popular, better or cheaper, but because I already had 10m SC cables. I think the most common type in the tesla coil community are ST connectors and "no connector" (those industrial transmitters where you put the raw fiber in).
Edit: For my interrupter its no problem to use an uncommon connector since I don't sell them. It's mostly made from off-the-shelf parts that don't require soldering. Additionally, selling it with a (machined!) metal enclosure and all connectors mounted would make it pretty expensive.
The only thing I could maybe design and sell would be a tiny PCB with a MIDI optocoupler and the optic transmitter including its driver transistor. But that's really just a 5min job... I don't think this would really be interesting for someone who has successfully built a whole tesla coil.

Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 20, 2020, 09:52:14 PM
Quote
Ok I see I should have spent more time with your code before commenting it.
No problem! I do admit that my coding style is very confusing ;D , especially when I program c and java more or less at the same time :D

Quote
For my interrupter its no problem to use an uncommon connector since I don't sell them.
I don't really plan to make a product out of them either (unless of course somebody wants lots of them :P ), but since i have some more boards and uControllers laying around and some people were interested in trying one out, I was just wondering if they would even be able to use it with their connectors. Should be fine though, since the range of transmitters has most common connectors available (except the no connector one).

And i have now got four voices working from just the timers :D
I'll now need to limit how close together the pulses are, i think i will use a holdoff time. should i make this variable or not? I guess it kind of depends on the coil, but maybe not enough to require adjustment...
Title: Re: compact midi interrupter
Post by: Max on June 21, 2020, 09:14:32 AM
Quote from: TmaxElectronics
And i have now got four voices working from just the timers :D
I'll now need to limit how close together the pulses are, i think i will use a holdoff time. should i make this variable or not? I guess it kind of depends on the coil, but maybe not enough to require adjustment...
Congrats! 
It does affect the sound quality so you want to keep it as low as possible. I guess the values range from ~200us for a low frequency high impedance coil to only ~30us for a high frequency low impedance coil. Having 200us fixed instead of 30us will be audible (at least i heard a difference...).
Long story short: I‘d make it adjustable :)

Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 21, 2020, 01:10:52 PM
Quote
Long story short: I‘d make it adjustable
Will do! ;)

The other thing I'm not sure about is how to limit the dutycycle with multiple notes playing. I was thinking of a counter to check for how long the notes were on in a given time period, that then either disables the output if it was too much or scales it back until, at the limit, it is off all the time. But the graceful one sounds really bad, as you can hear the base frequency of the background limit counter resetting :(.
The hard limit also sounds quite bad (though is not as noticeable), but only if the limit is reached (which happens quickly with four voices :P).
So is this actually a problem? Or should I instead limit by not playing a note if it pushes the on time over the limit, as that would make the music not sound bad, but instead have a part missing from it.
It is of course fairly simple to "fix" a song that triggers the limiter, by just adding a note offset to the programm (in the control software).
Title: Re: compact midi interrupter
Post by: Max on June 21, 2020, 02:42:48 PM
Although it's actually pretty easy netzpfuscher had to give me a push, too. Here is my code (line 512 and 566-579): https://github.com/MMMZZZZ/Syntherrupter/blob/9d442716ccf55b9ead32166d53c178af5c0f897b/Tiva_Interrupter_Source/MIDI.cpp#L566 (https://github.com/MMMZZZZ/Syntherrupter/blob/9d442716ccf55b9ead32166d53c178af5c0f897b/Tiva_Interrupter_Source/MIDI.cpp#L566)

Basically what you do is calculate the sum of the duties of all notes (current ontime multiplied by current frequency) and check if this exceeds your limit. If this is the case you reduce all ontimes by the same factor so that the sum does no more exceed your limit.

Now this does not prevent the very short "duty spikes" when the ontimes of all notes fall closely together (all notes "in phase"). Those spikes should be shorter than 1ms in 99% of the cases (estimated 4x 200us ontime + 50us minimum offtime. And 200us ontime is a lot for 4 voices). For the fuses and the thermal limits of the setup this works just fine.
If a coil cannot handle a few ontimes quickly after each other, I think the best way to go is to simply increase the minimum offtime or reduce the primary current to increase the margins.

This duty cycle limiting is noticeable by a drop in the volume. Listen to the following video of my interrupter and compare 0:40 with 1:36. If I'm not mistaken, the latter one has a higher pitch, causing the duty cycle limit to reduce all ontimes. At least it sounds exactly like that.

Edit: It is actually not that easy at all to know in advance if a MIDI file is going to exceed the duty limit or not. Lets just say I tested it pretty hard and I'm glad I have it. ;D


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 21, 2020, 04:32:17 PM
That sounds cool, i can't wait to get my coil working and test with it ;D

Quote
Basically what you do is calculate the sum of the duties of all notes (current ontime multiplied by current frequency) and check if this exceeds your limit.
Good idea. But i think i might have come up with a better one:
Have the controller keep track of how long the output was on and how long it was off, then use those two values to count a value up and down, which then scales the on time. This would also be able to limit multiple pulses very close to each other.
Luckily the pic32 architecture has a core timer, so no need to remove a voice :P
It does work (i have just tested it), so i will continue with this for now and only if testing shows that it does not work reliably, switch to the other method.

EDIT: i think i should explain myself a bit better (i just read my own text and it was hard to understand :o )
Basically what i want the controller to do is to integrate the output waveform, and then scale back the volume depending in the area underneath it. From this I can limit two parameters:
    the "duty cycle", by scaling the rate at which the accumulated on time is reduced when the note is off and
    the maximum cumulative on time, by reducing the on-time the closer we get to the maximum (this would be yet another setting in the software)

So the question is, would this system actually work well enough for a tesla coil...
Title: Re: compact midi interrupter
Post by: Max on June 21, 2020, 10:34:04 PM
Honestly, I can't really see the benefit...

First of all, how long would you choose your integration time? 1ms? 10ms? 100ms? If you chose it too small, you will effectively filter out low notes (example below). If you chose it too high, you don't have real benefits over the method Netzpfuscher and I use. Especially if you chose it low enough to filter burst ontimes you're effectively not limiting your overall duty, but introducing a ontime limit and a minimum offtime.
Additionally it costs quite a lot of CPU time. It has to continually track all timers and calculate the average instead of doing it once when a MIDI command comes in.

Here's an example from "Gimme Gimme Gimme" (which I posted as video in my topic, too): Maximum allowed duty is 10%. MIDI note 45 and 88 play together. Ontime is lets say 50us for both. Gives the following values:
MIDI Note | Frequency [Hz] | Period [us] | Ontime [us] | Duty [%]
451109090500.6
881319758506.6

Total duty is 7.2% which is well below the given limit of 10%. How would you chose your averaging times in this case?
Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 21, 2020, 11:08:07 PM
Quote
First of all, how long would you choose your integration time?
its not a time frame based integration, instead it is constantly running.
The way I implemented it is also not very cpu intensive; Basically the timer interrupt that turns off the output also saves the value of the CP0 timer (running at 24MHz, not adjustable) to a variable. Then when the output gets turned on again, it subtracts the time since switch off from the accumulator:
Code: [Select]
accumulatedOnTime -= ((_CP0_GET_COUNT() - noteOffTime) * Midi_currCoil->maxDuty) / 3200;    //the 3200 is the factor by which the CP0 counts faster that TMR1 multiplied with the % division from the max duty cycle variableThe maximum duty cycle impacts how fast the counter counts down.
afterwards it adds the on-time for the next note, which is scaled by the accumulated on time (if it is larger than half of the continuous on time limit).

Quote
...you don't have real benefits over the method Netzpfuscher and I use.
That is one thing I was wondering about too. The only benefit i see is that it will limit the duty cycle, even if an effect changes it, and it has the ability to scale pulses coming very close to each other. If this is necessary or even worth it is another question.
Lets say one note has a sustain power level of 30%, if you use the 100% level to calculate your duty cycle, you potentially scale back further than needed. (but i have no idea if that is actually an issue)

I think i will leave it in, as it does work and does not cause any audible effects, except when it limits, which only makes the sound quieter.
And sorry if my explanation of this is still bad, I don't really know how to explain it any better :(
Title: Re: compact midi interrupter
Post by: Netzpfuscher on June 21, 2020, 11:27:35 PM
In my implementation the sustain power level goes into the calculation.

https://github.com/Netzpfuscher/UD3/blob/master/common/ud3core/tasks/tsk_midi.c#L766

And the pitchbend results also in a recalculation. The other ADSR phases are not calculated.

On the UD3 the Volume doesn't modulate the pulsewidth. The pulsewidth is fixed until the duty cycle limiter kicks in. The volume modulation is done with the primary current (pulse skipping) every single pulse which goes to the inverter contains a pulsewidth and a volume. If two or more notes are played the OCD changed for every pulse between the min and max current range.

I have seen a few float calculations in your code. Does your micro has a FPU? I haven't seen that by a quick look. If it has no FPU you should change your calculations to fixed Point.

Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 21, 2020, 11:41:37 PM
Quote
Does your micro has a FPU?
No it does not, but really the only drawback to using FP is the speed isn't it? So far I have had no issues with that, but i will change it once some show up :)

Quote
On the UD3 the Volume doesn't modulate the pulsewidth.
I'm afraid my little drsstc controller is waaaay behind yours in terms of features, so duty cycle control will have to do :P
Title: Re: compact midi interrupter
Post by: Max on June 22, 2020, 01:49:42 PM
Quote
First of all, how long would you choose your integration time?
its not a time frame based integration, instead it is constantly running.
The way I implemented it is also not very cpu intensive; Basically the timer interrupt that turns off the output also saves the value of the CP0 timer (running at 24MHz, not adjustable) to a variable. Then when the output gets turned on again, it subtracts the time since switch off from the accumulator:
Code: [Select]
accumulatedOnTime -= ((_CP0_GET_COUNT() - noteOffTime) * Midi_currCoil->maxDuty) / 3200;    //the 3200 is the factor by which the CP0 counts faster that TMR1 multiplied with the % division from the max duty cycle variableThe maximum duty cycle impacts how fast the counter counts down.
afterwards it adds the on-time for the next note, which is scaled by the accumulated on time (if it is larger than half of the continuous on time limit).

Quote
...you don't have real benefits over the method Netzpfuscher and I use.
That is one thing I was wondering about too. The only benefit i see is that it will limit the duty cycle, even if an effect changes it, and it has the ability to scale pulses coming very close to each other. If this is necessary or even worth it is another question.
Lets say one note has a sustain power level of 30%, if you use the 100% level to calculate your duty cycle, you potentially scale back further than needed. (but i have no idea if that is actually an issue)

I think i will leave it in, as it does work and does not cause any audible effects, except when it limits, which only makes the sound quieter.
And sorry if my explanation of this is still bad, I don't really know how to explain it any better :(
Okay it seems to cost less CPU time than I thought; probably not more than what I did. I didn't mean that you divide your time in discrete chunks; more the idea of a moving average. And that's how it still looks to me.

What I do in my code is that after all effects (pitch bend, modulation, volume, ADSR, etc) have been applied - at the moment where I know exactly which ontimes and periods will appear on the outputs - only then I calculate the duty of the active notes and adjust the ontimes if needed. This is the final step before outputting the signals.

To take your example: If 8 notes attack at the same time, causing a duty spike, the limiter will only be active during the spike - or to be more precise: during the part of the spike which exceeds the limit. Instead of having a triangular Attack/Decay shape, it will be a trapezoid. The sustain and release shape won't be modified at all (assuming that the total duty falls below the threshold during decay. Otherwise the limiter wil of course stay active).


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 24, 2020, 05:48:05 PM
I finally got my coil to make some sparks, and tested the Interrupter:
Videos are potato quality, because I only had my phone in my workshop at the time.

There are still some problems with the duty cycle limiting though. If too many notes are on at one time and the limiter kicks in, the pulses tend get so short, that they don't make sparks anymore. At that point it would have to decide between too short or missing Pulses...
That could be because of the limited primary voltage I was running at though (120V instead of 330V).
Title: Re: compact midi interrupter
Post by: Max on June 24, 2020, 07:09:28 PM
Wohoo congrats!

Love the comments ;) iPhones have the possibility to lock exposure and focus with a long press to whatever part of the image you want. It will adjust for that part and keep those settings no matter what happens. I'd guess that Androids have similar functions?

The Ievan Polka sounds deeper than what I remembered? Is that a bug or a feature?  ;D
In the heart of courage video some notes seem to have quite .. expressive attacks? Interestingly only if they are not legate (played immediately after the previous one without audible pause inbetween). Couldn't hear something similar in the other video, which makes me wonder if it is part of the MIDI file.

Btw I'd love to try the same MIDI file on your and on my interrupter for comparison.


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 24, 2020, 07:59:15 PM
Quote
iPhones have the possibility to lock exposure and focus with a long press to whatever part of the image you want.
Mine can do that too, but the touchscreen went a bit crazy and decided to unlock it again.
I have just made some more Videos with a better camera app, they are on my youtube channel.

Quote
The Ievan Polka sounds deeper than what I remembered? Is that a bug or a feature?  ;D
I might have been afraid of high notes and their power draw initially ::)  Its one octave lower than usual.
That's why I added the adjustable note offset to the Synth :P

Quote
In the heart of courage video some notes seem to have quite .. expressive attacks?
Idk, I did not have any effects on for that. Maybe an effect of the limited coil power?
Here's a Video with some ADSR enabled:

Maybe I should have used my minimum on time feature. Especially the fadeout in the end sounds weird...

Title: Re: compact midi interrupter
Post by: Max on June 25, 2020, 12:07:03 AM
A full octave - oh boy my ears are out of practice. Should have heard that.

Limited power is likely the cause. You powered the coil from a variac, right? I bet the bus voltage dropped by a significant amount! You could check that with a multimeter.

The fade out is tricky (except if you can, like Netzpfuscher, control the primary current). Here‘s why: by reducing the ontime, you increase the high frequency content of the note while decreasing the fundamental tone. Or in other words: your signal to noise ratio gets worse. And I don‘t think there‘s much you can do about it if you have a normal DRSSTC driver like the UD1.x or UD2.x.
If you set a minimum offtime you won‘t get as noisy sounds, but you won‘t get a complete fade out either. There might be a good compromise though. Has to be tested.
I have to say, after having heard lots of music on a piezo and some metal plates, the issue is not that bad in your video. Maybe it‘s because I‘m already used to it...?


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: TMaxElectronics on June 25, 2020, 01:16:14 AM
Quote
I bet the bus voltage dropped by a significant amount!
Very likely. especially since I am pushing the output from my variac slightly past 230V, so I can get a little more voltage out of my Isolation transformer.  Which is really just an old toroidal one from a power amp.

Quote
The fade out is tricky
certainly, but i think at some point it is just part of how a tesla coil sounds. If we just wanted to listen to music we would be using speakers after all :P

I was actually thinking about some ways to recreate instrument sounds (or for that matter any audio signal) with a tesla coil, either by using a fairly high base frequency and doing PWM modulation to get an "analog" output. But that would be damn near impossible at normal resonant frequencies.
For example using 20KHz carrier (is that actually the right word?) with a 100KHz coil frequency would only allow for 5 cycles of the primary in one interrupter cycle, so at least very poor resolution, if the coil even managed to output anything at all.
In addition there is the extremely non-linear relationship between interrupter pulse width and output audio amplitude. I did kind of get this to work with my first coil, but that had a Fres of almost 400KHz, and even that sounded bad.
So the other thing I was thinking of, would be to use an FFT on the audio signal and then output some of the peaks in the spectrum from the voices of the synth. No idea if that would work though, and it would probably also require an FPGA - definitely a project for after my exams  :o.
I have seen a post here some time ago about somebody using a saxophone to control a tesla coil, but i believe they used the zero crossing of the signal as the interrupter input.
Title: Re: compact midi interrupter
Post by: TMaxElectronics on July 12, 2020, 05:06:10 AM
Ok so its been a while since the last update, but not because I stopped working on it :D
I didn't give any updates because nobody has the hardware to test potential updates at the moment anyway...

But much has happened since:

So now all that is missing is a bootloader, and the ability to do a bulk write of all changed program presets (right now only one write is supported and its inefficient).
I'll also be soldering together another one of the boards soon so I can test with more than one simultaneously (maybe even including support for the pan command, as the competition already can :P)

I also have confidence in the Hardware now, and am ready to manufacture some, so if you wan't one just send me a PM, and I will order some extra parts with my next digikey order.
Unfortunately i won't be able to do it for free though, and it would cost 15€ WITHOUT the optical transmitter, which costs 20€ in addition to that (direct digikey price :/)). If you have some with a compatible pinout you could use yours: https://docs.broadcom.com/doc/AV02-0176EN (https://docs.broadcom.com/doc/AV02-0176EN)
I really hoped for it to be cheaper but the bom cost is already at ~7.50€ without the PCB, so sorry to disappoint :(... (all with 19% VAT though).

And I have committed to continue with this project, despite my new controller being UD3 based and not supporting an external interrupter (at the moment at least), so updates will continue :D
I'll post some test footage with a speaker tomorrow (its 5am right now, so not really the time to play loud music :P)
Title: Re: compact midi interrupter
Post by: TMaxElectronics on July 26, 2020, 03:50:59 AM
Just a quick update:

(https://i.imgur.com/CdphAn5.jpg)

I have now got support for more than one stick simultaneously, the bootloader and a proper saving method working.
So the time for a "finished" V1.0 is getting closer... and it has taken only like 8 times as long as I initially expected  ::)

All that is left now are some usability improvements to the pc software and a thorough test (like the ability to copy settings from one stick to another).
There are of course a few more features planned, like stereo with multiple sticks (which I absolutely came up with myself and did not at all copy from Max :P ) and inclusion of a variable noise source (with limits for both lower and upper frequency), that might be used for drum emulation.

I have also implemented a per-device serial number, so the software can keep track of which device is which, the option to give each stick a nickname, and the firmware update-utility can download the latest release from github automatically too.

This is more or less the finished user interface:
(https://i.imgur.com/tBrRXmv.jpg)
I have to say I am actually quite proud of it 8)
Title: Re: compact midi interrupter
Post by: Mads Barnkob on July 27, 2020, 10:22:48 AM
You have every reason to be proud!

Sharing such a completely documented project with all software available is perfect example of the sharing culture in this niche of electronics.

If you are in need of beta testers to break the build, I will do all in my power to make your software behave badly, unintentional and possible crash :)

Title: Re: compact midi interrupter
Post by: TMaxElectronics on July 27, 2020, 03:09:07 PM
Quote
If you are in need of beta testers to break the build, I will do all in my power to make your software behave badly, unintentional and possible crash :)

I'm happy about everyone that gets to use this thing :D
I'll post another update once I have the software in a state that I would call good, but that might take a little while still, as I'll be writing exams at uni for the next three weeks...

Quote
Sharing such a completely documented project with all software available is perfect example of the sharing culture in this niche of electronics.
It is also really nice for somebody to actually get to see and use the software that I write, and actually be able appreciate it properly. Until now all tens of thousands of lines of code I wrote remained pretty much unseen (which is isn't only a bad thing though, judging by some of the crap code I wrote :P).
Title: Re: compact midi interrupter
Post by: TMaxElectronics on July 30, 2020, 03:14:53 AM
I finally got the software to a state that I am willing to give to people :D
https://github.com/TMaxElectronics/MidiStick_Firmware/releases/tag/V0.9 (https://github.com/TMaxElectronics/MidiStick_Firmware/releases/tag/V0.9)

It is not quite the V1.0 yet, as I didn't have time to extensively test it, but it is 100% usable.
I'll also need to create a wiki on github about the software.

The only features I am still missing is modulation (which I'd need to play around with on a coil to see what sound good), and stereo (which I'll finish for the V1.0).
I also still want to add the noise source, but that is a much more long term goal.
Oh and maybe also 3d print a nice case for them

But there is one thing that I need the most at the moment:
People to test this thing ;)
So if you have 10€ + the cost of the optical transmitter to spare I would be happy to send you one of these interrupters :D  (it's bom cost, because it's not the 100% finished thing yet)
Shipping should be reasonable cheap too, as it only weighs 6g.
Send me a pm if you are interested.
Title: Re: compact midi interrupter
Post by: TMaxElectronics on August 06, 2020, 03:22:38 AM
I just finished a new version of the circuit board :D

There are no changes to the functionality, and the 20 or so old ones I have laying around are still perfectly usable, but since quite a few people are using "connector-less" opto hardware for their coils I have now added a dual footprint, that supports both HFBR and ‎IF-E96E‎ style transmitters. The only change needed is changing one resistor, as the HFBRs are rated for much higher current, and there is a slight pinout difference, that means it os not possible for both resistors to be in place simultaneously.
Oh and I have made the PCB 2mm narrower, not that that really makes a difference...  ;D

(https://i.imgur.com/NfhsmHU.jpg‎)
Title: Re: compact midi interrupter
Post by: TMaxElectronics on August 24, 2020, 02:32:24 AM
OK I have good news and bad news:

The bad:
There are two undrilled vias on the PCBs I ordered (somehow altium didn't export them... I have NO clue why that would happen).
Luckily One is only a redundant ground via, the other one however is a little more important... It carries power to the pad for the ‎IF-E96E transmitter, so that is not going to work with this PCB (I will order new ones with my next order). I can put in a bodge wire, so if somebody wants to test with that, they can but it will look bad :(
Everything else works fine though :D

The good:
I finally got some work done again :D

I added the ability for the devices to change their name as reported by the USB stack, so when giving the device a nickname, it will now also show it as the midi port name (after reconnecting the stick).
But this did take a little workaround because of windows foo... As somehow windows thinks if two identical USB-Midi devices are connected to a PC they must be the same and "optimizes" things by just using the name from the first for both, which causes confusion and even some midi software to just not work anymore.

The way windows checks if the devices are the same is by comparing their Product and Vendor IDs, if they match they must be identical according to uncle bill ;)
So what I had to do was to make the PID dynamic: The PC Utility checks for conflicts (equal PIDs) between all connected midisticks, and if one is found re-numerates all devices by writing a different PID to them. I'm not sure if this is in any way compatible with the USB standard, but it works, and since I cant afford the tens of thousands of € to get certification anyway I might as well use such a workaround :P

So with this another item from my todo list is done, which leaves only stereo as an immediate improvement, that I want to implement.
V1.0 is coming closer and closer ;D

Oh and I think I will have to move the aux connector... It looks so ugly and bulky hanging of the side the way it does:
(https://i.imgur.com/fmVfIXT.jpg)
Title: Re: compact midi interrupter
Post by: TMaxElectronics on October 03, 2020, 11:02:15 AM
Oh hey, another update (finally)... I haven't really had much time working on the stick in the last few weeks, as I am putting together a new (much larger) coil and also trying to get the software for the UD3 compatible SFP module working.

I finally have stereo working, with each stick now having a setting for its stereo position, width and slope. Explaining how this affects the sound is a little hard, so just look at this picture here for explanation:
(https://i.imgur.com/fXu2o4y.jpg)
The settings basically add a scaling factor to the note volume, depending on the position of the pan knob, so (just like the synthterrupter :P) you can use multiple coils at different locations and map the notes to them using the midi pan command. And with the slope and width adjustment it is easy to control stereo separation.

So for now the todo list is empty, as I didn't really get any feedback about the software yet, but since I haven't really had much time it is probably better that way :P

There are still some things that I want to play around with as well; mainly the midi drum channel. For that I would add a much more versatile method of sound generation, that supports fm modulation (more specifically frequency slopes), single shots, amplitude slopes, noise and probably more. At which point I'd probably have everything I need to also include a SID emulator like the one in the UD3.

But for now, I'll first want to finish my coil (about which I'll probably make a seperate post here) and the SFP module.
Here's a video of two sticks playing a midi file with some stereo mapping (with some very poor audio quality and some glitches unfortunately):
Title: Re: compact midi interrupter
Post by: Mads Barnkob on November 03, 2020, 09:51:08 AM
Here is the first feedback!

I finally found time to not-read-the-manual, solder the opto on, plug it in, play around and make a video review about it :)

Title: Re: compact midi interrupter
Post by: Acid Byte on November 03, 2020, 05:38:30 PM
very cool!
i really like to support you once you got the industrial fiber boards up and running!
Title: Re: compact midi interrupter
Post by: TMaxElectronics on November 03, 2020, 08:49:12 PM
Thanks for the video Mads, glad you liked it :D
I have some things in the pipeline in terms of sound generation and effects but that is on hold until I finish my coil. Shouldn't be too long now (maybe two-three weeks), then again that is something I have been thinking for months now :P

Quote
i really like to support you once you got the industrial fiber boards up and running!
I'll post an update once the new boards are ready :)
Title: Re: compact midi interrupter
Post by: Max on November 03, 2020, 11:51:43 PM
how unfaiiiir he got his video first  >:(

Just kidding. Thumbs up for the video; it actually gave me a pretty good impression of how to use one. Aaand it reminds me that I should probably get that wiki done soon...

09:04-09:24 is a well deserved compliment for TMaxElectronics work!


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: Mads Barnkob on November 04, 2020, 09:14:49 PM
Thanks for the video Mads, glad you liked it :D
I have some things in the pipeline in terms of sound generation and effects but that is on hold until I finish my coil. Shouldn't be too long now (maybe two-three weeks), then again that is something I have been thinking for months now :P

Looking forward to the updates and maybe the GUI needs some kind of locking for the ADSR controls to avoid MIDI noobs like me just clicking wildly?

how unfaiiiir he got his video first  >:(

Just kidding. Thumbs up for the video; it actually gave me a pretty good impression of how to use one. Aaand it reminds me that I should probably get that wiki done soon...

09:04-09:24 is a well deserved compliment for TMaxElectronics work!


Kind regards,
Max

The syntherrupter has become part of a bigger show controller build. I have however been waiting for deliveries from China because I was a cheap-ass on the USB connectors and some other mechanical parts :o Videos are in the making, but work, family and now also some additional education besides work are taking a good chunk of all the hours not spend sleeping ;)
Title: Re: compact midi interrupter
Post by: Max on November 05, 2020, 12:58:02 AM
Quote
The syntherrupter has become part of a bigger show controller build.
*Pressure to deliver reliable and well-documented firmwares rises*  ::)

Considering the video(s) I want to repeat that I'm really just kidding. I perfectly understand and know how it is to have no time whatsoever or to see projects being delayed because of one delivery.


Kind regards,
Max
Title: Re: compact midi interrupter
Post by: Mads Barnkob on November 11, 2020, 09:35:18 AM
Playing a full MIDI with 3-4 notes at the same time and half-way through it goes from edited length notes to original length. Pure abuse :)

Video posted at: https://highvoltageforum.net/index.php?topic=571.msg9627#msg9627
Title: Re: compact midi interrupter
Post by: TMaxElectronics on November 12, 2020, 01:02:39 AM
Nice video :D I really can't wait to finally play some music on my coil...

Quote
*Keeping my thread at the top*   ;D
guess I can do the same :P So just a quick update:

I ordered a new batch of PCBs from JLC on monday (100 to be exact... because it costs almost the same as buying 20 ;)) and they should be here in a week or so.
I also made two small changes:

(https://i.imgur.com/f03Hn7y.jpg)

The AUX connector is now rotated, so it doesn't hang over the edge anymore, and I have moved the resistors for the opto-transmitters so it is now possible to screw down the IF-E96E‎.
Title: Re: compact midi interrupter
Post by: TMaxElectronics on November 27, 2020, 01:17:40 AM
Another short update :D

I received the new PCBs this week but didn't have much time to actually assemble the boards until now. That will be done tomorrow.
I also recorded some more videos of my large coil playing music this evening (again in my too small basement :P)

Title: Re: compact midi interrupter
Post by: TMaxElectronics on December 09, 2020, 05:03:48 AM
Ok once again my terrible time management strikes... The pcbs and components are still next to me on my desk, not assembled as they were last weekend.
Sorry to keep those that want one waiting.

But there is actually reason for this. I have never been particularly happy with the way the stick handles ADSR, which is very un-versatile and left many things to be desired (at least for me :P).
I also always missed the subtle note modifiers that give a song its character (like tremolo for example), as the sound is quite honestly a little boring without it.

To fix this I have been working on a massive code overhaul for the last few weeks (which I kind of want this to be in the version that I send out to people, hence the once again massive delay).
I am not even done yet and there is maybe 25% of the old code left, of which more will have to go. But the additional features are quite the reward:
...and quite a bit more that I am too lazy to write down, so instead here's a preview of the advanced version of the UI (of course including a bug that I only see now that I have posted this  ::)):
(https://i.imgur.com/DaNhjSW.jpg)

and the mapping options:
(https://i.imgur.com/A4M9q3q.jpg)

I do know though that these features will only be used by maybe 5% of all users, so I again apologize to anybody waiting to get theirs :)
Title: Re: compact midi interrupter
Post by: TMaxElectronics on December 14, 2020, 12:54:52 AM
Some more updates:

I got the VMS to the point where it is more or less done.
A few small things remain, like the live preview and some general useability improvements. I have been playing around with it a little this afternoon and it sound sooo much better that it did before (at least to me :P).

Here's a little preview
Title: Re: compact midi interrupter
Post by: Mads Barnkob on December 16, 2020, 08:42:38 AM
Some very nice updates on your USB MIDI stick!

Turning the AUX connector and moving the resistor a bit a some good fine tuning of the hardware. The resistor was JUST at the edge of my optical output, so it was not in the way, but I did perhaps stress it a bit :)

Seems like a serious code-overhaul, that does tend to delay delivery times a bit, I had commenters on youtube/facebook/contact form ask about where to buy this and I have just pointed them here or your website to contact you.

About your latest demonstration video, I am not quite sure what I am looking at. From your explanation here on the forum it just looked liked a single channel displaying the note peaks of the on-times. But in the youtube description you wrote:
"The different channels here have different settings:
1: Portamento, FM with a sine wave, adsr
2: only adsr
3: inverse exponential adsr"

Could you point out where on the all green oscilloscope those channels are? I guess its 1 at bottom, 2 at top and 3 is the "holes" in the bottom?
Title: Re: compact midi interrupter
Post by: TMaxElectronics on December 16, 2020, 01:36:28 PM
The description text about channels was perhaps a bit confusing, I ment the settings of the Midi channels :D
The scope only has one channel connected, which is the output from the stick.

I am currently working on making some nice presets for the VMS, including a drum map. I'm not 100% happy with the sound of the drums yet though (more experimentation on a real coil is needed :P), so a video will have to wait.
Title: Re: compact midi interrupter
Post by: TMaxElectronics on December 22, 2020, 12:54:10 AM
Big update time (finally :P)!
The software is done and I have assembled new Midisticks.

I am still bug testing the software a little but I'm confident enough to call it V1.0 and pack the sticks tomorrow. I hope that my postal service will take the packages despite the lockdown and it being so close to christmas.
The sticks will come preloaded with a small selection of VMS maps (basically sound "fonts"), that can be expanded by me or others. I might also post a video demonstrating some of the improvements I've made.

A little "artistic" shot of the new PCBs :D
(https://i.imgur.com/1y6gj8H.jpg)
Title: Re: compact midi interrupter
Post by: tophat on January 17, 2021, 05:40:59 PM
Hello!

your board looks very promising, I would love to make one, i was just wondering if i needed to buy a PIC development board to do so? Can i program the chip directly from the completed board or do i have to program it and then solder it on? Thanks so much!
Title: Re: compact midi interrupter
Post by: TMaxElectronics on January 19, 2021, 12:06:44 AM
There are ICSP pads on the PCB. Pin 1 is next to R8 ;)
You'll need a programmer compatible with the pic32mx270f256b, I use both PicKit 3 and PicKit 4.

There is a slight design flaw with the bootloader, when programming with a pickit 3 though:
As the firmware backup mode is activated by pulling a pin on the header low, and the pickits have a default pull-down on that pin, the stick will go into firmware recovery mode, nuke the program flash and wait for code over UART when the programming operation has finished.

I'll fix that in the future, but for now you'll have to disconnect the programmer as soon as the operation has finished (within ~1sec).
Title: Re: compact midi interrupter
Post by: TMaxElectronics on January 22, 2021, 12:41:44 AM
Finally some updates again!

I have been improving VMS a little since the last release and it now supports using scaled midi CC values as parameters, allowing for direct manipulation of VMS parameters from software like FLStudio. A single note event can now also trigger multiple tones, allowing for a much richer sounding note.
Some midisticks also found their way to some people that (other than me) actually have musical talent, so some actually good maps will come out in the not too distant future ;)

One much more important thing however is the fact that I am thinking about releasing it as a full on product, since quite a few people have asked me if I sold them.
Everything will of course remain open source and free to replicate for those inclined to do so ;)
I have already got myself some lead free solder paste and will be designing a little case to go around the stick.
Title: Re: compact midi interrupter
Post by: AeraCura_ on January 22, 2021, 03:39:07 AM
...designing a little case to go around the stick.

I was working on something similar while I wait for my stick to arrive, can't wait!

(https://i.imgur.com/DIP6mrW.png)
Title: Re: compact midi interrupter
Post by: Mads Barnkob on January 23, 2021, 06:39:16 PM
Maybe a custom USB hub with enough distance between ports to allow for the height of the optical transmitter... Maybe there is some crypto-mining hubs from when USB stick miners was a thing that has some extra clearance...
Title: Re: compact midi interrupter
Post by: octopus1 on January 23, 2021, 07:15:46 PM
Once I get mine I’ll try and design a low profile case for 3D printing, it would be difficult to design a case that works for both types of fiber optic transmitters though. It would be cool to make it look like any other usb stick!
Title: Re: compact midi interrupter
Post by: TMaxElectronics on January 24, 2021, 12:57:53 PM
Awesome ideas :)
I have started working on a small case which would allow them to fit side by side back when I started the project, but never finished it.

The width of the stick should be small enough to fit side by side on most usb hubs, so a case that gets glued on from the top and bottom would solve the issue, but that would then mean gluing something on which I usually try to avoid.
I haven't really looked into printing clips like those used in cheap enclosures, but since they seem to be maybe a few mm wide, they might still fit.
But the biggest issue I guess will be keeping the pins, and aux connector accessible.

Looking forward to more ideas :D
Title: Re: compact midi interrupter
Post by: TMaxElectronics on January 27, 2021, 12:22:10 AM
Just another small update:

I have gotten some of the old openmoko usb pids, so the thing is now properly usb compatible (though I think I have to pay fees if I actually want to be allowed to put the logo on).
Apart from that I have also been continuously working on bugfixes with VMS, but don't really get to release anything because I have found another bug to fix by the time I have drafted the release text :P

There are now also more circ parameters that can be used for circular modulation curves (no low pass on that yet though) and the drum map is taking shape; the effects of non-acoustic percussion instruments, that can be modeled with white noise are pretty much perfect and the drums are starting to sound decent as well with the help of multiple voices per effect. Bummer that I can only test my coil in my basement right now :P
Title: Re: compact midi interrupter
Post by: octopus1 on February 02, 2021, 05:09:49 PM
Hello all!

I just received my midi stick in the mail and wanted to give it a quick test. I have it all setup and the blue signal light lights up for each note played but I am not getting any output on the transmitter LED. I tested the E96E transmitter before hand and it worked fine. I also removed the HFBR Resistor as I thought this might have been the problem. Any bell would be much appreciated, from what I can tell so far this is a amazing little stick!
Title: Re: compact midi interrupter
Post by: TMaxElectronics on February 02, 2021, 06:25:00 PM
Did you follow the quick start guide and create&select the configuration for your coil?
Without that it won't do anything to prevent damaging the coil it is connected to :D
Title: Re: compact midi interrupter
Post by: octopus1 on February 02, 2021, 06:42:36 PM
I have it set to the default setting for the coil (100us max on time, 10% duty cycle, 30us note hold off) and LED3 which I have set to output on blinks blue with notes but still no output on the transmitter. For E96E types the LED Connects to the middle top pins right?
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on March 19, 2021, 08:31:40 PM
just a little bit of an update:

I added some more features to the VMS and it can now play multiple notes from a single note on even, which can make it sound like a classic 80s synth, and did some more bug-fixing too. I also recorded some little tutorial videos on how to get started with the MidiStick and how to get the best sound of it, which I'll post on youtube in the Coming days. I think I'll make them unlisted though since they aren't of any importance to my normal audience so I'll just embed them in the github wiki page.

I still can't go to the HV lab and running the coil in the basement is not an option either since the place I made the other videos has now returned to being the paper waste storage which I'd rather not light on fire if I'm honest :P
But I made a post on my website that has a bunch of captured audio examples on it. Not with a coil but just recording the output from the interrupter directly: https://tmax-electronics.de/projects/midistick-news/midistick-audio-only-demos/ (https://tmax-electronics.de/projects/midistick-news/midistick-audio-only-demos/)

Oh and probably the biggest news: I finally got around to opening a shop on my website so if you want a MidiStick you can now buy one directly :) https://tmax-electronics.de/product/midistick-v1-2/ (https://tmax-electronics.de/product/midistick-v1-2/)
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on April 20, 2021, 04:53:09 AM
Finally some updates again :D

I released V1.2 of the firmware and the configurator: https://github.com/TMaxElectronics/MidiStick_Firmware/releases/tag/V1.2
The changelog is over there for those interested.

I am also starting to get the VMS maps dialed in to where they sound really good, so I recommend giving the new one a try (it even uses some new features :D)

There are however also bad news... As you might recall octopus had issues with his midistick a long time ago and unfortunately they haven't all been solved. The reason seems to be some incompatibility between the USB library I use and macOS. LibUSB had some issues a while back that were fixed recently, but unfortunately it looks like the development of the java port ended in 2018.
Now that the new release is out I have started experimenting with different libraries and will eventually port over the entire configurator to the most promising one I find.
until then there is no support for using the midistick on macOS

As a side note:
does anybody know how the copyright system deals with midi files? I've seen Max talk about putting up some example files (or actually doing that? not sure at the moment...) and was thinking about doing the same.
Nothing especially prepared but just a few of the midis I use for testing and that I know work well.
Is it even legal to share those on forums or github?
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: Mads Barnkob on April 21, 2021, 08:15:13 PM
I guess its very grey zone, some forums posts suggests that its running wild because no publishers are involved with MIDI files, only the artists directly. So there is no money force behind chasing down a market with almost zero market value...

The long answer: http://www.higgs.com/archive/articles/keyboard/june-1993/
Title: Re: MidiStick Polyphonic USB Interrupter
Post by: TMaxElectronics on April 23, 2021, 06:51:25 PM
Hmm interesting reason for nobody caring about the files being shared...
But I guess since others are doing it here too I'll just upload some demo files once I get around to it.

Oh and I finally got around to adding a "normal" interrupter mode and a live performance window:
(https://i.imgur.com/YzR4N0e.png)

The transient mode allows for playing single tones and also has a burst mode.
The idea behind the show control window is to always have a window on hand that has an E-Stop and (when midi mode is selected) faders for the master and individual coil volume to allow for better adjustability while a file is playing. At the moment it isn't possible to adjust the volume of a track that is playing on two coils for each coil separately, with any power differences between the coils only being scaled out by the maximum OT of that coil. Having a fader for each individual coil could allow for quick adjustment of any mismatches.
I should have this update out in a week or so

Also if you have a stick and had time to test the latest update I'd love to see some videos of it :)
It looks like its a long time until I get the chance to run my coil again or build a smaller one.
Title: Re: MidiStick Polyphonic USB Midi & SID Interrupter
Post by: TMaxElectronics on April 28, 2021, 08:10:52 AM
And now there are even more upcoming features and this one is a big one I think ;)
I added the ability to act as a NetSID server and play .sid files (the Commodore 64 sound files) through an external player like Acid64.
The songs in those files are made to sound good on only three voices and hence are suited to playing through a tesla coil a whole lot more than most midi files are (at least without any modifications).

Here is a short demo... just so annoying that I still can't get to the lab and play it on a real coil:
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on May 02, 2021, 11:32:39 PM
There are even more big changes coming :)

I finally managed to get the usb for macOS working again, so the next version will work on that again (finally :-[).
I also added master volume controls to the midi and sid show modes, so it's easier to reduce the volume while a track is playing. That way it feels less like driving without a steering wheel (or would it be the brake?) in those modes :P

The show control window can also stay on top of other windows so the volume slider is always in reach if things go south :D
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: Mads Barnkob on May 03, 2021, 08:16:19 AM
Great updates and exciting new features. The SID implementation sounds really cool, I am looking forward to hear that endless pitchbend on a Tesla coil, will it produce it faithfully?
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on May 03, 2021, 12:43:48 PM
Quote
will it produce it faithfully?

Absolutely :D
The video's audio is recorded straight from the output of a stick and these sort of effects sound great on coils too.
The video I uploaded on new year's day this year is SID instead of midi too (but with the UD3's built in synth), thats sounds great in my opinion :):
Title: Re: MidiStick Polyphonic USB MIDI & SID Interrupter
Post by: TMaxElectronics on May 05, 2021, 10:30:49 PM
Ok this entire not having a coil that I could run thing was starting to get on my nerves... so I decided to use my big bridge with my old (small) secondary coil and FINALLY get some demo videos.

Monty on the run and popcorn 101 is played in SID mode, the other two are midis:
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on May 07, 2021, 11:08:04 PM
I have one more, this time actually recorded with a proper camera and microphone (even with shielding :P)
This time its all old chiptunes played in SID mode. Sound pretty cool imo 8):

At 400us on time even the bassy notes come through well :D
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: Uspring on May 11, 2021, 12:24:44 PM
A very impressive accomplishment! It's been a long way from the pong game arcade style music.
So when will you implement Dolby surround?  ;)
Title: Re: MidiStick Polyphonic USB Midi Interrupter
Post by: TMaxElectronics on May 11, 2021, 05:57:13 PM
Thanks :)

Quote
So when will you implement Dolby surround?
Well there is stereo position mapping of coils :P

And on a side note: There are even more added features in the next release now.
With some low level uC magic I got the voices producing two pulses each. Both at the same frequency, but with a phase setting that can be used to create effects like a phaser.
It sound absolutely awesome through speakers, but I haven't tested it on a coil yet since I had to free up the basement again for now :D

I know that I said I'd have the version ready by last week, but I'll stop adding new stuff to it now and just focus on getting the update with the SID and TR mode out.
If I don't discover any terrible bugs I should have it ready... soon ::)
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on May 15, 2021, 08:51:28 PM
So after much more time than I initially though I finally got around to finishing this version. And since there are so many more features it it I decided to call it V2.0 :D
I already have some more things planned but since I have some exams coming up they will have to wait a little longer again I'm afraid.

But I also finally made the how to video :) :
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on July 10, 2021, 03:04:52 AM
Finally had some more time to play with the interrupter. No new code (though I do have some things planned as always ::)), but I decided to test how the phaser effect I added in the last release sounds on a coil. And well, what can I say other than I think it sounds amazing :P

Here's a short demo video:

I played the lower two tracks with the phaser effect. Since it effectively doubles the OT of notes (by playing two pulses instead of one) it makes the low notes very pronounced. So unlike what TCs usually sound like :)

It might be that it is just a sort of equalizing effect that offsets the tendency of lower notes to be quieter though. I've been planning to add correction for this pretty much since I started the project, but I (still :P) haven't decided which way is best, since dutycycle chances change how things sound significantly. So maybe just play with a constant duty cycle...? Or just add a volume curve that kind of compensates but only a bit to make it less obvious? IDK I'd have to give this some more thought. The max OT idea from Max's code didn't quite sound the way I like when I gave it a try (but that might be my lazy implementation lol).
I can actually add a volume curve in VMS so maybe I'll play around with that first. Final goal of course would be current modulation, but that will have to wait until I finally port VMS to the UD3 :P
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on December 04, 2021, 11:02:35 PM
Oh hey, finally some updates again. Sorry about the project seeming a little dead over the past few months, uni has just been taking up all of my time so not much was left for hobbies in general. But I did finally experiment with some more features again.

One thing that always annoyed me was how the sound wasn't very dynamic when the duty limiter was active. When the dutycycle exceeded the maximum by a lot, any volume effects would be effectively worthless, as any changes would be removed as the limiter increased its own gain to get back to the maximum duty cycle. That pretty much killed all adsr effects in some songs, especially when using hypervoice which doubles the amount of pulses the stick generates, increasing the duty cycle further even with low on times. To fix this I'm working on a new duty limiter that works more like an audio compressor. Instead of having a hard limit on the maximum duty cycle, and only doing anything above that, it adds what is effectively a low pass filter to the gain register. That filter has adjustable attack and decay rates, as well as an adjustable release delay. If adjusted properly, the limiter will reduce the overall volume of a passage that has too high of a duty cycle, without affecting the relative volumes of the loud vs quiet parts. I am thinking if it might even be a reasonable approach to allow a duty cycle significantly higher than the maximum for a short time, so short and loud notes won't cause unwanted dips in the volume.
Any thoughts on how smaller coils might behave in a situation where they suddenly play twice the calculated maximum duty cycle for half a second or so?

Then I fixed a bug in the firmware that resulted in a lot of dropped midi events when playing with ardour5 on linux. Interestingly enough the midi drivers there don't seem to care much for the standard which indicates that every USB packet can have a maximum of one midi message and instead package multiple messages into every packet. They Somehow also ignore the message length and pad messages with less than 4 bytes with zeros. The stick now checks for that and will execute every midi command that is sent in a packet instead of just the first.

Oh and I also found a space to record a few videos with my large coil again. They only have a 3ph 16A outlet with fuses I can't replace though, so I didn't push it too far. Anyhow, here's how it turned out :) Both songs are SIDs:

The comic bakery theme is my absolute favourite chiptunes by the way ;)


Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: dbach on December 05, 2021, 12:20:13 AM
Awesome I’m glad to see this project is still active! I was messing around with a smaller coil today and was having some trouble playing songs, it seems that higher frequency notes got decreased in volume to the point where they were nearly 1/10th of the lower notes? Is this something silly that I’m missing in software? Thanks so much and I’m excited to see how this stick will develop even more in the future!

Thanks so much, Davis.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on December 06, 2021, 03:32:15 PM
That depends heavily on the settings of the duty limiter, the on time and your coil. If the limiter is set quite low, high notes will play with a very short on-time, and if your coil (I'm assuming DRSSTC?) has a high primary circuit impedance the primary current just won't get high enough to create an arc in that time. I've been thinking about adding compensation for slow current gain into the duty limiter, but decided not to since it can be compensated for by allowing for a higher duty cycle.
I suggest you check the coil config for allowable on-time and dutycycle.

There is of course also the chance that the music you are trying to play has a lower volume on those high notes, to go around that you can try using vmpk and setting the volume to maximum. And then there is of course the chance that the song you are playing uses a midi program that has a fast decay rate (the "Bells" one for example has that).
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: dbach on December 06, 2021, 11:51:07 PM
Ah that makes complete sense, this is running on my QCW prototype so the primary circuit has quite high impedance. Thanks for the help and sorry I didn’t think of that!
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on March 26, 2022, 11:16:21 PM
Whoo finally some updates again :D

I have finally added the smarter duty limiter algorithm that doesn't remove sound dynamics to a point im ready to release it. I've settled on having an option to temporarily allow more than the maximum dutycycle until the smart limiter kicked in, but that is disabled by default.  I'll make a vid explaining how to use this feature and what exactly it does once I have my coil set up for testing again :)

I also added usb audio to the interface. That now allows you to listen to the output on your pc without needing an external cable (for preview/testing). The interface also has a usb audio input, which I think i might use for a zero-crossing detector style audio converter (Something that a few people have already used to play their coil with non-midi instruments before). Then you could just plug your guitar or whatever into the pc and play (SIMPLE) songs/solos live. But since I know the limitations of this sort of audio interrupter i'm not sure if it wouldn't leave more people dissapointed when they inevitably tried playing a song from spotify with it or whatever. I'll have to do some furtehr experimentation with this :)

And finally I also added some more features to the SID playback. One is the option to read data from an external interface, such as the one i made which actually plugs into the c64 itself so you can play live c64 audio on your coil 8)
And the other option was always kind of there but hidden as an advanced option: hypervoice. That makes the stick emulate the pulsewidth register of the sid chip with the phaser sound effect. I've been using it for long enough now to have full confidence in it and will make it a normal (not hidden ;)) option in the next release too.
Oh and i added a register explorer which allows you to see the SID register in real time and get flashy lights when they get changed because why not :)

Not sure if I'll implement anything else until I release this version but if I do ill make another post about it. And I'll make a proper changelog and explanation video of the new features aswell :)
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on August 06, 2022, 04:06:48 PM
Finally had a location that would allow me to really turn up the volume, and made a little demo compilation. All played with the midistick. The reverb is from the room itself, not an audio effect ;)

Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: AstRii on August 06, 2022, 07:05:35 PM
Very nice run, the reverb from the room is epic, it makes it sound less square-waveish and more sinusoidial, especially the bass. You have found the perfect room for this :D
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: davekni on August 06, 2022, 09:34:35 PM
Great sound and nicely produced video too!  I like the chapter breaks and subtitles.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on August 08, 2022, 09:42:37 PM
Quote
...it makes it sound less square-waveish and more sinusoidial, especially the bass.
I think its the room improving things as much as the phaser in the midistick is. Instead of the normal one pulse per note I trigger two, while slowly increasing the phase angle of the second pulse. That gives it that brrooooaaaat sound if you know what I mean :P
Thats also what gives some of the lead melody the smoother sound; there I sine modulate the phase at a few hertz which makes it sound like an 80's synth.

It sounds almost as good outdoors ^^

If you guys are interested in what exactly the effects do I'd be happy to make a explainer video with scope traces. But I suspect only few would actually want watch it ;)

Quote
Great sound and nicely produced video too!  I like the chapter breaks and subtitles.
Thanks :D
I think only very few people would actually watch the entire video non stop, and most will instead just skip around. And the chapters make that a lot easier.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: davekni on August 09, 2022, 06:08:53 AM
Quote
If you guys are interested in what exactly the effects do I'd be happy to make a explainer video with scope traces.
Don't know that a video is needed, but I do have a few questions:

Quote
Instead of the normal one pulse per note I trigger two, while slowly increasing the phase angle of the second pulse.
By "phase angle", do you mean the spacing between the two pulses as a fraction of the note period (1/note frequency)?  Presuming so, roughly what is the range (starting and ending separation)?

Are all notes double-pulsed as above, or only melody?

Quote
Thats also what gives some of the lead melody the smoother sound; there I sine modulate the phase at a few hertz which makes it sound like an 80's synth.
Roughly what is the amplitude and offset of this "few hertz" modulation?  In other words, what is the minimum and maximum pulse spacing (as a fraction of note period presuming that's what phase means)?

Finally, not directly about this post, what does your algorithm do with overlapping pulses from different notes?

Thank you in advance for the info!
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on September 19, 2022, 11:43:47 PM
Whooo finally some news again! It's been a while but it is quite big news.

The new software features I've been promising for months now are finally in the testing and verification stage. One issue that has already popped up with the real time audio is a very noticeable delay when using windows 11. That makes any instrument really weird to play, so I'm still working on a fix for that.

But the real big new is a new Hardware revision thats in the works. Well two different versions to be specific. I've started cooperating with HiLabs (some actual musicians :D) by supplying midisticks for their shows and been getting some usablility as well as feature feedback. The biggest issue (predictably :P) is ruggedness of the bare PCB. So after some back and forth I decided to move the midistick away from a USB stick format towards a more rugged (though a little bit bigger) converter box style. The new version will be completely enclosed in an aluminium extrusion, making it about as rugged as it can be. It will likely also get a usb c port instead of the ugly usb type b :D

(https://i.imgur.com/PkBIXOp.png)

It will no longer be a midiSTICK but I think I'll still keep the name :D
The functionality will be all the same.

The second version I've started work on will be a version with more channels. For now I'm only planning two but with the cheapness of the effinix FPGAs the sky is the limit when it comes to outputs. That version will have a few more benefits, such as

And finally as a bit of a roadmap I also have some more software improvements in the works
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: nzoomed on January 06, 2023, 10:50:17 PM
Wow this looks like an awesome MIDI controller.
I definitely will be buying one, since there is alot on this thread for me to go through, I have a some questions.
Since this can 2 4 voice polyphony, are there any limitations or compatibility issues with different drivers? I always thought the polyphony was limited to 2 notes at once on the coil driver itself.
I have steve wards universal driver on my coil, like most here likely use too.
Does this mean that if i want to play more notes at once, I could have 2 channels playing 2 notes at once on a single coil for example?
Regarding multiple coils, I want to operate 2 coils eventually, I take it I need to run 2 controllers in tandem?
My existing MIDI interrupter can have a second ST connector installed for a second coil and you assign the midi channels via a DIP switch, Im assuming everything is done via the software with this controller and you assign the USB stick per coil, im assuming that the MIDI files will also have to go through this software provided also?

Regarding SID playback, can this literally play any C64 SID file i can get my hands on?
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on January 19, 2023, 11:39:37 PM
Oh hey completely missed the comment, sorry about that :)

Nice to hear you like this project. The polyphony is entirely included in the midistick itself, it just sends the resulting on/off data to the coil. As long as it has an optical interrupter input it should be compatible :)
Keep in mind, that many notes on at the same time will sound best with a large maximum duty-cycle (I have mine set between 15-20%). If you reduce the limiter threshold (because your coil can't handle that high of a duty cycle) the coil will sound slightly worse.

Yes, if you want to you can have any number of channels playing notes, up to four different ones at the same time with any combination of channels. If a note on event occurs when the four voices are already playing a sound the least important note will be turned off again and replaced with the new one.

For multiple coils at the same time you'll need one midistick per coil. I am currently developing the my next generation of interrupters, which will also have a version capable of sending data to up to four coils though (that will prob be released q3-q4).
Mapping sounds to the coils is quite a bit than dip-switches though: you just use the midi pan knob to fade between the coils :D As if one was the left speaker and the other was the right one. You'll need to set that up in the software first, but then it can work on its own.

And yeah you can play pretty much all sid files out there ;)
One exception though: some files use a hack to send audio samples through the SID chip, I don't support that yet. If a file has some sound effect that is just missing when you listen to it on a coil it is likely that it comes from samples.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: nzoomed on January 25, 2023, 08:27:01 AM
Oh hey completely missed the comment, sorry about that :)

Nice to hear you like this project. The polyphony is entirely included in the midistick itself, it just sends the resulting on/off data to the coil. As long as it has an optical interrupter input it should be compatible :)
Keep in mind, that many notes on at the same time will sound best with a large maximum duty-cycle (I have mine set between 15-20%). If you reduce the limiter threshold (because your coil can't handle that high of a duty cycle) the coil will sound slightly worse.

Yes, if you want to you can have any number of channels playing notes, up to four different ones at the same time with any combination of channels. If a note on event occurs when the four voices are already playing a sound the least important note will be turned off again and replaced with the new one.

For multiple coils at the same time you'll need one midistick per coil. I am currently developing the my next generation of interrupters, which will also have a version capable of sending data to up to four coils though (that will prob be released q3-q4).
Mapping sounds to the coils is quite a bit than dip-switches though: you just use the midi pan knob to fade between the coils :D As if one was the left speaker and the other was the right one. You'll need to set that up in the software first, but then it can work on its own.

And yeah you can play pretty much all sid files out there ;)
One exception though: some files use a hack to send audio samples through the SID chip, I don't support that yet. If a file has some sound effect that is just missing when you listen to it on a coil it is likely that it comes from samples.
Thats awesome, this should make it possible to play more MIDI files without anywhere near as much tweaking!
I always thought it was the limitation of the tesla coil itself with the number of notes. I probably am going to end up with a second larger coil soon anyway, so I could direct the bass track to the larger coil and send the main track to my current coil im using.
Definitely will be ordering one of these! SID music sounds like alot of fun and is well suited to tesla coils, the tune to the last ninja would sound incredible.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on January 30, 2023, 01:01:56 AM
Quote
Thats awesome, this should make it possible to play more MIDI files without anywhere near as much tweaking!

That was my goal since the start of the project ^^

I'll also just give a short project, since I haven't done one in a while. The Software updates I've been talking about have started running into issues with the crappy way in which I've written my code in the beginning (and kinda kept on doing even until recently :/). Weird circular dependencies, twirled spaghetti code (so spaghetti code going back and forth between .c files), extremely tight hardware dependence, time synchronous calculations... soooo much stuff that made me unhappy everytime I had to touch the code.

Because of this I have decided to completely re-write the software from scratch ::)

This time however I'm actually putting in extra effort to make the code as universal, portable and modular as possible (and also easy to port!). I already have the base framework done (RTOS, config saving, signal generation, communication...) and have partially ported the modulation engine (though that will undergo some more significant changes before release too). And there are some new features finding their way in already (like a full graphic equalizer :D). The MidiBox (the new midistick :D) is also ready for its first beta hardware release, with addressable RGB LEDs, USB C and an enclosure ;D

But the software will of course also be released for the current hardware, which I will support for as long as I support the MidiBox version :)
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: nzoomed on January 31, 2023, 02:25:40 AM
Quote
Thats awesome, this should make it possible to play more MIDI files without anywhere near as much tweaking!

That was my goal since the start of the project ^^

I'll also just give a short project, since I haven't done one in a while. The Software updates I've been talking about have started running into issues with the crappy way in which I've written my code in the beginning (and kinda kept on doing even until recently :/). Weird circular dependencies, twirled spaghetti code (so spaghetti code going back and forth between .c files), extremely tight hardware dependence, time synchronous calculations... soooo much stuff that made me unhappy everytime I had to touch the code.

Because of this I have decided to completely re-write the software from scratch ::)

This time however I'm actually putting in extra effort to make the code as universal, portable and modular as possible (and also easy to port!). I already have the base framework done (RTOS, config saving, signal generation, communication...) and have partially ported the modulation engine (though that will undergo some more significant changes before release too). And there are some new features finding their way in already (like a full graphic equalizer :D). The MidiBox (the new midistick :D) is also ready for its first beta hardware release, with addressable RGB LEDs, USB C and an enclosure ;D

But the software will of course also be released for the current hardware, which I will support for as long as I support the MidiBox version :)
Thats great to hear.
Im also hoping it will resolve the issues im having with my USB MIDI cable, the RF from the coil is interfering with it and causing it to freeze on a note if the power is too high.
Ive tried wrapping the whole thing in tin foil and adding toroids on the USB cable, but it only helps a little.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on June 04, 2023, 04:17:14 PM
Yaay project update time again (finally) :D

I've had the beta version of the midibox hardware here for almost half a year now but just didn't get around to working on the software a lot until recently. I'm still in the "get the new software to work as well as the old one" phase of the project, but that has come a whole lot closer to completetion. I currently only implemented midi mode, but the others are soon to come aswell.

Right now I'm considering if I should do a small beta hardware production run and distribute that to people who want to test the new version and give me feedback on the changes I made, but that needs at least one more hardware revision.

Here's a picture of the hardware (with the IF-E96 transmitter in this case, but HFBR is of course also still supported :) ):


The use of a USB-C port actually had a funny side effect... you can now very easily use your phone/tablet as the signal source :D There are some pretty cool midi apps (at least for android) that I would love to try on a coil.

One of the major improvements that I did with the new software is to move away from a one timer per voice setup. In the midistick every voice is running on its own Timer to generate the pulses, which takes up all of the hardware i have available, leaving nothing for other ideas.
But the new software only needs two for each output, pre-calculates the delay from one pulse to the next in software and then writes that delay into the timer after the current pulse was triggered. I initially only planned to use this to free up hardware timers, but am now considering moving to more voices too.
I've been running all my tests with a voice count of 6 and am pretty happy, although it does sound a bit too chaotic at times. Especially since Hypervoice turns that into effectively 12 Voices if active on every channel :D

More updates are sure to come soon(ish :P)
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: Benjamin Lockhart on June 06, 2023, 07:05:39 AM
What is hypervoice?
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on June 06, 2023, 11:16:55 AM
Hypervoice is a feature that I added to the Midistick quite a while ago. It adds a second pulse with adjustable phase to each note. So for example at a phase of 90° you would get a second pulse after one quarter of the period of the note expired. That effect adds much more depth to the sound, and also allows for more expressiveness. Especially when you add modulation to that phase in VMS it starts sounding really good :D

The current Firmware has the feature sort of hidden away a bit, because I wasn't 100% confident in it when I released it. It is however used in some of the example vms maps and you can enable it for sid playback (there the phase is adjusted based on the pulse width register) by enabling the experimental features in the show mode window:
 [ Invalid Attachment ]

Keep in mind that for some songs that will reduce the audio quality instead of increasing it. When a high note is playing using the effect the overall volume drops down pretty far and you don't really hear the other tracks too much anymore. That is mitigated by the volume scaling feature in the new software I'm working on, but for the moment you can't really do much other than disabling hypervoice again.
Title: Re: compact midi interrupter
Post by: BlackX on August 19, 2023, 08:03:50 AM
...designing a little case to go around the stick.

I was working on something similar while I wait for my stick to arrive, can't wait!

(https://i.imgur.com/DIP6mrW.png)

Do you have a CAD file for this?

THX Toni
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: Benjamin Lockhart on August 28, 2023, 06:07:17 AM
I can't seem to get hyper voice to work. I enable like you've shown, but nothing changes,
and after closing show mode and reopening it, the "show experimental features" box is un-selected again.
Any ideas what's going on?
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: TMaxElectronics on August 31, 2023, 09:03:45 PM
The box unselecting itself is intentional,. But what exactly do you mean with "nothing changes"? The effect depends on the SID you are trying to play, some don't actually use the effect at all. It could also depend on the settings you have selected for your coil (ontime, dutycycle etc.). The setting also doesn't exist in midi mode, as hypervoice is controlled by VMS there.
Title: Re: MidiStick V2.0: Next gen tesla coil interrupter
Post by: Benjamin Lockhart on September 01, 2023, 03:49:23 AM
Ok, I see. I was trying to use it for midi mode.
Some sort of tutorial on how to create VMS maps would be really nice, unless you're planning to change how it works with the new version.
SimplePortal 2.3.6 © 2008-2014, SimplePortal