Welcome
Username or Email:

Password:


Missing Code




[ ]
[ ]
Online
  • Guests: 69
  • Members: 0
  • Newest Member: omjtest
  • Most ever online: 396
    Guests: 396, Members: 0 on 12 Jan : 12:51
Members Birthdays:
All today's birthdays', congrats!
Capper (60)
cereus (73)
Mcanderson (43)


Next birthdays
11/06 dan (37)
11/06 rchydro (64)
11/06 CapRack (30)
Contact
If you need assistance, please send an email to forum at 4hv dot org. To ensure your email is not marked as spam, please include the phrase "4hv help" in the subject line. You can also find assistance via IRC, at irc.shadowworld.net, room #hvcomm.
Support 4hv.org!
Donate:
4hv.org is hosted on a dedicated server. Unfortunately, this server costs and we rely on the help of site members to keep 4hv.org running. Please consider donating. We will place your name on the thanks list and you'll be helping to keep 4hv.org alive and free for everyone. Members whose names appear in red bold have donated recently. Green bold denotes those who have recently donated to keep the server carbon neutral.


Special Thanks To:
  • Aaron Holmes
  • Aaron Wheeler
  • Adam Horden
  • Alan Scrimgeour
  • Andre
  • Andrew Haynes
  • Anonymous000
  • asabase
  • Austin Weil
  • barney
  • Barry
  • Bert Hickman
  • Bill Kukowski
  • Blitzorn
  • Brandon Paradelas
  • Bruce Bowling
  • BubeeMike
  • Byong Park
  • Cesiumsponge
  • Chris F.
  • Chris Hooper
  • Corey Worthington
  • Derek Woodroffe
  • Dalus
  • Dan Strother
  • Daniel Davis
  • Daniel Uhrenholt
  • datasheetarchive
  • Dave Billington
  • Dave Marshall
  • David F.
  • Dennis Rogers
  • drelectrix
  • Dr. John Gudenas
  • Dr. Spark
  • E.TexasTesla
  • eastvoltresearch
  • Eirik Taylor
  • Erik Dyakov
  • Erlend^SE
  • Finn Hammer
  • Firebug24k
  • GalliumMan
  • Gary Peterson
  • George Slade
  • GhostNull
  • Gordon Mcknight
  • Graham Armitage
  • Grant
  • GreySoul
  • Henry H
  • IamSmooth
  • In memory of Leo Powning
  • Jacob Cash
  • James Howells
  • James Pawson
  • Jeff Greenfield
  • Jeff Thomas
  • Jesse Frost
  • Jim Mitchell
  • jlr134
  • Joe Mastroianni
  • John Forcina
  • John Oberg
  • John Willcutt
  • Jon Newcomb
  • klugesmith
  • Leslie Wright
  • Lutz Hoffman
  • Mads Barnkob
  • Martin King
  • Mats Karlsson
  • Matt Gibson
  • Matthew Guidry
  • mbd
  • Michael D'Angelo
  • Mikkel
  • mileswaldron
  • mister_rf
  • Neil Foster
  • Nick de Smith
  • Nick Soroka
  • nicklenorp
  • Nik
  • Norman Stanley
  • Patrick Coleman
  • Paul Brodie
  • Paul Jordan
  • Paul Montgomery
  • Ped
  • Peter Krogen
  • Peter Terren
  • PhilGood
  • Richard Feldman
  • Robert Bush
  • Royce Bailey
  • Scott Fusare
  • Scott Newman
  • smiffy
  • Stella
  • Steven Busic
  • Steve Conner
  • Steve Jones
  • Steve Ward
  • Sulaiman
  • Thomas Coyle
  • Thomas A. Wallace
  • Thomas W
  • Timo
  • Torch
  • Ulf Jonsson
  • vasil
  • Vaxian
  • vladi mazzilli
  • wastehl
  • Weston
  • William Kim
  • William N.
  • William Stehl
  • Wesley Venis
The aforementioned have contributed financially to the continuing triumph of 4hv.org. They are deserving of my most heartfelt thanks.
Forums
4hv.org :: Forums :: General Science and Electronics
« Previous topic | Next topic »   

MIDI Pitch Bend Help

Move Thread LAN_403
MRacerxdl
Wed Oct 05 2011, 06:53AM Print
MRacerxdl Registered Member #989 Joined: Sat Sept 08 2007, 02:15AM
Location: São Paulo, Brazil
Posts: 476
Hi all,

I'm asking some help from someone who already built a MIDI Interrupter with Pitch Bend...

I studied many documents about MIDI Signals, and I saw that Pitch Bend Range is defined by the controller.

I'm trying to do that with my FPGA MIDI Interrupter, but I really dont know what I should do.

