Author Topic: Playing MIDI  (Read 1042 times)

Offline AstRii

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
  • Czech Technical University in Prague
    • View Profile
Playing MIDI
« on: December 31, 2019, 02:22:34 PM »
Hello,
I'm currently building my first DRSSTC and there are only few things remaining. And the thing i'm struggling with is the interrupter. I wonder how do you guys play MIDI files? I've seen interrupters which decode MIDI files in real time and create appropriate fixed on time square wave. Since now i've been using Arduino UNO as an Interrupter and the way i'm recreating songs on my DRSSTC is i think rather silly and inefficient. I'm using software AnthemScore to get all the notes from a song and then i manually write them into a text file (it's frequency and duration) which i'm then capable of playing. It takes me hours to recreate a single song. So i wonder, how do you play MIDI files on your DRSSTCs?
Thank you and happy new year!!:)
« Last Edit: December 31, 2019, 02:31:37 PM by AstRii »

Offline davekni

  • High Voltage Engineer
  • ****
  • Posts: 465
  • Karma: +26/-0
  • Physicist, engineer (electronic), and hobbiest
    • View Profile
Re: Playing MIDI
« Reply #1 on: December 31, 2019, 08:31:32 PM »
Others will reply with what's common - I think USB-to-MIDI, then to a real-time MIDI interrupter.

I'm working on a different path, learning the MIDI file format and writing an interpreter.  All the note frequency and timing is in the file, along with other things that can be ignored (skipped over).  I'll then convert the notes into an interrupter pulse waveform in MP3 format, record on a small MP3 player, and play it during performance.  This latter part is already running with a kludge input portion.

BTW, my existing kludge is to edit a MIDI file down to just melody (single note at a time), play it with a sine-wave synthesizer voice, record as .wav file, run custom code to detect rising zero-crossings and convert to pulses, then record as MP3.
David Knierim

Offline AstRii

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
  • Czech Technical University in Prague
    • View Profile
Re: Playing MIDI
« Reply #2 on: January 01, 2020, 03:00:31 PM »
The real time MIDI to square wave interrupter is what i'm interested in. How is that achieved? Decoding the MIDI with python/C or something? Or is it just some hardware stuff?

Offline futurist

  • Global Moderator
  • High Voltage Technician
  • *****
  • Posts: 147
  • Karma: +3/-0
    • View Profile
Re: Playing MIDI
« Reply #3 on: January 01, 2020, 04:55:32 PM »
You can download onetesla interrupter code from their website and use it with arduino uno/nano. MIDI to USB adapter isn't needed, if you adjust baud rate internal arduino ftdi chip can be used
http://onetesla.com/oneTesla_interrupter_firmware.zip

Try searching the forum, many people me including use this interrupter


Offline AstRii

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
  • Czech Technical University in Prague
    • View Profile
Re: Playing MIDI
« Reply #4 on: January 01, 2020, 05:16:53 PM »
Is there any documentation for this code? My coding skills aren't any high level, so i don't fully understand the code and how to use it. Do i only need arduino for this? How do i send the MIDI data to the arduino? How do i change maximum on time? Which arduino pin is outputting the square wave to drive the optical transmitter? Sorry for those dumb questions:D
« Last Edit: January 01, 2020, 07:18:04 PM by AstRii »

Offline Mads Barnkob

  • Administrator
  • High Voltage Expert
  • *****
  • Posts: 1457
  • Karma: +24/-0
  • Denmark
    • View Profile
    • Kaizer Power Electronics
Re: Playing MIDI
« Reply #5 on: January 01, 2020, 08:02:42 PM »
I use a laptop with some kind of MIDI editor, doesn't matter which.

I got a collection of MIDI files edited to suit being played on a DRSSTC, you can find some here: https://highvoltageforum.net/index.php?topic=118.0

I use a cheap USB-MIDI interface from ebay to connect laptop to MIDI interrupter.

I gave up on spending time making my own interrupter, so I bought one from Loneoceans: https://www.loneoceans.com/labs/sales/midi2/ There is also a very good description on how it works.
http://www.kaizerpowerelectronics.dk - Tesla coils, high voltage, pulse power, audio and general electronics
https://www.youtube.com/KaizerPowerElectronicsDk60/join - Please consider supporting the forum, websites and youtube channel!

