Alda-tabs: Domain Specific Language for Guitar Players in the Java Virtual Machine

13 abril 2017

Tags : english, open-source, music, code, jvm, sciart, guitar, alda-tabs, software

Note
This post explains how to easily compose music with alda-tabs, a Domain Specific Language for Guitar Players which runs in the JVM. I have developed alda-tabs as an open source project so you can download it for free in GitHub.

What is alda-tabs?

  • It is a Domain Specific Language for guitar players.

  • It is a piece of software to help guitar players to "execute" their music notes in the JVM, compose songs and get audio feedback.

  • It is an extensible tool for music programming mainly oriented to guitar players.

  • It is built on the top of Alda, a DSL for music composition in the JVM, so it is compatible with both Alda and Clojure.

Why is so easy to code guitar songs with alda-tabs?

  • It does not require programming skills.

  • It does not require traditional music notation.

  • It is as straightforward as writing simple guitar sketches in a notebook.

  • You only have to copy your tabs from the paper to a text editor and execute alda-tabs.

alda tabs

How can I create complex digital music with alda-tabs?

  • With alda-tabs you can execute any .alda file, so you can write your songs/programs in both Clojure, Alda and alda-tabs in the same block of text.

  • It talks to the JVM, so any experimented programmer can do impossible things :-)

  • It is just a layer on the top of Alda, so if you know music theory, then you can write complex songs using music notation.

How is the alda-tabs syntax?

Note
Remember that with alda-tabs you can always use the standard Alda syntax and Clojure code. You can learn more about both languages later to explore the whole potential of alda-tabs. But don’t worry, you don’t need to know more yet. Just follow this tutorial and enjoy :)

What I am gonna show you here is the easy and super simple alda-tabs syntax:

  • The tab notation

  • The chord notation

In 10 minutes you will be able to write songs in a text editor and listen the result in your speakers.

Tab notation

Imagine that you want to play all the strings of the guitar, one after another:

score1

This example is a regular guitar tab in which all the strings are played sequentially with one hand and in which there are not fingers of the other hand pressing the fret.

So the fret number would be 0 in the six positions of the sequence.

How would we write this in Alda syntax?

Don’t worry, I will explain how to do it in alda-tabs syntax bellow (see How to do it in alda-tabs?) but it is important to read this before to compare alda-tabs with Alda.

In Alda syntax we would need to know the note equivalents of each position. And in addition:

  • We would write the octave and the note, one after another:

guitar: o4 e o3 b o3 g o3 d o2 a o2 e
  • Another way would be to write the initial octave increasing/decreasing it when needed:

guitar: o4 e/>b/g/d/<<a/e

How to do it in alda-tabs?

Remember that alda-tabs is based in the simple concept of a tab. Basically, the notes of a guitar can be defined by numeric combinations, a number to identify the string (from the first at the bottom to the sixth at the top) and a fret.

To write a note in alda-tabs you only have to write ta followed by the string number and the fret number.

With alda-tabs we can write the same sequence that we have previously expressed in Alda. But this time we don’t need to know which note we are playing, we only need to write the tab, the position of our finger considering the string and the fret:

 guitar: ta10 ta20 ta30 ta40 ta50 ta60

In this example, we are asking the JMV to play a guitar with the open strings 1, 2, 3, 4, 5 and 6, one after another. That is, ta10 equals string 1 and fret 0 and so on.

Take a look now of the fretboard:

notes fret

If you want to play the first note C, according to the graphic displayed above, you don’t need to know the octave, you just will pick the string 2 in the fret 1: ta + 2 + 1.

guitar: ta21

You can also modify the duration of a note adding a character at the end. For example:

guitar: ta21 ta21W ta21Q ta21D ta21H

What does it mean? If you don’t specify a duration, this will be whole beat (W). You can also play the note during half beat (H), double (D) and quarter (Q). Those note durations will be proportional to the tempo of the score. For example, the following two sentences are not the same:

(tempo 100)
guitar: ta21 ta21W ta21Q ta21D ta21H
(tempo 300)
guitar: ta21 ta21W ta21Q ta21D ta21H

Play with these combinations to see the difference. For more complex timing, check the advanced tips bellow.

Chord notation

Imagine that rather than a sequence of notes you want to play a chord. A basic example would be playing all the open strings at the same time:

score2

You can do this in three ways:

  • In Alda syntax, using the character / to play the notes at the same time:

guitar: o4 e/>b/g/d/<<a/e
  • In alta-tabs syntax, using the tab notation with different voices:

guitar: V1: ta10 V2: ta20 V3: ta30 V4: ta40 V5: ta50 V6: ta60
  • In alta-tabs syntax, but using the chord notation:

guitar: (c 0 0 0 0 0 0 W)

As you can see, the chord notation is just a Clojure function c with seven parameters, the fret of each one of the six strings and the duration of the chord.

For example, the D chord would be

(c 2 3 2 0 x x W)

re

You can also use the chord notation to play single notes. For example, the two following sequences are exactly the same:

# alta-tab syntax

ta10 ta20 ta30 ta40 ta50 ta60

# alda-tab chord syntax

(c 0 x x x x x W)
(c x 0 x x x x W)
(c x x 0 x x x W)
(c x x x 0 x x W)
(c x x x x 0 x W)
(c x x x x x 0 W)

Advanced tips

You can play tabs with specific durations, in seconds or milliseconds by using the function t. In this case you should write the number of the string, followed by a dot and the fret. Add the end, you should express in String format ("") the duration you want.

guitar: (t 1.0 "2s") (t 2.0 "10ms") (t 2.2 "100ms")

You can do the same with your chords:

guitar: (c 0 x 1 2 2 x "5s")

How can I install alta-tabs?

  • Follow the steps to install Alda.

  • Clone this repo and open the folder alda-tabs in your terminal.

  • Run the Alda server with alda up.

  • Create a simple text file, write your song using the alda-tabs syntax and save it.

  • Execute ./alda-tabs.sh followed by the path of the file you want to play.

  • Listen the result.

  • If you want to stop a song you can stop the alda server with alda down.

Note
You can also play some scores (provided in the /examples folder) and modify their content to explore different sounds.

Examples

Note
In this document you can both read the code and listen the output of its execution in alda-tabs. However, the provided audio file is non-stereo. The original output of alda-tabs, however, includes panning. So explore the real result executing the code/song in your own instance of alda-tabs.

Example 1: Chords and arpeggios

You can start exploring the potential of alda-tabs with chords and arpeggios with the example #01:

./alda-tabs.sh examples/01-guitartabs-example.alda

Example 2: The sound of Pi

Try to compose mathematical songs extending Alda and alda-tabs with Clojure. See the example #02:

./alda-tabs.sh examples/02-pi.alda

Example 3: Complex songs

You can also see how beautiful songs with multiple instruments can be written with Alda with the example #03:

./alda-tabs.sh examples/03-hope-for-future-ext.alda

A new research: Introduction to Rhizome Ethnographies

01 marzo 2017

Tags : english, ethnography, multiculturalism, data-visualization, diversity

Note
This article was originally published in the Rhizome Ethnographies site. I have republished it here as an introduction for those who don’t know the project yet.

After several years exploring, from a computational perspective, the evolution of social complexity in heterogeneous and decentralized agent-based models [1] [2], I have decided to start a new stage of research. With this side project, I would like to study the evolution of identity/identities in real social agents. Specifically exploring heterogeneous societies through the observation of their ethnic, linguistic and cultural contexts, and using visual ethnography to learn about transnational identities and multiculturalism.

So let’s say that I am moving from the fields of Computer Science and Information Science to a new multidisciplinary approach closer to the domains of Sociology and Cultural Anthropology. From software simulations of artificial agents to multicultural communities of actual people. From genetic algorithms to GIS analysis, data visualization, maps, sociology and unstructured interviews.

map

So far, most of my research has been based in quantitative approaches, predominantly in-silico modeling of bacteria colonies and artificial societies [3]. I have been studying the evolution of artificial societies with Artificial Intelligence techniques, with the goal of finding answers to Information Science questions [4]. In fact, most of my former research was oriented, under the umbrella of the Complex Adaptive Systems paradigm (CAS), to understand the role of decentralization and heterogeneity in the emergence of social complexity in innovative scenarios [5] [6]. Regarding the application of my research to Social Sciences, you can tell that most of it was mainly grounded on computational and mathematical models. Fortunately, that lack of actual data can be addressed by radically changing my approach.