Some audio experts said that normally the Pitch Bend goes from 2 semitones down to 2 semitones up (most default settings), but the problem isnt that.

The Pitch Bend is two 7 bits (LSB and MSB) data, so it gives me 16384 with 8192 as a "zero".

The Fruit Loops sends me sometimes the Minimum (from the pitch wheel) of 6827 and max of 9557, and other times it sends 7510 as minimum and 8874 as max. It can even be different than that.

I didnt find where it defines from where to where the pitch goes, or if its a fixed note range with the Whell.

Anyone can help me with that?

Thanks!
Back to top
dude_500
Fri Oct 07 2011, 01:50PM
dude_500 Registered Member #2288 Joined: Wed Aug 12 2009, 10:42PM
Location: Cambridge, MA
Posts: 179
The pitch bend is two bytes, for a total rangin 0 to 16384. If the value is less than 8192, it is a pitch down. If it is greater than 8192, it is a pitch up. I imagine there is a standard of how far it bends, but it's not encoded in the midi stream as far as I know, since there is a variable in my code of pitch_wheel_steps. Here is the code for pitching from my ATMEL controller:

if(pval<8192){ //pitch down command
int freqLOW = noteFreqs[note-pitch_wheel_steps];
return map(pval, 0, 8192, freqLOW, initfreq); //returns a mapped result
}
else{ //pitch up command
int freqHIGH = noteFreqs[note+pitch_wheel_steps];
return map(pval, 8192, 16383, initfreq, freqHIGH); //returns a mapped result
}
Back to top
MRacerxdl
Sat Oct 08 2011, 05:44AM
MRacerxdl Registered Member #989 Joined: Sat Sept 08 2007, 02:15AM
Location: São Paulo, Brazil
Posts: 476
I saw that GM recommends to bend from two semitones lower to two semitones higher (or one tone up and down).

the noteFreqs array is only the octaves note, or you made a table with steps between the semitones?

I will post more details of my interrupter soon. I need to write a documentation.

As I made on a FPGA, it may help much people to design their own MIDI Interrupters :D

An overview:
Link2

Thanks for the help!
Back to top
dude_500
Sat Oct 08 2011, 04:14PM
dude_500 Registered Member #2288 Joined: Wed Aug 12 2009, 10:42PM
Location: Cambridge, MA
Posts: 179
MRacerxdl wrote ...

I saw that GM recommends to bend from two semitones lower to two semitones higher (or one tone up and down).

the noteFreqs array is only the octaves note, or you made a table with steps between the semitones?

I will post more details of my interrupter soon. I need to write a documentation.

As I made on a FPGA, it may help much people to design their own MIDI Interrupters :D

An overview:
Link2

Thanks for the help!

NoteFreqs is an array with the frequency of each midi note. So for wheel<8192 it grabs the frequency of the target note minus pitch-wheel-steps, which is what the frequency would be if the pitch wheel signal were zero. It then maps the pitch wheel between 0 and 8192 to the fully pitch wheeled note through normal note. The equivalent occurs for if the pitch wheel is greater than 8192, except it is adding rather than subtracting. There is no need for an array of tones between semitones.

I would be curious to see your FPGA work, but the link you posted is dead.
Back to top
MRacerxdl
Sat Oct 08 2011, 05:57PM
MRacerxdl Registered Member #989 Joined: Sat Sept 08 2007, 02:15AM
Location: São Paulo, Brazil
Posts: 476
lol, i didnt get it what you done lol [EDIT] I didnt understand what that map function does... I never used that lol

Here is another link to the pic:
Link2 (Big Pic)

It is basicly what all people do with uC. I made state machine to process the three bytes of midi. If I turn on a note, the state machine will search for an available PWM to set the period. Also it calcs in realtime the tOn of the note, with it will be 5% of period on max of 180us (can be set)... Also I have a protection on the output that sets the maximum tOn to 250us (in case I have some bug at the code)

I will post the source code soon too :D

The sound is pretty good now:


The video isnt good, because I noticed only after doing this video that my Cellphone has two mics and now only one (and I only put a tape on one)...

But it was much bugs in my design when I done that video, now I corrected all. Hope to test it soon.

Back to top

Moderator(s): Chris Russell, Noelle, Alex, Tesladownunder, Dave Marshall, Dave Billington, Bjørn, Steve Conner, Wolfram, Kizmo, Mads Barnkob

Go to:

Powered by e107 Forum System
 
Legal Information
This site is powered by e107, which is released under the GNU GPL License. All work on this site, except where otherwise noted, is licensed under a Creative Commons Attribution-ShareAlike 2.5 License. By submitting any information to this site, you agree that anything submitted will be so licensed. Please read our Disclaimer and Policies page for information on your rights and responsibilities regarding this site.