Offline futurist

  • Global Moderator
  • High Voltage Technician
  • *****
  • Posts: 147
  • Karma: +3/-0
    • View Profile
Re: Playing MIDI
« Reply #6 on: January 02, 2020, 12:22:32 AM »
Is there any documentation for this code? My coding skills aren't any high level, so i don't fully understand the code and how to use it. Do i only need arduino for this? How do i send the MIDI data to the arduino? How do i change maximum on time? Which arduino pin is outputting the square wave to drive the optical transmitter? Sorry for those dumb questions:D

It's actually very simple

You need to adjust baud rate to 38400 in midi.h line 56
on-time can be adjusted by changing LOOKUP_TABLE_SCALE prescaler in constants.h line 14, this is multiplied by on_times array, so for LOOKUP_TABLE_SCALE = 3, max. on-time would be 99 us

Pins, from schematics http://onetesla.com/media/wysiwyg/onetesla_interrupter_schematic.png

frequency pot is ADC0
on-time pot is ADC1
fixed/midi mode pin is digital 1
output pin is digital 0

On windows use this as Midi-serial converter - remember to set baud to 38400
http://projectgus.github.io/hairless-midiserial/

and this for the loopback interface
http://www.tobias-erichsen.de/software/loopmidi.html

loneoceans interrupter are actually two onetesla interrupters programmed to listen to different midi channel, but making your own is a lot more fun, and you learn something :D

Offline AstRii

  • High Voltage Enthusiast
  • *
  • Posts: 33
  • Karma: +0/-0
  • Czech Technical University in Prague
    • View Profile
Re: Playing MIDI
« Reply #7 on: January 02, 2020, 03:18:29 AM »
Ok thank you, that sounds pretty straight-forward. Though is there a need for the optocoupler between MIDI pin 4 and Arduino RX? What is it's purpose?

Offline Mads Barnkob

  • Administrator
  • High Voltage Expert
  • *****
  • Posts: 1457
  • Karma: +24/-0
  • Denmark
    • View Profile
    • Kaizer Power Electronics
Re: Playing MIDI
« Reply #8 on: January 02, 2020, 09:27:45 AM »
Ok thank you, that sounds pretty straight-forward. Though is there a need for the optocoupler between MIDI pin 4 and Arduino RX? What is it's purpose?

There is a lot of EMI around a Tesla coil. The MIDI and USB interfaces are easily disturbed by this and all the cables running back and forth are good at picking up some noise aswell. It is always a good idea to add isolation between interfaces when we deal with Tesla coils :)
http://www.kaizerpowerelectronics.dk - Tesla coils, high voltage, pulse power, audio and general electronics
https://www.youtube.com/KaizerPowerElectronicsDk60/join - Please consider supporting the forum, websites and youtube channel!

Offline futurist

  • Global Moderator
  • High Voltage Technician
  • *****
  • Posts: 147
  • Karma: +3/-0
    • View Profile
Re: Playing MIDI
« Reply #9 on: January 02, 2020, 11:01:33 AM »
In your case you won't need optocoupler because you won't use USB to MIDI adapter but internal USB to serial converter used for programming arduino

High Voltage Forum

Re: Playing MIDI
« Reply #9 on: January 02, 2020, 11:01:33 AM »

 


* Recent Topics and Posts