During my graduate studies, I coined (and re-coined) a couple of terms (such as “P2P Society” or “P2P Paradigm”) trying to understand the social dynamics of a globalized and plural world. A world with fully decentralized communication networks (see distributed topology [6]) and collaborative communities of heterogeneous peers. I also did some side research on distributed technologies such as different blockchain-based projects to frame the P2P society in that growing ecosystem of emancipatory tools and methods. The Bitmind project [7] was one of those initiatives.

I had the chance to exchange knowledge with several scholars from different fields, trying to do multidisciplinary research. But I was always constrained by the limits of my own field and its methodologies. So even though I will continue publishing and doing research in my own field, I would like to explore in parallel a different experience.

In my thesis and the published papers, posters and communications, I always try to be faithful and accurate, and to keep my research as much constrained as possible in order to offer reliable results according to the scientific method. However, sometimes I feel that to explore social issues properly I need something else, something more than just a quantitative and hypothetical-deductive approach. So I decided that it was the time for a new kind of experience, an open-ended side project, a new kind of both personal and academic approach to reality. Less closed and constrained, less machine-ish and more human-ish.

Although I had a great time observing the evolution of different social dynamics with a computationally-based approach, I realized that I wanted to know more about the human being as a social construct. And I wanted to know it from my own subjective point of view, the point of view of another social construct.

Considering the term ‘agent’ as the most convenient to refer to free individuals endowed with reason and autonomy, I can say that this time I am focused in the observation of the agent itself, a common individual within a physical and social environment. And I am doing it with a completely different toolbox. I want to conduct this research with my own ontological and epistemological constraints, but without the ones imposed by an specific academic field. Understand the inner nature of the social agent, and maybe study again the functional and structural evolution of the social object (the social network of agents). But obviously, with a very different approach. This approach shall be less deterministic, objective, quantitative and pretentious, while focusing on the live experience rather than on the expected results. I will accomplish this by going to the arena and getting immersed rather than implementing a synthetic in-silico arena and observing it through a screen, doing visual ethnography and taking field notes rather than coding simulations and analyzing results. If you are more interested in the other perspective, you can check my peer-reviewed publications and follow my other projects.

One of the first steps to make this change happen is to avoid a hypothetical-deductive mindset and assume a more inductive approach, without preconceived axioms, without a priori hypotheses or pretentious irrefutable truths. In order to do that I have to go beyond my academic background, unlearn and relearn again, and start the new stage without self-constraints. With a methodology (or a set of methodologies) but without a fixed and self-constraining outline.

Computational social modeling requires a reduced amount of variables in isolation and a considerable lack of sociological, anthropological, historical or psychological background. Ethnographical research, however, requires a very different mindset. It may imply critical thinking, personal immersion and opened eyes in the seeking of facts, qualitative data and other kinds of knowledge.

Furthermore, self-conducted research can also be phenomenological. And in addition to that, it may imply a bunch of other things. It can be a rhizome of field notes, secondary data, memories and media resources. It can be a mesh of interconnected experiences.

26621997606 86dda84ab8 b

Considering this new stage as a chosen path for knowledge crawling, I would consider it both research, game and art. Besides that, naturally, I would also consider this project a way of self-exploration.

What defines the self besides the constraints of national boundaries, ethnicity, race, religion and culture? Are we just a consequence of our context and history? Would it be possible to understand better the complexity of individual and group identities combining photography and film-making as visual ethnography tools with other traditional methods? Could we generalize what we learn from a small sample of people to understand better the notions of ethnicity, race and cultural identity? What can we discover about the object of study with a phenomenological perspective?

This research follows an ethnographical approach and eventually may use some traditional methods, such as participant and direct observation [8] or unstructured interviewing, in order to look for possible answers to the above-mentioned questions. However, it is mainly a visual ethnography and it uses photography and film-making as visual languages. It is also a phenomenological research. It is also a live experience without hypotheses and pre-conceived axioms. It is a happy lack of expectation.

If you want to know more about the project visit the Rhizome Ethnographies website.

REFERENCES

[1] J. R. Hernandez-Carrion and D. González-Rodriguez, “Modelling Complex Dynamics and Distributed Generation of Knowledge with Bacterial-Based Algorithms,” Scientific Publications / University of Economics in Katowice, vol. Economics and Business Communication Challenges : International Week, pp. 138–148, 2014.

[2] Gonzalez-Rodriguez, Diego and Hernandez-Carrion, Jose Rodolfo, “Decentralization and heterogeneity in complex adaptive systems,” Kybernetes, vol. 44, no. 6/7, pp. 1082–1093, Jun. 2015.

