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
SimplePortal 2.3.6 © 2008-2014, SimplePortal