post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Steve Ward
August 08, 2020, 10:22:04 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
T3sl4co1l
August 08, 2020, 03:36:40 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
acmq
August 08, 2020, 02:07:52 AM
post Re: LSI Nitrogen Laser tear-down and Homemade TEA Nitrogen and Dye Lasers
[Light, Lasers and Optics]
LesWright
August 06, 2020, 10:20:12 PM
post Re: LSI Nitrogen Laser tear-down and Homemade TEA Nitrogen and Dye Lasers
[Light, Lasers and Optics]
Weston
August 06, 2020, 08:45:59 PM
post Re: Cathodes in Compact Fluorescent Lamps
[Light, Lasers and Optics]
klugesmith
August 06, 2020, 05:41:04 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Jun
August 06, 2020, 03:53:58 PM
post LSI Nitrogen Laser tear-down and Homemade TEA Nitrogen and Dye Lasers
[Light, Lasers and Optics]
LesWright
August 06, 2020, 03:28:14 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
AstRii
August 06, 2020, 12:59:03 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Mads Barnkob
August 06, 2020, 10:51:43 AM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
UB_Serpent
August 06, 2020, 08:40:57 AM
post Re: compact midi interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
TMaxElectronics
August 06, 2020, 03:22:38 AM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
davekni
August 05, 2020, 11:48:55 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
davekni
August 05, 2020, 11:37:13 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
AstRii
August 05, 2020, 08:01:11 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Lightning On Demand
August 05, 2020, 06:34:08 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
Uspring
August 05, 2020, 12:56:32 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Mads Barnkob
August 05, 2020, 12:55:52 PM
post Re: Bipolar high voltage multiplier project - more than 70cm hot arc discharge
[Voltage Multipliers]
Teravolt
August 04, 2020, 09:21:09 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
johnf
August 04, 2020, 09:16:55 PM
post Re: Does anyone know how this site works.
[General Chat]
thedoc298
August 04, 2020, 05:53:03 PM
post Re: Does anyone know how this site works.
[General Chat]
thedoc298
August 04, 2020, 05:51:03 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Lightning On Demand
August 04, 2020, 05:17:26 PM
post Re: Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Max
August 04, 2020, 02:14:56 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Max
August 04, 2020, 02:08:07 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
futurist
August 04, 2020, 10:48:35 AM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
UB_Serpent
August 04, 2020, 10:02:39 AM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Jun
August 04, 2020, 08:47:07 AM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Jun
August 04, 2020, 08:43:00 AM
post Re: Does anyone know how this site works.
[General Chat]
Mads Barnkob
August 04, 2020, 08:33:47 AM
post Re: Does anyone know how this site works.
[General Chat]
MRMILSTAR
August 04, 2020, 05:09:26 AM
post Does anyone know how this site works.
[General Chat]
thedoc298
August 04, 2020, 01:54:49 AM
post Fun with wireless power
[Solid State Tesla Coils (SSTC)]
Lightning On Demand
August 03, 2020, 11:55:41 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Teravolt
August 03, 2020, 09:17:40 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
MRMILSTAR
August 03, 2020, 08:30:38 PM
post Re: Budget USB cameras
[High Speed Filming]
missoum0514
August 03, 2020, 06:56:08 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Jun
August 03, 2020, 05:23:15 PM
post Re: Is my xray transformer a ferrite core and how would I drive it?
[Transformer (Ferrite Core)]
nielsquake
August 03, 2020, 05:02:26 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
Max
August 03, 2020, 04:31:04 PM
post Re: Easy to build Polyphonic MIDI Interrupter
[Computers, Microcontrollers, Programmable Logic, Interfaces and Displays]
futurist
August 03, 2020, 10:05:59 AM
post Re: Is my xray transformer a ferrite core and how would I drive it?
[Transformer (Ferrite Core)]
Mads Barnkob
August 03, 2020, 08:21:26 AM
post Re: Is my xray transformer a ferrite core and how would I drive it?
[Transformer (Ferrite Core)]
nielsquake
August 02, 2020, 11:45:38 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
davekni
August 02, 2020, 08:10:47 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
Uspring
August 02, 2020, 07:27:33 PM
post Re: Corona lockdown thread, tell about your situation
[General Chat]
Uspring
August 02, 2020, 07:14:17 PM
post Re: Is my xray transformer a ferrite core and how would I drive it?
[Transformer (Ferrite Core)]
nielsquake
August 02, 2020, 06:58:34 PM
post Re: current limiting to parallel resonance circuit
[Beginners]
davekni
August 02, 2020, 06:49:59 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
Jun
August 02, 2020, 05:10:12 PM
post Re: Dual MOT tesla coil
[Spark Gap Tesla Coils (SGTC)]
MRMILSTAR
August 02, 2020, 04:55:14 PM
post Re: How much is the voltage used in Corona Discharge tubes for ozone Generation?
[Transformer (Ferrite Core)]
UB_Serpent
August 02, 2020, 04:20:13 PM

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 
SimplePortal 2.3.6 © 2008-2014, SimplePortal