[3] D. González Rodríguez, “Modelización de Sistemas de Computación Distribuida con Bacterias Sintéticas mediante Autómatas Celulares,” 2014.

[4] D. Gonzalez-Rodriguez and J. R. Hernandez-Carrion, “Fundamentos teóricos básicos para la defensa de un paradigma P2P cooperativo desde la perspectiva de la producción de conocimiento,” Revista Iberoamericana de Autogestión y Acción Comunal (RIDAA), vol. 0, no. 66, pp. pp. 55–66, 2015.

[5] D. Gonzalez-Rodriguez and J. R. Hernandez-Carrion, “A Bacterial-Based Algorithm to Simulate Complex Adaptive Systems,” in From Animals to Animats 13, A. P. del Pobil, E. Chinellato, E. Martinez-Martin, J. Hallam, E. Cervera, and A. Morales, Eds. Springer International Publishing, 2014, pp. 250–259.

[6] D. Gonzalez-Rodriguez and V. Kostakis, “Information literacy and peer-to-peer infrastructures: An autopoietic perspective,” Telematics and Informatics, vol. 32, no. 4, pp. 586–593, Nov. 2015.

[7] Gonzalez-Rodriguez, Diego and Shapiro, Ishan, “Scalable cognition through collaborative sense-making: drafting the Open Value Network model,” presented at the Workshop on Synthetic Cognitive Development and Integrated-Distributed Agency (IDA). The Eighth Conference on Artificial General Intelligence, Berlin, 2015.

[8] B. B. Kawulich, “Participant Observation as a Data Collection Method,” Forum Qualitative Sozialforschung / Forum: Qualitative Social Research, vol. 6, no. 2, May 2005.

Blockchain Technologies and the P2P Paradigm

03 febrero 2017

Tags : english, commons, blockchain, p2p

Blockchain, Commons and P2P

Michel Bauwens defines the term P2P as the relational dynamic of distributed networks.

Distributed networks are different from centralized networks, those with a centralized topology on one node. They are also different from the decentralized or federated networks, those with several central nodes connected to each other. In other words, distributed networks would be those whose nodes could be connected without intermediates, exchanging information freely without central control.

Considering this, we can tell that the concept behind the acronym P2P is strongly related with the topology of our communication infrastructures. But it also implies a change in our practices and values, and may lead to a change of paradigm with very important implications in a wide variety of fields such as economics, politics, science or education.

However, when we talk about the Blockchain we are talking basically about a distributed ledger of transactions and the protocol which enables different nodes to use the same ledger. In other words, a protocol that allows agents to be part of the same transaction network by building consensus with cryptographic algorithms.

We can describe the Blockchain-related technologies as one revolutionary step towards the development of fully decentralized (that is, distributed) infrastructures. Furthermore, we can consider that the biggest implication of these new technological frameworks is that they allow something else that just information exchange through distributed networks. Rather, they enable distributed production and flow of value across the Internet.

Coming back to the initial argument (and seen the big picture of the P2P paradigm), Blockchain technologies may imply something else than just a new distributed infrastructure. They may imply the emergence of new organization models for P2P interaction. If a blockchain-based software can enable distributed production and flow of value, then it can be used to bootstrap the value production and distribution capabilities of Commons Based Peer Production (CBPP) communities. Or maybe it can be used exactly for the opposite, to increase control mechanisms or preserve more competition-based political and economic views, like crypto-anarchism or libertarianism. Talking about technology always should imply a critical perspective, and that is one of the main goals of STS.

An optimistic point of view can lead us to consider that the Blockchain hype is kind of a panacea.

It can be a tipping point to reach the dreamed P2P Society, leading to the minimization of strategic homogeneity, as much as the maximization of the decentralization of political and economic structures. It can imply a higher emergence of collective intelligence and self-organization, enabling new peer-to-peer social dynamics, and being a support for new models of knowledge production within the CBPP approach.

However, it is obvious that science and technology should be discussed with a critical eye (and not necessarily by defending any kind of neo-luddism). Assuming that critical mindset and discussing technological breakthroughs from a commons-oriented perspective, may lead to entrepreneurial initiatives focused on the improvement of our communities. Emphasizing the idea of combining Blockchain-enabled technologies with the production goals of P2P paradigm, the project Bitmind was born in 2015 as a commons-oriented startup.

