Page 1 of 1

Varying timbre

Posted: Sun Apr 27, 2014 2:20 am
by abminor
I m thinking. This game doesn't need much changes for us to start recognizing tones outside of it and possibly in music. As I wrote before, I experimented with pressing the space bar several times in a row to produce melodies and I could still hear the categories of pitches. Another member of the forum (sorry I don't recall his name) tried to play midi music with the same midi instrument used in a the game and he could recognize someof the pitches.

So I think just adding a feature to vary timbre would produce results (outside the game). Sure, I understand that we have to wait to complete the game first for the sake of experiment (I guess it would make more difficult to draw conclusion if there were multiple changing factors) but I can tell you I m feeling quite impatient.

I guess I ll just have to keep going and there is still a long way toward the end. I m only at level 4 :(

Posted: Sun Apr 27, 2014 9:37 am
by aruffo
There is a technical reason I didn't do that-- because changing the timbre isn't just "adding a feature." Realbasic is limited in that it can't produce microtones on the PC, so I have to plot, generate, record, and save all the tones as individual MP3s. For APP, creating another instrument isn't just flipping on an option to choose your instrument (as it is with the other games) but actually means manually creating all 180 microtones for each choice. If the game works with piano in one octave, then it'll be obvious that it's worth it to do the rest... or even to teach myself something other than Realbasic to sidestep the issue altogether.

Posted: Sun Apr 27, 2014 5:23 pm
by abminor
Allright. I see. If it is possible to generate microtones in midi with other languages. You might consider to just write a library in an other language and call it from realbasic. I don't know much about realbasic but most programming languages allow to do that.

Posted: Thu May 01, 2014 5:56 am
by Axeman
I thought that tembre would be a good additiion too at first but I am beginning to get a feel for the chroma of each note category now.
I think it is good to stay with one tembre at first as it is the category perception that is being developed on the game not the category within a number of tembres.
It was a bit of a surprise tp me to hear the chroma on some notes as I am on level three and I couldnt hear any difference between Blue=grey and brown except height at first. But now I am definitely hearing a difference in quality.
I tried an experiment with my guitar the other day just bending a note up to see when it began to feel like the next semitone. It was a good approximation to the game and also a good listening task. This exercise (on guitar and on APP) feels so much more like refining the sense of chroma to me. More so than APA. I am still playing APA and chord hopper too.

Re: Varying timbre

Posted: Thu Jun 14, 2018 3:03 am
by YarnTSS
Does Realbasic support the MIDI pitch bend command? If so, then perhaps you can use that to generate the microtones within ETC.

Re: Varying timbre

Posted: Sun Jun 24, 2018 9:12 pm
by aruffo
The Mac could handle that stuff just fine—but the PC build would just play noise. It was frustrating.

Re: Varying timbre

Posted: Tue Jun 26, 2018 2:05 am
by YarnTSS
Well, there is another (and probably better) method that involves sending a series of six control change messages. Does Realbasic support those by any chance?

(In case you don't know, control change messages are used to control stuff like volume, panning, and the sustain pedal, among other things. For example, control 64 controls the sustain pedal; setting it to the value 127 presses the pedal, and setting it to 0 releases the pedal.)

Re: Varying timbre

Posted: Wed Jun 27, 2018 2:36 pm
by aruffo
Honestly, I'm not sure-- I just know that every time I indicated a note other than the standard MIDI it didn't work on a PC. What "control change messages" are you referring to?

Re: Varying timbre

Posted: Wed Jun 27, 2018 10:16 pm
by YarnTSS
I'm referring to control change messages that are used to adjust "registered parameters," or RPNs. Out of the three that are defined by General MIDI, one of them adjusts the fine-tuning of a channel by as much as 100 cents. Here's how it's done:
  1. Set control 101 (RPN MSB, or most significant byte) to 0.
  2. Set control 100 (RPN LSB, or least significant byte) to 1.
  3. Set control 6 (data entry MSB) to the appropriate value (see below).
  4. Set control 38 (data entry LSB) to the appropriate value (see below).
  5. Set control 101 (RPN MSB) to 127.
  6. Set control 100 (RPN LSB) to 127.
The first two commands indicate the start of an RPN message as well as which registered parameter will be adjusted (in this case, the "channel fine tune" parameter). The next two commands set the value of the registered parameter. Finally, the last two commands indicate the end of the RPN message.

To get the correct values for the data entry commands (the middle two), first multiply the number of cents above A440 (which can be negative) by 81.92 (or, if you wish to work solely with integers, multiply by 8192, then divide by 100), then add 8192 to the result. The lowest 7 bits of this result are the data entry LSB value, and the next 7 bits are the MSB value.

Here are some useful reference points for the MSB and LSB values:
  • MSB=0, LSB=0: -100 cents (minimum)
  • MSB=32, LSB=0: -50 cents
  • MSB=64, LSB=0: A440
  • MSB=96, LSB=0: +50 cents
  • MSB=127, LSB=127: +100 cents (actually, I think it's closer to +99.99 cents) (maximum)
This registered parameter has a range of -100 cents to extremely close to +100 cents and a resolution of 100/8192 cent (about 0.012 cents), which should be far more than sufficient for Absolute Pitch Painter (assuming, of course, you can actually use these commands).

(And remember that these commands only affect the MIDI channel that they're sent to, so make sure they go to the correct channel!)

Re: Varying timbre

Posted: Sat Feb 02, 2019 8:04 pm
by YarnTSS
I decided to look into this subject and found this:

(From what I gather, RealBasic is called Xojo now. I assume this is what you are actually using.)

That's Xojo's NotePlayer method, which appears to be the only MIDI-related method available (apart from using FolderItem.OpenAsSound to play MIDI files). Am I right? If so, then it looks like you're screwed here; the only functions I could find there are assigning an instrument and playing a note of a given pitch and velocity, with no way to send control change messages. It does support microtones by using the values 256-32767 rather than the normal 0-127, but it sounds like that's not working properly under Windows for whatever reason.

(Actually, there may still be a way, albeit rather dirty: use BinaryStream to write a MIDI file containing the desired messages, then play it back using FolderItem.OpenAsSound. You don't have to (and probably shouldn't) do this as soon as the note is to be played; writing all the necessary files somewhere as the session begins may also work (provided, of course, RealBasic/Xojo doesn't take forever to do so). If you need me to, I can try to figure out the necessary byte sequences for such files. EDIT: Upon closer inspection, it looks like FolderItem.OpenAsSound doesn't play MIDI files on macOS. So, unless you can (and are willing to) have the program behave differently under different operating systems, it looks like you really are out of luck.)

Re: Varying timbre

Posted: Mon Feb 18, 2019 5:24 am
by aruffo
Yes, that's the problem. I've been looking into possibilities for app programming; that's really the only obvious next step.!