Bitmind and the Open Value Networks

I founded Bitmind, in collabotation with Vasilis Kostakis (P2P Lab) and Ishan Shapiro (Metamaps), as a decentralized entrepreneurial initiative whose goal was the exploration of the potential of Open Value Networks (OVN) by using blockchain-based technologies.

It was founded in early 2015 as a side entrepreneurial project, looking for an application of my doctoral dissertation. Bitmind was one of the initiatives funded during the Faircoop donations campaign in 2015.

The summer of 2015, Bitmind founders were invited to present the OVN model at the AGI Conference 2015 (The eighth Conference on Artificial General Intelligence). The talk, “Scalable cognition through collaborative sense-making: drafting the Open Value Network model” was included in the Workshop on Synthetic Cognitive Development and Integrated-Distributed Agency (IDA), organized by David Weinbaum and Viktoras Veitas from the Global Brain Institute (Free University of Brussels). Our talk was introduced by Ben Goertzel.

Some months later, after discussing with the teams of Sensorica and Backfeed about our common interests, we decided to focus our efforts in applied research & open source development around the OVN/DCO context, exploring how new models for self-organization could enforce the value production capacities within the P2P paradigm. In order to unify concepts, share common methodologies and explore the field, we talked about the need of creating a shared hub for this evolving and growing ecosystem.

Bitmind’s initial goal was to help Open Enterprises, Cooperatives and Communities to distribute value amongst their members and bootstrap their collective intelligence by using P2P infrastructures. In order to unify concepts, share common methodologies and explore that field, we developed OVN.SPACE. This initiative enabled collaboration between different Open Value Networks, including companies and projects such as Sensorica, Backfeed, The Citizens Media, Mikorizal, Metamaps, Value Flows and Kendra Initiative.

In October 2015, a group of 35 designers, engineers, and entrepreneurs from all over the world gathered in Oakland, California. They group consisted of founders and key contributors from Enspiral, Loomio, CoBudget, Chalkle, Robin Hood Cooperative, Identity.com, Hylo, Ethereum, Citizen Code, Metamaps.cc, Bitmind, KiwiConnect, Lifehack, Planetwork, Impact Hub, Refugio Resource, Pyxis, Triaxiom9, CivicMakers and more. As a consequence of some days of exchange and dialogue about the creation of tools, strategies, and networks to build a new collaborative commons, the Collaborative Technology Alliance was created.

One month later, the P2P Lab (Tallinn University of Technology) included Bitmind as a commons-oriented start-up in its plans for 2016. After that, Bitmind members, with other collaborators of the P2P Lab, worked on proposals to explore blockchain technologies under the framework of the European Union research goals.

I started to collaborate with Primavera de Filippi (Berkman Center for Internet & Society at Harvard) and Vasilis Kostakis. And at the beginning of 2016, COALA (organizer the first Blockchain Workshops at Harvard, MIT and Stanford) invited me to participate in the Blockchain Workshop 2016 in New York City, to present Bitmind with other blockchain-based projects in front of potential investors.

The transfer of Bitmind to the P2P Foundation

The project was gaining momentum.

I started to receive job offers from blockchain-related enterprises like Visa Research and Coinbase. But I was tired of the entrepreneurial stress and the fast evolution of the Blockchain ecosystem. Companies such as Facebook or Amazon started to contact me.

That was too much, so I decided to take a step back.

I had just moved to North Carolina and had other plans for my life. I wanted to continue working remotely for Enxendra Technologies while developing my next personal initiatives. This time I wanted to unify all my research interests, but looking more to the creative process than to the market.

So I founded the SciArt Lab and started as Visiting Researcher for the University of North Carolina, developing my new research interests.

I focused on other projects, initiating a process of coordination to transfer the Bitmind initiative to the P2P Foundation.

Since it was founded, Bitmind efforts were mostly in applied research & open source development around the context of Open Value Networks and Distributed Collaborative Organizations, exploring how new models for self-organization could enforce the value production capacities within the P2P paradigm.

Bitmind was one of the first entrepreneurial initiatives oriented to unify CBPP governance and economic models with blockchain-based technologies, helping to initiate the conversation about new self-organizing infrastructures in value production communities.

In July 2016, Bitmind funds were transferred to the P2P Foundation.